Audacity 3.2.0
Classes | Public Types | Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
SpectrumTransformer Class Referenceabstract

A class that transforms a portion of a wave track (preserving duration) by applying Fourier transform, then modifying coefficients, then inverse Fourier transform and overlap-add to reconstruct. More...

#include <SpectrumTransformer.h>

Inheritance diagram for SpectrumTransformer:
[legend]
Collaboration diagram for SpectrumTransformer:
[legend]

Classes

struct  Window
 Derive this class to add information to the queue. More...
 

Public Types

using FloatVector = std::vector< float >
 
using WindowProcessor = std::function< bool(SpectrumTransformer &) >
 Type of function that transforms windows in the queue. More...
 

Public Member Functions

 SpectrumTransformer (bool needsOutput, eWindowFunctions inWindowType, eWindowFunctions outWindowType, size_t windowSize, unsigned stepsPerWindow, bool leadingPadding, bool trailingPadding)
 
virtual ~SpectrumTransformer ()
 
bool NeedsOutput () const
 
bool Start (size_t queueLength)
 Call once before a sequence of calls to ProcessSamples; Invokes DoStart. More...
 
bool ProcessSamples (const WindowProcessor &processor, const float *buffer, size_t len)
 Call multiple times. More...
 
bool Finish (const WindowProcessor &processor)
 
virtual std::unique_ptr< WindowNewWindow (size_t windowSize)
 Allocates a window to place in the queue. More...
 
virtual bool DoStart ()
 Called before any calls to ProcessWindow. More...
 
virtual void DoOutput (const float *outBuffer, size_t mStepSize)=0
 Called within ProcessSamples if output was requested. More...
 
virtual bool DoFinish ()
 Called after the last call to ProcessWindow(). More...
 
size_t TotalQueueSize () const
 Useful functions to implement WindowProcesser: More...
 
size_t CurrentQueueSize () const
 How many windows in the queue have been filled? More...
 
bool QueueIsFull () const
 
WindowNth (int n)
 Access the queue, so you can inspect and modify any window in it. More...
 
WindowNewest ()
 
WindowLatest ()
 

Protected Attributes

const size_t mWindowSize
 
const size_t mSpectrumSize
 
const unsigned mStepsPerWindow
 
const size_t mStepSize
 
const bool mLeadingPadding
 
const bool mTrailingPadding
 

Private Member Functions

void ResizeQueue (size_t queueLength)
 
void FillFirstWindow ()
 
void RotateWindows ()
 
void OutputStep ()
 

Private Attributes

std::vector< std::unique_ptr< Window > > mQueue
 
HFFT hFFT
 
sampleCount mInSampleCount = 0
 
sampleCount mOutStepCount = 0
 sometimes negative More...
 
size_t mInWavePos = 0
 
FloatVector mFFTBuffer
 These have size mWindowSize: More...
 
FloatVector mInWaveBuffer
 
FloatVector mOutOverlapBuffer
 
FloatVector mInWindow
 These have size mWindowSize, or 0 for rectangular window: More...
 
FloatVector mOutWindow
 
const bool mNeedsOutput
 

Detailed Description

A class that transforms a portion of a wave track (preserving duration) by applying Fourier transform, then modifying coefficients, then inverse Fourier transform and overlap-add to reconstruct.

The procedure that modifies coefficients can be varied, and can employ lookahead
and -behind to nearby windows. May also be used just to gather information without producing output.

Definition at line 33 of file SpectrumTransformer.h.

Member Typedef Documentation

◆ FloatVector

using SpectrumTransformer::FloatVector = std::vector<float>

Definition at line 37 of file SpectrumTransformer.h.

◆ WindowProcessor

Type of function that transforms windows in the queue.

Called repeatedly, with the newest window in the queue taken from input, and the last window of the queue about to be inverse-transformed for output.

Returns
false to abort processing.

Definition at line 43 of file SpectrumTransformer.h.

