comparison CepstrumPitchTracker.cpp @ 17:edc7f59404da track

Make it, at least broadly, work
author Chris Cannam
date Sat, 30 Jun 2012 10:10:05 +0100
parents 63dde216ea37
children 791e5c115b8d
comparison
equal deleted inserted replaced
16:63dde216ea37 17:edc7f59404da
114 114
115 CepstrumPitchTracker::Hypothesis::State 115 CepstrumPitchTracker::Hypothesis::State
116 CepstrumPitchTracker::Hypothesis::getState() 116 CepstrumPitchTracker::Hypothesis::getState()
117 { 117 {
118 return m_state; 118 return m_state;
119 }
120
121 int
122 CepstrumPitchTracker::Hypothesis::getPendingLength()
123 {
124 return m_pending.size();
119 } 125 }
120 126
121 CepstrumPitchTracker::Hypothesis::Estimates 127 CepstrumPitchTracker::Hypothesis::Estimates
122 CepstrumPitchTracker::Hypothesis::getAcceptedEstimates() 128 CepstrumPitchTracker::Hypothesis::getAcceptedEstimates()
123 { 129 {
490 candidate = i; 496 candidate = i;
491 } 497 }
492 break; 498 break;
493 } 499 }
494 } 500 }
501
495 if (m_accepted.getState() == Hypothesis::Expired) { 502 if (m_accepted.getState() == Hypothesis::Expired) {
496 m_accepted.addFeatures(fs[0]); 503 m_accepted.addFeatures(fs[0]);
504 }
505
506 if (m_accepted.getState() == Hypothesis::Expired ||
507 m_accepted.getState() == Hypothesis::Rejected) {
497 if (candidate >= 0) { 508 if (candidate >= 0) {
498 m_accepted = m_possible[candidate]; 509 m_accepted = m_possible[candidate];
499 } else { 510 } else {
500 m_accepted = Hypothesis(); 511 m_accepted = Hypothesis();
501 } 512 }
502 } 513 }
514
515 std::cerr << "accepted length = " << m_accepted.getPendingLength()
516 << ", state = " << m_accepted.getState()
517 << ", hypothesis count = " << m_possible.size() << std::endl;
503 518
504 //!!! and also need to reap rejected/expired hypotheses from the list 519 //!!! and also need to reap rejected/expired hypotheses from the list
505 } 520 }
506 521
507 522