mirror of
https://github.com/cookiengineer/audacity
synced 2026-02-05 19:21:59 +01:00
Code cleanup: removed the old real FFT code not used since at least 2009.
I confirmed that the currently used real FFT code in RealFFTf.cpp is faster than the old one with a quick benchmark that calls PowerSpectrum() on 4-minute audio file, with different sizes of computation windows: Window_size: 256 method: new FFT time_s: 0.393 Window_size: 256 method: old FFT time_s: 1.065 Window_size: 1024 method: new FFT time_s: 0.38 Window_size: 1024 method: old FFT time_s: 0.958 Window_size: 4096 method: new FFT time_s: 0.413 Window_size: 4096 method: old FFT time_s: 1.084 Window_size: 16384 method: new FFT time_s: 0.518 Window_size: 16384 method: old FFT time_s: 1.338 Window_size: 65536 method: new FFT time_s: 0.655 Window_size: 65536 method: old FFT time_s: 1.524 Window_size: 262144 method: new FFT time_s: 0.735 Window_size: 262144 method: old FFT time_s: 1.873
This commit is contained in:
@@ -52,11 +52,7 @@ bool ComputeSpectrum(const float * data, int width,
|
||||
|
||||
if (autocorrelation) {
|
||||
// Take FFT
|
||||
#ifdef EXPERIMENTAL_USE_REALFFTF
|
||||
RealFFT(windowSize, in, out, out2);
|
||||
#else
|
||||
FFT(windowSize, false, in, NULL, out, out2);
|
||||
#endif
|
||||
// Compute power
|
||||
for (i = 0; i < windowSize; i++)
|
||||
in[i] = (out[i] * out[i]) + (out2[i] * out2[i]);
|
||||
@@ -68,12 +64,7 @@ bool ComputeSpectrum(const float * data, int width,
|
||||
in[i] = powf(in[i], 1.0f / 3.0f);
|
||||
|
||||
// Take FFT
|
||||
#ifdef EXPERIMENTAL_USE_REALFFTF
|
||||
RealFFT(windowSize, in, out, out2);
|
||||
#else
|
||||
FFT(windowSize, false, in, NULL, out, out2);
|
||||
#endif
|
||||
|
||||
}
|
||||
else
|
||||
PowerSpectrum(windowSize, in, out);
|
||||
|
||||
Reference in New Issue
Block a user