Constructor & Destructor Documentation

◆ SpectrumTransformer()

SpectrumTransformer::SpectrumTransformer ( bool  needsOutput,
eWindowFunctions  inWindowType,
eWindowFunctions  outWindowType,
size_t  windowSize,
unsigned  stepsPerWindow,
bool  leadingPadding,
bool  trailingPadding 
)
Precondition
!(inWindowType == eWinFuncRectangular && outWindowType eWinFuncRectangular)
windowSize % stepsPerWindow == 0
windowSize is a power of 2
Parameters
needsOutputWhether to do the inverse FFT
inWindowTypeUsed in FFT transform
outWindowTypeUsed in inverse FFT transform
windowSizemust be a power of 2
stepsPerWindowdetermines the overlap
leadingPaddingWhether to start the queue with windows that partially overlap the first full window of input samples
trailingPaddingWhether to stop the procedure after the last complete window of input is added to the queue

Definition at line 16 of file SpectrumTransformer.cpp.

21: mWindowSize{ windowSize }
22, mSpectrumSize{ 1 + mWindowSize / 2 }
23, mStepsPerWindow{ stepsPerWindow }
25, mLeadingPadding{ leadingPadding }
26, mTrailingPadding{ trailingPadding }
31, mNeedsOutput{ needsOutput }
32{
33 // Check preconditions
34
35 // Powers of 2 only!
36 wxASSERT(mWindowSize > 0 &&
37 0 == (mWindowSize & (mWindowSize - 1)));
38
39 wxASSERT(mWindowSize % mStepsPerWindow == 0);
40
41 wxASSERT(!(inWindowType == eWinFuncRectangular && outWindowType == eWinFuncRectangular));
42
43 // To do: check that inWindowType, outWindowType, and mStepsPerWindow
44 // are compatible for correct overlap-add reconstruction.
45
46 // Create windows as needed
47 if (inWindowType != eWinFuncRectangular) {
48 mInWindow.resize(mWindowSize);
49 std::fill(mInWindow.begin(), mInWindow.end(), 1.0f);
50 NewWindowFunc(inWindowType, mWindowSize, false, mInWindow.data());
51 }
52 if (outWindowType != eWinFuncRectangular) {
53 mOutWindow.resize(mWindowSize);
54 std::fill(mOutWindow.begin(), mOutWindow.end(), 1.0f);
55 NewWindowFunc(outWindowType, mWindowSize, false, mOutWindow.data());
56 }
57
58 // Must scale one or the other window so overlap-add
59 // comes out right
60 double denom = 0;
61 for (size_t ii = 0; ii < mWindowSize; ii += mStepSize) {
62 denom +=
63 (mInWindow.empty() ? 1.0 : mInWindow[ii])
64 *
65 (mOutWindow.empty() ? 1.0 : mOutWindow[ii]);
66 }
67 // It is ASSUMED that you have chosen window types and
68 // steps per window, so that this sum denom would be the
69 // same, starting the march anywhere from 0 to mStepSize - 1.
70 // Else, your overlap-add won't be right, and the transformer
71 // might not be an identity even when you do nothing to the
72 // spectra.
73
74 float *pWindow = 0;
75 if (!mInWindow.empty())
76 pWindow = mInWindow.data();
77 else if (!mOutWindow.empty())
78 pWindow = mOutWindow.data();
79 else
80 // Can only happen if both window types were rectangular
81 wxASSERT(false);
82 for (size_t ii = 0; ii < mWindowSize; ++ii)
83 *pWindow++ /= denom;
84}
void NewWindowFunc(int whichFunction, size_t NumSamplesIn, bool extraSample, float *in)
Definition: FFT.cpp:368
@ eWinFuncRectangular
Definition: FFT.h:111
HFFT GetFFT(size_t fftlen)
Definition: RealFFTf.cpp:104
FloatVector mFFTBuffer
These have size mWindowSize:
const unsigned mStepsPerWindow
FloatVector mInWindow
These have size mWindowSize, or 0 for rectangular window:

