Mercurial > hg > vamp-simple-cepstrum
diff SimpleCepstrum.cpp @ 8:10dfd77951bf track
Experimental tracker (on branch)
author | Chris Cannam |
---|---|
date | Mon, 25 Jun 2012 15:28:51 +0100 |
parents | 47355877a58d |
children | 960868d5f841 |
line wrap: on
line diff
--- a/SimpleCepstrum.cpp Mon Jun 25 14:32:05 2012 +0100 +++ b/SimpleCepstrum.cpp Mon Jun 25 15:28:51 2012 +0100 @@ -179,17 +179,6 @@ d.valueNames.push_back("Forward difference"); list.push_back(d); - d.identifier = "clamp"; - d.name = "Clamp negative values in cepstrum at zero"; - d.unit = ""; - d.minValue = 0; - d.maxValue = 1; - d.defaultValue = 0; - d.isQuantized = true; - d.quantizeStep = 1; - d.valueNames.clear(); - list.push_back(d); - return list; } @@ -199,7 +188,6 @@ if (identifier == "fmin") return m_fmin; else if (identifier == "fmax") return m_fmax; else if (identifier == "histlen") return m_histlen; - else if (identifier == "clamp") return (m_clamp ? 1 : 0); else if (identifier == "method") return (int)m_method; else return 0.f; } @@ -210,7 +198,6 @@ if (identifier == "fmin") m_fmin = value; else if (identifier == "fmax") m_fmax = value; else if (identifier == "histlen") m_histlen = value; - else if (identifier == "clamp") m_clamp = (value > 0.5); else if (identifier == "method") m_method = Method(int(value + 0.5)); } @@ -265,7 +252,7 @@ outputs.push_back(d); d.identifier = "peak"; - d.name = "Peak value"; + d.name = "Value at peak"; d.unit = ""; d.description = "Return the value found in the maximum-valued bin within the specified range of the cepstrum"; m_pvOutput = n++; @@ -450,8 +437,10 @@ double mean = total / n; double totsqr = 0; + double abstot = 0; for (int i = 0; i < n; ++i) { totsqr += data[i] * data[i]; + abstot += fabs(data[i]); } double rms = sqrt(totsqr / n); @@ -477,7 +466,7 @@ ++i; } } - peakProportion = aroundPeak / sqrt(totsqr); + peakProportion = aroundPeak / abstot; Feature pp; pp.values.push_back(peakProportion); fs[m_ppOutput].push_back(pp);