1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-23 07:58:05 +02:00

Define and use SpectrogramSettings::GetFFTLength()

This commit is contained in:
Paul Licameli 2015-06-20 12:39:14 -04:00
parent 778e7726df
commit a1621f7d1b
3 changed files with 12 additions and 1 deletions

View File

@ -2104,7 +2104,7 @@ void TrackArtist::DrawClipSpectrum(WaveTrackCache &waveTrackCache,
return;
unsigned char *data = image->GetData();
const int half = GetSpectrumWindowSize(!autocorrelation) / 2;
const int half = settings.GetFFTLength(autocorrelation) / 2;
const double binUnit = rate / (2 * half);
const float *freq = 0;
const sampleCount *where = 0;

View File

@ -253,3 +253,12 @@ void SpectrogramSettings::CacheWindows() const
}
#endif // EXPERIMENTAL_USE_REALFFTF
}
int SpectrogramSettings::GetFFTLength(bool autocorrelation) const
{
return windowSize
#ifdef EXPERIMENTAL_ZERO_PADDED_SPECTROGRAMS
* (!autocorrelation ? zeroPaddingFactor : 1);
#endif
;
}

View File

@ -44,6 +44,8 @@ public:
int zeroPaddingFactor;
#endif
int GetFFTLength(bool autocorrelation) const; // window size (times zero padding, if STFT)
bool isGrayscale;
#ifdef EXPERIMENTAL_FFT_Y_GRID