Mercurial > hg > cepstral-pitchtracker
changeset 22:0a0e449a6069
More tweaking with thresholds and confidences -- but I feel like this is going in the wrong direction
| author | Chris Cannam |
|---|---|
| date | Mon, 09 Jul 2012 22:31:43 +0100 |
| parents | bb534ad603b6 |
| children | 0e67ed2777e9 |
| files | CepstrumPitchTracker.cpp |
| diffstat | 1 files changed, 9 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/CepstrumPitchTracker.cpp Sun Jul 08 10:39:14 2012 +0100 +++ b/CepstrumPitchTracker.cpp Mon Jul 09 22:31:43 2012 +0100 @@ -525,6 +525,8 @@ delete[] logmag; delete[] io; + double cep1 = rawcep[1]; + int n = m_bins; double *data = new double[n]; filter(rawcep, data); @@ -560,8 +562,13 @@ double confidence = 0.0; if (nextPeakVal != 0.0) { - confidence = (maxval - nextPeakVal) / 200.0; - if (confidence > 1.0) confidence = 1.0; + std::cerr << "maxval = " << maxval << ", cep1 = " << cep1 << std::endl; + double conf0 = (maxval - nextPeakVal) / 80.0; + double conf1 = (cep1 / bs) / 2; + if (conf0 > 1.0) conf0 = 1.0; + if (conf1 > 1.0) conf1 = 1.0; + confidence = conf0 * conf1; + std::cerr << "conf0 = " << conf0 << ", conf1 = " << conf1 << ", confidence = " << confidence << std::endl; } Hypothesis::Estimate e;