12#ifndef __AUDACITY_SPECTRUM_TRANSFORMER__
13#define __AUDACITY_SPECTRUM_TRANSFORMER__
55 unsigned stepsPerWindow,
69 bool Start(
size_t queueLength);
75 bool ProcessSamples(
const WindowProcessor &processor,
76 const float *buffer,
size_t len);
81 bool Finish(
const WindowProcessor &processor);
87 : mRealFFTs( windowSize / 2 )
88 , mImagFFTs( windowSize / 2 )
96 const auto size = mRealFFTs.size();
97 auto pFill = mRealFFTs.data();
98 std::fill(pFill, pFill +
size, 0.0f);
99 pFill = mImagFFTs.data();
100 std::fill(pFill, pFill +
size, 0.0f);
112 virtual std::unique_ptr<Window> NewWindow(
size_t windowSize);
117 virtual bool DoStart();
120 virtual void DoOutput(
const float *outBuffer,
size_t mStepSize) = 0;
124 virtual bool DoFinish();
133 size_t CurrentQueueSize()
const;
137 bool QueueIsFull()
const;
147 void ResizeQueue(
size_t queueLength);
148 void FillFirstWindow();
149 void RotateWindows();
164 std::vector<std::unique_ptr<Window>>
mQueue;
168 size_t mInWavePos = 0;
std::unique_ptr< FFTParam, FFTDeleter > HFFT
Positions or offsets within audio files need a wide type.