[beast: 1/4] TOOLS: fix average energy output for completely silent samples



commit e355c9549db9f5c6c2ea1619b50fd452e10fd074
Author: Stefan Westerfeld <stefan space twc de>
Date:   Thu Mar 9 22:07:41 2017 +0100

    TOOLS: fix average energy output for completely silent samples
    
    Output average energy = -200 instead of -inf, in order to be able to parse
    and compare features using bsefextract.
    
    Signed-off-by: Stefan Westerfeld <stefan space twc de>

 tools/bsefextract.cc |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]