References eWinFuncRectangular, mInWindow, mOutWindow, mStepSize, mStepsPerWindow, mWindowSize, and NewWindowFunc().

Here is the call graph for this function:

◆ ~SpectrumTransformer()

SpectrumTransformer::~SpectrumTransformer ( )
virtualdefault

Member Function Documentation

◆ CurrentQueueSize()

size_t SpectrumTransformer::CurrentQueueSize ( ) const

How many windows in the queue have been filled?

(Not always the allocated size of the queue)

Definition at line 258 of file SpectrumTransformer.cpp.

259{
260 auto allocSize = mQueue.size();
261 auto size = mOutStepCount + allocSize;
262 if (mLeadingPadding)
263 size += mStepsPerWindow - 1;
264
265 if (size < allocSize)
266 return size.as_size_t();
267 else
268 return allocSize;
269}
sampleCount mOutStepCount
sometimes negative
std::vector< std::unique_ptr< Window > > mQueue

References mLeadingPadding, mOutStepCount, mQueue, mStepsPerWindow, and size.

Referenced by NoiseReductionBase::Worker::ReduceNoise().

Here is the caller graph for this function:

◆ DoFinish()

bool SpectrumTransformer::DoFinish ( )
virtual

Called after the last call to ProcessWindow().

Returns
false to abort processing. Default implementation just returns true.

Reimplemented in MyTransformer, TrackSpectrumTransformer, and SpectralDataManager::Worker.

Definition at line 97 of file SpectrumTransformer.cpp.

98{
99 return true;
100}

Referenced by TrackSpectrumTransformer::DoFinish(), and Finish().

Here is the caller graph for this function:

◆ DoOutput()

virtual void SpectrumTransformer::DoOutput ( const float *  outBuffer,
size_t  mStepSize 
)
pure virtual

Called within ProcessSamples if output was requested.

Implemented in TrackSpectrumTransformer.

Referenced by OutputStep().

Here is the caller graph for this function:

◆ DoStart()

bool SpectrumTransformer::DoStart ( )
virtual

Called before any calls to ProcessWindow.

More queue initializations can be done here.

Returns
false to abort processing. Default implementation just returns true.

Reimplemented in MyTransformer, TrackSpectrumTransformer, and SpectralDataManager::Worker.

Definition at line 92 of file SpectrumTransformer.cpp.

93{
94 return true;
95}

Referenced by TrackSpectrumTransformer::DoStart(), and Start().

Here is the caller graph for this function:

◆ FillFirstWindow()

void SpectrumTransformer::FillFirstWindow ( )
private

Definition at line 194 of file SpectrumTransformer.cpp.

195{
196 // Transform samples to frequency domain, windowed as needed
197 {
198 auto pFFTBuffer = mFFTBuffer.data(), pInWaveBuffer = mInWaveBuffer.data();
199 if (mInWindow.size() > 0) {
200 auto pInWindow = mInWindow.data();
201 for (size_t ii = 0; ii < mWindowSize; ++ii)
202 *pFFTBuffer++ = *pInWaveBuffer++ * *pInWindow++;
203 }
204 else
205 memmove(pFFTBuffer, pInWaveBuffer, mWindowSize * sizeof(float));
206 }
207 RealFFTf(mFFTBuffer.data(), hFFT.get());
208
209 auto &record = Nth(0);
210
211 // Store real and imaginary parts for later inverse FFT
212 {
213 float *pReal = &record.mRealFFTs[1];
214 float *pImag = &record.mImagFFTs[1];
215 int *pBitReversed = &hFFT->BitReversed[1];
216 const auto last = mSpectrumSize - 1;
217 for (size_t ii = 1; ii < last; ++ii) {
218 const int kk = *pBitReversed++;
219 *pReal++ = mFFTBuffer[kk];
220 *pImag++ = mFFTBuffer[kk + 1];
221 }
222 // DC and Fs/2 bins need to be handled specially
223 const float dc = mFFTBuffer[0];
224 record.mRealFFTs[0] = dc;
225
226 const float nyquist = mFFTBuffer[1];
227 record.mImagFFTs[0] = nyquist; // For Fs/2, not really imaginary
228 }
229}
void RealFFTf(fft_type *buffer, const FFTParam *h)
Definition: RealFFTf.cpp:161
Window & Nth(int n)
Access the queue, so you can inspect and modify any window in it.

