19 size_t windowSize,
unsigned stepsPerWindow,
20 bool leadingPadding,
bool trailingPadding )
21: mWindowSize{ windowSize }
22, mSpectrumSize{ 1 + mWindowSize / 2 }
23, mStepsPerWindow{ stepsPerWindow }
24, mStepSize{ mWindowSize / mStepsPerWindow }
25, mLeadingPadding{ leadingPadding }
26, mTrailingPadding{ trailingPadding }
27, hFFT{
GetFFT(mWindowSize) }
28, mFFTBuffer( mWindowSize )
29, mInWaveBuffer( mWindowSize )
30, mOutOverlapBuffer( mWindowSize )
31, mNeedsOutput{ needsOutput }
87 -> std::unique_ptr<Window>
89 return std::make_unique<Window>(windowSize);
106 for (
auto &pWindow :
mQueue)
147 const float *buffer,
size_t len )
152 while (success && len &&
168 if ( (success = processor(*
this)), success )
186 int oldLen =
mQueue.size();
187 mQueue.resize(queueLength);
188 for (
size_t ii = oldLen; ii < queueLength; ++ii)
202 *pFFTBuffer++ = *pInWaveBuffer++ * *pInWindow++;
205 memmove(pFFTBuffer, pInWaveBuffer,
mWindowSize *
sizeof(
float));
209 auto &record =
Nth(0);
213 float *pReal = &record.mRealFFTs[1];
214 float *pImag = &record.mImagFFTs[1];
215 int *pBitReversed = &
hFFT->BitReversed[1];
217 for (
size_t ii = 1; ii < last; ++ii) {
218 const int kk = *pBitReversed++;
224 record.mRealFFTs[0] = dc;
227 record.mImagFFTs[0] = nyquist;
238 bool bLoopSuccess =
true;
246 while (bLoopSuccess &&
260 auto allocSize =
mQueue.size();
265 if (
size < allocSize)
266 return size.as_size_t();
280 const float *pReal = &record.
mRealFFTs[1];
281 const float *pImag = &record.
mImagFFTs[1];
285 *pBuffer++ = *pReal++;
286 *pBuffer++ = *pImag++;
299 auto pBitReversed = &
hFFT->BitReversed[0];
300 for (
size_t jj = 0; jj < last; ++jj) {
301 auto kk = *pBitReversed++;
308 auto pBitReversed = &
hFFT->BitReversed[0];
309 for (
size_t jj = 0; jj < last; ++jj) {
310 auto kk = *pBitReversed++;
void NewWindowFunc(int whichFunction, size_t NumSamplesIn, bool extraSample, float *in)
void RealFFTf(fft_type *buffer, const FFTParam *h)
void InverseRealFFTf(fft_type *buffer, const FFTParam *h)
HFFT GetFFT(size_t fftlen)
void rotate(const float *oldPhase, const float *newPhase, std::complex< float > *dst, int32_t n)