1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-26 15:23:48 +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:
Raphaël Marinier
2016-06-25 16:23:56 +02:00
parent cf79f91da0
commit 6ac68db5be
10 changed files with 8 additions and 210 deletions

View File

@@ -348,7 +348,6 @@ SpectrogramSettings::~SpectrogramSettings()
void SpectrogramSettings::DestroyWindows()
{
#ifdef EXPERIMENTAL_USE_REALFFTF
if (hFFT != NULL) {
EndFFT(hFFT);
hFFT = NULL;
@@ -365,7 +364,6 @@ void SpectrogramSettings::DestroyWindows()
delete[] tWindow;
tWindow = NULL;
}
#endif
}
@@ -428,7 +426,6 @@ namespace
void SpectrogramSettings::CacheWindows() const
{
#ifdef EXPERIMENTAL_USE_REALFFTF
if (hFFT == NULL || window == NULL) {
double scale;
@@ -444,7 +441,6 @@ void SpectrogramSettings::CacheWindows() const
RecreateWindow(dWindow, DWINDOW, fftLen, padding, windowType, windowSize, scale);
}
}
#endif // EXPERIMENTAL_USE_REALFFTF
}
void SpectrogramSettings::ConvertToEnumeratedWindowSizes()

View File

@@ -137,7 +137,6 @@ public:
// Following fields are derived from preferences.
#ifdef EXPERIMENTAL_USE_REALFFTF
// Variables used for computing the spectrum
mutable FFTParam *hFFT{};
mutable float *window{};
@@ -145,7 +144,5 @@ public:
// Two other windows for computing reassigned spectrogram
mutable float *tWindow{}; // Window times time parameter
mutable float *dWindow{}; // Derivative of window
#endif
};
#endif