mirror of
https://github.com/miek/inspectrum.git
synced 2026-03-03 06:54:17 +01:00
spectrogram: Use log2f to avoid double conversions
This commit is contained in:
@@ -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++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user