changeset 20:f9c4c4568fb0

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 131b1c40be1a
children bb534ad603b6
files CepstrumPitchTracker.cpp
diffstat 1 files changed, 1 insertions(+), 7 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;
     }