spectrogram: Use log2f to avoid double conversions

This commit is contained in:
Mike Walters
2016-06-04 12:48:55 +01:00
parent 083c8ad486
commit 1e9c96b9b9

View File

@@ -150,7 +150,7 @@ void SpectrogramPlot::getLine(float *dest, off_t sample)
float re = buffer[k].real();
float im = buffer[k].imag();
float mag = sqrt(re * re + im * im) / fftSize;
float magdb = 10 * log2(mag) / log2(10);
float magdb = 10 * log2f(mag) / log2f(10);
*dest = magdb;
dest++;
}