Fix wrong accumulator type - this fix makes the detector a little more sensitive, which is not necessarily good, but the previous accidental behaviour exaggerated the difference in results between float and double precision ffts
This commit is contained in:
@@ -58,14 +58,14 @@ HighFrequencyAudioCurve::processFloat(const float *R__ mag, int)
|
|||||||
double
|
double
|
||||||
HighFrequencyAudioCurve::processDouble(const double *R__ mag, int)
|
HighFrequencyAudioCurve::processDouble(const double *R__ mag, int)
|
||||||
{
|
{
|
||||||
float result = 0.0;
|
double result = 0.0;
|
||||||
|
|
||||||
const int sz = m_lastPerceivedBin;
|
const int sz = m_lastPerceivedBin;
|
||||||
|
|
||||||
for (int n = 0; n <= sz; ++n) {
|
for (int n = 0; n <= sz; ++n) {
|
||||||
result = result + mag[n] * n;
|
result = result + mag[n] * n;
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user