[PATCH] fix average energy output for completely silent samples

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] fix average energy output for completely silent samples

Stefan Westerfeld
Here is a fix for recent -inf related bsefextract problems. It should be
backward compatible, i.e. if the average energy is non-zero, the same values
are produced.

Stefan Westerfeld (1):
  TOOLS: fix average energy output for completely silent samples

 tools/bsefextract.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.7.4

_______________________________________________
beast mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/beast
Reply | Threaded
Open this post in threaded view
|

[PATCH] TOOLS: fix average energy output for completely silent samples

Stefan Westerfeld
Output average energy = -200 instead of -inf, in order to be able to parse
and compare features using bsefextract.

Signed-off-by: Stefan Westerfeld <[hidden email]>
---
 tools/bsefextract.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/bsefextract.cc b/tools/bsefextract.cc
index 501698b..2b4f90a 100644
--- a/tools/bsefextract.cc
+++ b/tools/bsefextract.cc
@@ -515,7 +515,7 @@ struct AvgEnergyFeature : public Feature
     if (avg_energy_count)
       avg_energy /= avg_energy_count;
 
-    avg_energy = 10 * log (avg_energy) / log (10);
+    avg_energy = bse_db_from_factor (sqrt (avg_energy), -200);
   }
 
   void print_results() const
--
2.7.4

_______________________________________________
beast mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/beast