Public Member Functions | Protected Member Functions | List of all members
TwoStageFFTConvolver Class Reference

FFT convolver using two different block sizes. More...

Inherited by MultithreadedConvolver.

Public Member Functions

void cleanPipeline ()
 Clears the internal buffers so that it resets the convolution pipeline. More...
 
bool init (size_t headBlockSize, size_t tailBlockSize, const Sample *ir, size_t irLen)
 Initialization the convolver. More...
 
void process (const Sample *input, Sample *output, size_t len)
 Convolves the the given input samples and immediately outputs the result. More...
 
void reset ()
 Resets the convolver and discards the set impulse response.
 

Protected Member Functions

void doBackgroundProcessing ()
 Actually performs the background processing work.
 
virtual void startBackgroundProcessing ()
 Method called by the convolver if work for background processing is available. More...
 
virtual void waitForBackgroundProcessing ()
 Called by the convolver if it expects the result of its previous call to startBackgroundProcessing() More...
 

Detailed Description

FFT convolver using two different block sizes.

The 2-stage convolver consists internally of two convolvers:

Using a short block size for the head convolver and a long block size for the tail convolver results in much less CPU usage, while keeping the calculation time of each processing call short.

Furthermore, this convolver class provides virtual methods which provide the possibility to move the tail convolution into the background (e.g. by using multithreading, see startBackgroundProcessing()/waitForBackgroundProcessing()).

As well as the basic FFTConvolver class, the 2-stage convolver is suitable for real-time processing which means that no "unpredictable" operations like allocations, locking, API calls, etc. are performed during processing (all necessary allocations and preparations take place during initialization).

Member Function Documentation

void cleanPipeline ( )

Clears the internal buffers so that it resets the convolution pipeline.

bool init ( size_t  headBlockSize,
size_t  tailBlockSize,
const Sample *  ir,
size_t  irLen 
)

Initialization the convolver.

Parameters
headBlockSizeThe head block size
tailBlockSizethe tail block size
irThe impulse response
irLenLength of the impulse response in samples
Returns
true: Success - false: Failed
void process ( const Sample *  input,
Sample *  output,
size_t  len 
)

Convolves the the given input samples and immediately outputs the result.

Parameters
inputThe input samples
outputThe convolution result
lenNumber of input/output samples
void startBackgroundProcessing ( )
protectedvirtual

Method called by the convolver if work for background processing is available.

The default implementation just calls doBackgroundProcessing() to perform the "bulk" convolution. However, if you want to perform the majority of work in some background thread (which is recommended), you can overload this method and trigger the execution of doBackgroundProcessing() really in some background thread.

void waitForBackgroundProcessing ( )
protectedvirtual

Called by the convolver if it expects the result of its previous call to startBackgroundProcessing()

After returning from this method, all background processing has to be completed.

©2017 HISE. This documentation is autogenerated from the HISE source code using Doxygen.