References hFFT, mFFTBuffer, mInWaveBuffer, mInWindow, mSpectrumSize, mWindowSize, Nth(), and RealFFTf().

Referenced by ProcessSamples().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Finish()

bool SpectrumTransformer::Finish ( const WindowProcessor processor)

Call once after a sequence of calls to ProcessSamples; flushes the queue and Invokes DoFinish

Returns
success

Definition at line 236 of file SpectrumTransformer.cpp.

237{
238 bool bLoopSuccess = true;
239 if (mTrailingPadding) {
240 // Keep flushing empty input buffers through the history
241 // windows until we've output exactly as many samples as
242 // were input.
243 // Well, not exactly, but not more than one step-size of extra samples
244 // at the end.
245
246 while (bLoopSuccess &&
247 mOutStepCount * static_cast<int>(mStepSize) < mInSampleCount)
248 bLoopSuccess = ProcessSamples(processor, nullptr, mStepSize);
249 }
250
251 if (bLoopSuccess)
252 // invoke derived method
253 bLoopSuccess = DoFinish();
254
255 return bLoopSuccess;
256}
bool ProcessSamples(const WindowProcessor &processor, const float *buffer, size_t len)
Call multiple times.
virtual bool DoFinish()
Called after the last call to ProcessWindow().

References DoFinish(), mInSampleCount, mOutStepCount, mStepSize, mTrailingPadding, and ProcessSamples().

Referenced by TrackSpectrumTransformer::Process().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Latest()

Window & SpectrumTransformer::Latest ( )
inline

Definition at line 144 of file SpectrumTransformer.h.

144{ return **mQueue.rbegin(); }

◆ NeedsOutput()

bool SpectrumTransformer::NeedsOutput ( ) const
inline

Definition at line 65 of file SpectrumTransformer.h.

65{ return mNeedsOutput; }

◆ Newest()

Window & SpectrumTransformer::Newest ( )
inline

Definition at line 143 of file SpectrumTransformer.h.

143{ return **mQueue.begin(); }

◆ NewWindow()

auto SpectrumTransformer::NewWindow ( size_t  windowSize)
virtual

Allocates a window to place in the queue.

Only when initializing – windows are recycled thereafter. You can derive from Window to add fields, and then override this factory function.

Reimplemented in MyTransformer, and SpectralDataManager::Worker.

Definition at line 86 of file SpectrumTransformer.cpp.

88{
89 return std::make_unique<Window>(windowSize);
90}

Referenced by ResizeQueue().

Here is the caller graph for this function:

◆ Nth()

Window & SpectrumTransformer::Nth ( int  n)
inline

Access the queue, so you can inspect and modify any window in it.

Newer windows are at earlier indices. You can't modify the length of it

Definition at line 141 of file SpectrumTransformer.h.

141{ return *mQueue[n]; }

Referenced by FillFirstWindow(), and SpectralDataManager::Worker::NthWindow().

Here is the caller graph for this function:

◆ OutputStep()

void SpectrumTransformer::OutputStep ( )
private

Definition at line 272 of file SpectrumTransformer.cpp.

