Mercurial > hg > pyin
changeset 25:b13537bbaa77
removed the useless initial state for the pitch tracker
author | matthiasm |
---|---|
date | Tue, 21 Jan 2014 18:32:36 +0000 |
parents | 2ba134318d2c |
children | 0ce1c877f73f |
files | Makefile.osx MonoPitchHMM.cpp PYIN.cpp |
diffstat | 3 files changed, 6 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/Makefile.osx Tue Jan 21 17:52:16 2014 +0000 +++ b/Makefile.osx Tue Jan 21 18:32:36 2014 +0000 @@ -1,4 +1,4 @@ -ARCHFLAGS := -arch x86_64 -arch i386 -mmacosx-version-min=10.7 +ARCHFLAGS := -arch x86_64 -mmacosx-version-min=10.7 CFLAGS := $(ARCHFLAGS) -O3 -I../vamp-plugin-sdk -I/usr/local/boost -Wall -fPIC CXXFLAGS := $(CFLAGS)
--- a/MonoPitchHMM.cpp Tue Jan 21 17:52:16 2014 +0000 +++ b/MonoPitchHMM.cpp Tue Jan 21 18:32:36 2014 +0000 @@ -32,15 +32,12 @@ { m_transitionWidth = 5*(m_nBPS/2) + 1; m_nPitch = 48 * m_nBPS; - m_freqs = vector<double>(2*m_nPitch+1); + m_freqs = vector<double>(2*m_nPitch); for (size_t iPitch = 0; iPitch < m_nPitch; ++iPitch) { m_freqs[iPitch] = m_minFreq * std::pow(2, iPitch * 1.0 / (12 * m_nBPS)); - // m_freqs[iPitch+m_nPitch] = -2; m_freqs[iPitch+m_nPitch] = -m_freqs[iPitch]; - // std::cerr << "pitch " << iPitch << " = " << m_freqs[iPitch] << std::endl; } - m_freqs[2*m_nPitch] = -1; build(); } @@ -84,8 +81,7 @@ MonoPitchHMM::build() { // INITIAL VECTOR - init = vector<double>(2*m_nPitch+1); - init[2*m_nPitch] = 1; // force first frame to be unvoiced. + init = vector<double>(2*m_nPitch, 1.0 / 2*m_nPitch); // TRANSITIONS for (size_t iPitch = 0; iPitch < m_nPitch; ++iPitch) @@ -139,9 +135,9 @@ // transProb.push_back(1-m_selfTrans); // TRANSITION FROM UNVOICED TO PITCH - from.push_back(2*m_nPitch); - to.push_back(iPitch+m_nPitch); - transProb.push_back(1.0/m_nPitch); + // from.push_back(2*m_nPitch); + // to.push_back(iPitch+m_nPitch); + // transProb.push_back(1.0/m_nPitch); } // UNVOICED SELFTRANSITION // from.push_back(2*m_nPitch);
--- a/PYIN.cpp Tue Jan 21 17:52:16 2014 +0000 +++ b/PYIN.cpp Tue Jan 21 18:32:36 2014 +0000 @@ -423,9 +423,7 @@ // MONO-PITCH STUFF MonoPitch mp; -// std::cerr << "before viterbi" << std::endl; vector<float> mpOut = mp.process(m_pitchProb); - // std::cerr << "after viterbi " << mpOut.size() << " "<< m_timestamp.size() << std::endl; for (size_t iFrame = 0; iFrame < mpOut.size(); ++iFrame) { if (mpOut[iFrame] < 0 && (m_outputUnvoiced==0)) continue;