# HG changeset patch # User Chris Cannam # Date 1341138817 -3600 # Node ID c9cac05ef9f26a930b89e33cf77942b3fff934cc # Parent 791e5c115b8dfb7b7d3b0eb7ec3bd80f8ad2d517 Reap expired/rejected hypotheses from list; report an estimate as accepted only if the accepting hypothesis has been satisfied already (otherwise a different provisional hypothesis might become satisfied first) diff -r 791e5c115b8d -r c9cac05ef9f2 CepstrumPitchTracker.cpp --- a/CepstrumPitchTracker.cpp Sat Jun 30 10:12:08 2012 +0100 +++ b/CepstrumPitchTracker.cpp Sun Jul 01 11:33:37 2012 +0100 @@ -51,7 +51,7 @@ Estimate last = m_pending[m_pending.size()-1]; double r = s.freq / last.freq; int cents = lrint(1200.0 * (log(r) / log(2.0))); - return (cents > -200 && cents < 200); + return (cents > -100 && cents < 100); } bool @@ -109,7 +109,7 @@ } } - return accept; + return accept && (m_state == Satisfied); } CepstrumPitchTracker::Hypothesis::State @@ -522,12 +522,22 @@ } } + // reap rejected/expired hypotheses from possible list + Hypotheses toReap = m_possible; + m_possible.clear(); + for (int i = 0; i < toReap.size(); ++i) { + Hypothesis h = toReap[i]; + if (h.getState() != Hypothesis::Rejected && + h.getState() != Hypothesis::Expired) { + m_possible.push_back(h); + } + } + } + std::cerr << "accepted length = " << m_accepted.getPendingLength() << ", state = " << m_accepted.getState() << ", hypothesis count = " << m_possible.size() << std::endl; - //!!! and also need to reap rejected/expired hypotheses from the list - } /*