273{
274 if (!mNeedsOutput)
275 return;
276 if (QueueIsFull()) {
277 const auto last = mSpectrumSize - 1;
278 Window &record = **mQueue.rbegin();
279
280 const float *pReal = &record.mRealFFTs[1];
281 const float *pImag = &record.mImagFFTs[1];
282 float *pBuffer = &mFFTBuffer[2];
283 auto nn = mSpectrumSize - 2;
284 for (; nn--;) {
285 *pBuffer++ = *pReal++;
286 *pBuffer++ = *pImag++;
287 }
288 mFFTBuffer[0] = record.mRealFFTs[0];
289 // The Fs/2 component is stored as the imaginary part of the DC component
290 mFFTBuffer[1] = record.mImagFFTs[0];
291
292 // Invert the FFT into the output buffer
293 InverseRealFFTf(mFFTBuffer.data(), hFFT.get());
294
295 // Overlap-add
296 if (mOutWindow.size() > 0) {
297 auto pOut = mOutOverlapBuffer.data();
298 auto pWindow = mOutWindow.data();
299 auto pBitReversed = &hFFT->BitReversed[0];
300 for (size_t jj = 0; jj < last; ++jj) {
301 auto kk = *pBitReversed++;
302 *pOut++ += mFFTBuffer[kk] * (*pWindow++);
303 *pOut++ += mFFTBuffer[kk + 1] * (*pWindow++);
304 }
305 }
306 else {
307 auto pOut = mOutOverlapBuffer.data();
308 auto pBitReversed = &hFFT->BitReversed[0];
309 for (size_t jj = 0; jj < last; ++jj) {
310 auto kk = *pBitReversed++;
311 *pOut++ += mFFTBuffer[kk];
312 *pOut++ += mFFTBuffer[kk + 1];
313 }
314 }
315 auto buffer = mOutOverlapBuffer.data();
316 if (mOutStepCount >= 0) {
317 // Output the first portion of the overlap buffer, they're done
318 DoOutput(buffer, mStepSize);
319 }
320 // Shift the remainder over.
321 memmove(buffer, buffer + mStepSize, sizeof(float)*(mWindowSize - mStepSize));
322 std::fill(buffer + mWindowSize - mStepSize, buffer + mWindowSize, 0.0f);
323 }
324}
void InverseRealFFTf(fft_type *buffer, const FFTParam *h)
Definition: RealFFTf.cpp:263
virtual void DoOutput(const float *outBuffer, size_t mStepSize)=0
Called within ProcessSamples if output was requested.

References DoOutput(), hFFT, InverseRealFFTf(), mFFTBuffer, SpectrumTransformer::Window::mImagFFTs, mNeedsOutput, mOutOverlapBuffer, mOutStepCount, mOutWindow, mQueue, SpectrumTransformer::Window::mRealFFTs, mSpectrumSize, mStepSize, mWindowSize, and QueueIsFull().

Referenced by ProcessSamples().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ProcessSamples()

bool SpectrumTransformer::ProcessSamples ( const WindowProcessor processor,
const float *  buffer,
size_t  len 
)

Call multiple times.

Parameters
buffernull if flushing the end
Returns
success

Definition at line 146 of file SpectrumTransformer.cpp.

148{
149 if (buffer)
150 mInSampleCount += len;
151 bool success = true;
152 while (success && len &&
153 mOutStepCount * static_cast<int>(mStepSize) < mInSampleCount) {
154 auto avail = std::min(len, mWindowSize - mInWavePos);
155 if (buffer)
156 memmove(&mInWaveBuffer[mInWavePos], buffer, avail * sizeof(float));
157 else
158 memset(&mInWaveBuffer[mInWavePos], 0, avail * sizeof(float));
159 if (buffer)
160 buffer += avail;
161 len -= avail;
162 mInWavePos += avail;
163
164 if (mInWavePos == mWindowSize) {
166
167 // invoke derived method
168 if ( (success = processor(*this)), success )
169 OutputStep();
170
173
174 // Shift input.
175 memmove(mInWaveBuffer.data(), &mInWaveBuffer[mStepSize],
176 (mWindowSize - mStepSize) * sizeof(float));
178 }
179 }
180
181 return success;
182}
int min(int a, int b)

