Mercurial > hg > pyin
comparison MonoPitchHMM.cpp @ 90:b087967c4417
removed fourth "inter-note" state because it wasn't used anyway
author | matthiasm |
---|---|
date | Wed, 07 Jan 2015 15:22:03 +0000 |
parents | 354c2c421661 |
children | 7ef7f6e90966 |
comparison
equal
deleted
inserted
replaced
89:354c2c421661 | 90:b087967c4417 |
---|---|
20 | 20 |
21 using std::vector; | 21 using std::vector; |
22 using std::pair; | 22 using std::pair; |
23 | 23 |
24 MonoPitchHMM::MonoPitchHMM() : | 24 MonoPitchHMM::MonoPitchHMM() : |
25 m_minFreq(27.5), | 25 m_minFreq(61.735), |
26 m_nBPS(5), | 26 m_nBPS(5), |
27 m_nPitch(0), | 27 m_nPitch(0), |
28 m_transitionWidth(0), | 28 m_transitionWidth(0), |
29 m_selfTrans(0.99), | 29 m_selfTrans(0.99), |
30 m_yinTrust(.5), | 30 m_yinTrust(.5), |
31 m_freqs(0) | 31 m_freqs(0) |
32 { | 32 { |
33 m_transitionWidth = 5*(m_nBPS/2) + 1; | 33 m_transitionWidth = 5*(m_nBPS/2) + 1; |
34 m_nPitch = 72 * m_nBPS; | 34 m_nPitch = 69 * m_nBPS; |
35 m_freqs = vector<double>(2*m_nPitch); | 35 m_freqs = vector<double>(2*m_nPitch); |
36 for (size_t iPitch = 0; iPitch < m_nPitch; ++iPitch) | 36 for (size_t iPitch = 0; iPitch < m_nPitch; ++iPitch) |
37 { | 37 { |
38 m_freqs[iPitch] = m_minFreq * std::pow(2, iPitch * 1.0 / (12 * m_nBPS)); | 38 m_freqs[iPitch] = m_minFreq * std::pow(2, iPitch * 1.0 / (12 * m_nBPS)); |
39 m_freqs[iPitch+m_nPitch] = -m_freqs[iPitch]; | 39 m_freqs[iPitch+m_nPitch] = -m_freqs[iPitch]; |