Mercurial > hg > pyin
changeset 116:e9b99e85b929 tony
one minor one major thing:
* moved line in PYinVamp.cpp -- should not have any effect
* reinstated using peaks instead of using the difference function directly
author | matthiasm |
---|---|
date | Mon, 23 Mar 2015 16:37:28 +0000 |
parents | 50e39363a3cb |
children | 1b75e5fd4b99 |
files | PYinVamp.cpp YinUtil.cpp |
diffstat | 2 files changed, 10 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/PYinVamp.cpp Mon Mar 23 16:09:48 2015 +0000 +++ b/PYinVamp.cpp Mon Mar 23 16:37:28 2015 +0000 @@ -449,10 +449,8 @@ } rms /= m_blockSize; rms = sqrt(rms); - // float m_lowAmp = 0.5; + bool isLowAmplitude = (rms < m_lowAmp); - float factor = ((rms+0.01*m_lowAmp)/(1.01*m_lowAmp)); - // std::cerr << rms << " " << factor << std::endl; Yin::YinOutput yo = m_yin.processProbabilisticYin(dInputBuffers); delete [] dInputBuffers; @@ -466,9 +464,11 @@ { double tempPitch = 12 * std::log(yo.freqProb[iCandidate].first/440)/std::log(2.) + 69; if (!isLowAmplitude) + { tempPitchProb.push_back(pair<double, double> (tempPitch, yo.freqProb[iCandidate].second)); - else { + } else { + float factor = ((rms+0.01*m_lowAmp)/(1.01*m_lowAmp)); tempPitchProb.push_back(pair<double, double> (tempPitch, yo.freqProb[iCandidate].second*factor)); }
--- a/YinUtil.cpp Mon Mar 23 16:09:48 2015 +0000 +++ b/YinUtil.cpp Mon Mar 23 16:37:28 2015 +0000 @@ -288,12 +288,12 @@ minInd = tau; } currThreshInd = nThresholdInt-1; - // while (thresholds[currThreshInd] > yinBuffer[tau] && currThreshInd > -1) { - // // std::cerr << distribution[currThreshInd] << std::endl; - // peakProb[tau] += distribution[currThreshInd]; - // currThreshInd--; - // } - peakProb[tau] = 1 - yinBuffer[tau]; + while (thresholds[currThreshInd] > yinBuffer[tau] && currThreshInd > -1) { + // std::cerr << distribution[currThreshInd] << std::endl; + peakProb[tau] += distribution[currThreshInd]; + currThreshInd--; + } + // peakProb[tau] = 1 - yinBuffer[tau]; sumProb += peakProb[tau]; tau++; } else {