References FillFirstWindow(), min(), mInSampleCount, mInWaveBuffer, mInWavePos, mOutStepCount, mStepSize, mWindowSize, OutputStep(), and RotateWindows().

Referenced by Finish(), and TrackSpectrumTransformer::Process().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ QueueIsFull()

bool SpectrumTransformer::QueueIsFull ( ) const

Whether the last window in the queue overlapped the input at least partially and its coefficients will affect output.

Definition at line 326 of file SpectrumTransformer.cpp.

327{
328 if (mLeadingPadding)
329 return (mOutStepCount >= -static_cast<int>(mStepsPerWindow - 1));
330 else
331 return (mOutStepCount >= 0);
332}

References mLeadingPadding, mOutStepCount, and mStepsPerWindow.

Referenced by OutputStep(), and NoiseReductionBase::Worker::ReduceNoise().

Here is the caller graph for this function:

◆ ResizeQueue()

void SpectrumTransformer::ResizeQueue ( size_t  queueLength)
private

Definition at line 184 of file SpectrumTransformer.cpp.

185{
186 int oldLen = mQueue.size();
187 mQueue.resize(queueLength);
188 for (size_t ii = oldLen; ii < queueLength; ++ii)
189 // invoke derived method to get a queue element
190 // with appropriate extra fields
192}
virtual std::unique_ptr< Window > NewWindow(size_t windowSize)
Allocates a window to place in the queue.

References mQueue, mWindowSize, and NewWindow().

Referenced by Start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RotateWindows()

void SpectrumTransformer::RotateWindows ( )
private

Definition at line 231 of file SpectrumTransformer.cpp.

232{
233 std::rotate(mQueue.begin(), mQueue.end() - 1, mQueue.end());
234}
void rotate(const float *oldPhase, const float *newPhase, std::complex< float > *dst, int32_t n)
Definition: VectorOps.h:140

References mQueue, and staffpad::vo::rotate().

Referenced by ProcessSamples().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Start()

bool SpectrumTransformer::Start ( size_t  queueLength)

Call once before a sequence of calls to ProcessSamples; Invokes DoStart.

Returns
success

Definition at line 102 of file SpectrumTransformer.cpp.

103{
104 // Prepare clean queue
105 ResizeQueue(queueLength);
106 for (auto &pWindow : mQueue)
107 pWindow->Zero();
108
109 // invoke derived method
110 if (!DoStart())
111 return false;
112
113 // Clean input and output buffers
114 {
115 float *pFill;
116 pFill = mInWaveBuffer.data();
117 std::fill(pFill, pFill + mWindowSize, 0.0f);
118 pFill = mOutOverlapBuffer.data();
119 std::fill(pFill, pFill + mWindowSize, 0.0f);
120 }
121
122 if (!mLeadingPadding)
123 {
124 // We do not want leading zero padded windows
125 mInWavePos = 0;
126 mOutStepCount = -static_cast<int>(queueLength - 1);
127 }
128 else
129 {
130 // So that the queue gets primed with some windows,
131 // zero-padded in front, the first having mStepSize
132 // samples of wave data:
134 // This starts negative, to count up until the queue fills:
135 mOutStepCount = -static_cast<int>(queueLength - 1)
136 // ... and then must pass over the padded windows,
137 // before the first full window:
138 - static_cast<int>(mStepsPerWindow - 1);
139 }
140
141 mInSampleCount = 0;
142
143 return true;
144}
void ResizeQueue(size_t queueLength)
virtual bool DoStart()
Called before any calls to ProcessWindow.

References DoStart(), mInSampleCount, mInWaveBuffer, mInWavePos, mLeadingPadding, mOutOverlapBuffer, mOutStepCount, mQueue, mStepSize, mStepsPerWindow, mWindowSize, and ResizeQueue().

