Mercurial > hg > vamp-simple-cepstrum
changeset 27:44bb93cae288
Change peak-to-next-peak ratio to a difference (because difference of peaks in log values don't vary with signal amplification)
author | Chris Cannam |
---|---|
date | Sat, 07 Jul 2012 21:06:37 +0100 |
parents | a15d8c89a36e |
children | 1c1e95004794 |
files | CepstrumPitchTracker.cpp SimpleCepstrum.cpp |
diffstat | 2 files changed, 4 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/CepstrumPitchTracker.cpp Thu Jul 05 21:54:50 2012 +0100 +++ b/CepstrumPitchTracker.cpp Sat Jul 07 21:06:37 2012 +0100 @@ -530,12 +530,6 @@ filter(rawcep, data); delete[] rawcep; - double abstot = 0.0; - - for (int i = 0; i < n; ++i) { - abstot += fabs(data[i]); - } - double maxval = 0.0; int maxbin = -1; @@ -566,7 +560,7 @@ double confidence = 0.0; if (nextPeakVal != 0.0) { - confidence = ((maxval / nextPeakVal) - 1.0) / 4.0; + confidence = (maxval - nextPeakVal) / 200.0; if (confidence > 1.0) confidence = 1.0; }
--- a/SimpleCepstrum.cpp Thu Jul 05 21:54:50 2012 +0100 +++ b/SimpleCepstrum.cpp Sat Jul 07 21:06:37 2012 +0100 @@ -306,9 +306,9 @@ outputs.push_back(d); d.identifier = "peak_to_second_peak"; - d.name = "Peak to second-peak ratio"; + d.name = "Peak to second-peak difference"; d.unit = ""; - d.description = "Return the ratio of the value found in the peak bin within the specified range of the cepstrum, to the value found in the next highest peak"; + d.description = "Return the difference between the value found in the peak bin within the specified range of the cepstrum, and that found in the next highest peak"; m_pkoOutput = n++; outputs.push_back(d); @@ -616,7 +616,7 @@ Feature pko; if (nextPeakVal != 0.0) { - pko.values.push_back(maxval / nextPeakVal); + pko.values.push_back(maxval - nextPeakVal); } else { pko.values.push_back(0.0); }