changeset 65:16129c3b1cf5 tony

more severe cut-down on probability if quiet
author matthiasm
date Wed, 02 Apr 2014 17:35:37 +0100
parents 60eb8771d340
children e2bbf853513d
files MonoNoteParameters.cpp MonoPitchHMM.cpp PYinVamp.cpp
diffstat 3 files changed, 11 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/MonoNoteParameters.cpp	Fri Mar 07 10:43:55 2014 +0000
+++ b/MonoNoteParameters.cpp	Wed Apr 02 17:35:37 2014 +0100
@@ -14,9 +14,9 @@
 #include "MonoNoteParameters.h"
 
 MonoNoteParameters::MonoNoteParameters() :
-    minPitch(39), 
+    minPitch(35), 
     nPPS(3), 
-    nS(64), 
+    nS(68), 
     nSPP(4), // states per pitch
     n(0),
     initPi(0), 
--- a/MonoPitchHMM.cpp	Fri Mar 07 10:43:55 2014 +0000
+++ b/MonoPitchHMM.cpp	Wed Apr 02 17:35:37 2014 +0100
@@ -22,7 +22,7 @@
 using std::pair;
 
 MonoPitchHMM::MonoPitchHMM() :
-m_minFreq(77.782), // e flat 2
+m_minFreq(61.735), // b 1
 // m_minFreq(110),
 m_nBPS(5),
 m_nPitch(0),
@@ -32,7 +32,7 @@
 m_freqs(0)
 {
     m_transitionWidth = 9*(m_nBPS/2) + 1;
-    m_nPitch = 64 * m_nBPS;
+    m_nPitch = 69 * m_nBPS;
     m_freqs = vector<double>(2*m_nPitch);
     for (size_t iPitch = 0; iPitch < m_nPitch; ++iPitch)
     {
--- a/PYinVamp.cpp	Fri Mar 07 10:43:55 2014 +0000
+++ b/PYinVamp.cpp	Wed Apr 02 17:35:37 2014 +0100
@@ -366,8 +366,11 @@
     }
     rms /= m_blockSize;
     rms = sqrt(rms);
-    float lowAmp = 0.05;
+    float lowAmp = 0.1;
     bool isLowAmplitude = (rms < lowAmp);
+    float factor = ((rms+0.01*lowAmp)/(1.01*lowAmp));
+    // std::cerr << rms << " " << factor << std::endl;
+    factor *= factor;
     
     Yin::YinOutput yo = m_yin.processProbabilisticYin(dInputBuffers);
     delete [] dInputBuffers;
@@ -381,9 +384,10 @@
         if (!isLowAmplitude)
             tempPitchProb.push_back(pair<double, double>
                 (tempPitch, yo.freqProb[iCandidate].second));
-        else
+        else {
             tempPitchProb.push_back(pair<double, double>
-                (tempPitch, yo.freqProb[iCandidate].second*((rms+0.01*lowAmp)/(1.01*lowAmp))));
+                (tempPitch, yo.freqProb[iCandidate].second*factor));
+        }
     }
     m_pitchProb.push_back(tempPitchProb);
     m_timestamp.push_back(timestamp);