Referenced by TrackSpectrumTransformer::Process().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TotalQueueSize()

size_t SpectrumTransformer::TotalQueueSize ( ) const
inline

Useful functions to implement WindowProcesser:

How many windows in the queue have been allocated?

Definition at line 129 of file SpectrumTransformer.h.

129{ return mQueue.size(); }

Member Data Documentation

◆ hFFT

HFFT SpectrumTransformer::hFFT
private

Definition at line 165 of file SpectrumTransformer.h.

Referenced by FillFirstWindow(), and OutputStep().

◆ mFFTBuffer

FloatVector SpectrumTransformer::mFFTBuffer
private

These have size mWindowSize:

Definition at line 171 of file SpectrumTransformer.h.

Referenced by FillFirstWindow(), and OutputStep().

◆ mInSampleCount

sampleCount SpectrumTransformer::mInSampleCount = 0
private

Definition at line 166 of file SpectrumTransformer.h.

Referenced by Finish(), ProcessSamples(), and Start().

◆ mInWaveBuffer

FloatVector SpectrumTransformer::mInWaveBuffer
private

Definition at line 172 of file SpectrumTransformer.h.

Referenced by FillFirstWindow(), ProcessSamples(), and Start().

◆ mInWavePos

size_t SpectrumTransformer::mInWavePos = 0
private

Definition at line 168 of file SpectrumTransformer.h.

Referenced by ProcessSamples(), and Start().

◆ mInWindow

FloatVector SpectrumTransformer::mInWindow
private

These have size mWindowSize, or 0 for rectangular window:

Definition at line 175 of file SpectrumTransformer.h.

Referenced by FillFirstWindow(), and SpectrumTransformer().

◆ mLeadingPadding

const bool SpectrumTransformer::mLeadingPadding
protected

Definition at line 159 of file SpectrumTransformer.h.

Referenced by CurrentQueueSize(), QueueIsFull(), and Start().

◆ mNeedsOutput

const bool SpectrumTransformer::mNeedsOutput
private

Definition at line 178 of file SpectrumTransformer.h.

Referenced by OutputStep().

◆ mOutOverlapBuffer

FloatVector SpectrumTransformer::mOutOverlapBuffer
private

Definition at line 173 of file SpectrumTransformer.h.

Referenced by OutputStep(), and Start().

◆ mOutStepCount

sampleCount SpectrumTransformer::mOutStepCount = 0
private

sometimes negative

Definition at line 167 of file SpectrumTransformer.h.

Referenced by CurrentQueueSize(), Finish(), OutputStep(), ProcessSamples(), QueueIsFull(), and Start().

◆ mOutWindow

FloatVector SpectrumTransformer::mOutWindow
private

Definition at line 176 of file SpectrumTransformer.h.

Referenced by OutputStep(), and SpectrumTransformer().

◆ mQueue

std::vector<std::unique_ptr<Window> > SpectrumTransformer::mQueue
private

◆ mSpectrumSize

const size_t SpectrumTransformer::mSpectrumSize
protected

Definition at line 154 of file SpectrumTransformer.h.

Referenced by FillFirstWindow(), and OutputStep().

◆ mStepSize

const size_t SpectrumTransformer::mStepSize
protected

◆ mStepsPerWindow

const unsigned SpectrumTransformer::mStepsPerWindow
protected

Definition at line 156 of file SpectrumTransformer.h.

Referenced by CurrentQueueSize(), QueueIsFull(), SpectrumTransformer(), and Start().

◆ mTrailingPadding

const bool SpectrumTransformer::mTrailingPadding
protected

Definition at line 161 of file SpectrumTransformer.h.

Referenced by Finish().

◆ mWindowSize

const size_t SpectrumTransformer::mWindowSize
protected

The documentation for this class was generated from the following files: