changeset 231:d9b688700819 norm eval-norm-todate

Merge from default branch
author Chris Cannam
date Wed, 16 Jul 2014 17:46:15 +0100
parents 5ba328aae5be (diff) 9fa02a1c9bb6 (current diff)
children aec03b944a5e
files testdata/TRIOS-groundtruth/convert_midifileout.yeti testdata/TRIOS-groundtruth/convert_svout.yeti testdata/evaluation/batchProcessingEvaluate.m testdata/evaluation/computeNoteLevelAccuracy.m testdata/evaluation/convertMIDIToPianoRoll.m
diffstat 2 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/Silvet.cpp	Wed Jul 16 17:37:43 2014 +0100
+++ b/src/Silvet.cpp	Wed Jul 16 17:46:15 2014 +0100
@@ -390,6 +390,7 @@
     m_pianoRoll.clear();
     m_columnCount = 0;
     m_startTime = RealTime::zeroTime;
+    m_signalMax = 0.0;
 }
 
 Silvet::FeatureSet
@@ -401,7 +402,18 @@
     
     vector<double> data;
     for (int i = 0; i < m_blockSize; ++i) {
-        data.push_back(inputBuffers[0][i]);
+        double d = inputBuffers[0][i];
+        if (fabs(d) > m_signalMax) {
+            m_signalMax = fabs(d);
+        } 
+    }
+    for (int i = 0; i < m_blockSize; ++i) {
+        double d = inputBuffers[0][i];
+        if (m_signalMax > 0.0) {
+            data.push_back(d / m_signalMax * 0.5);
+        } else {
+            data.push_back(0.0);
+        }
     }
 
     if (m_resampler) {
--- a/src/Silvet.h	Wed Jul 16 17:37:43 2014 +0100
+++ b/src/Silvet.h	Wed Jul 16 17:46:15 2014 +0100
@@ -107,6 +107,8 @@
     int m_columnCount;
     Vamp::RealTime m_startTime;
 
+    double m_signalMax;
+
     mutable int m_notesOutputNo;
     mutable int m_fcqOutputNo;
 };