Krotos Modules 3
Loading...
Searching...
No Matches
fftconvolver::FFTConvolver Class Reference

Implementation of a partitioned FFT convolution algorithm with uniform block size. More...

#include <FFTConvolver.h>

Public Member Functions

 FFTConvolver ()
 
virtual ~FFTConvolver ()
 
bool init (size_t blockSize, const Sample *ir, size_t irLen)
 Initializes the convolver.
 
void process (const Sample *input, Sample *output, size_t len)
 Convolves the the given input samples and immediately outputs the result.
 
void reset ()
 Resets the convolver and discards the set impulse response.
 

Private Member Functions

 FFTConvolver (const FFTConvolver &)
 
FFTConvolveroperator= (const FFTConvolver &)
 

Private Attributes

size_t _blockSize
 
size_t _segSize
 
size_t _segCount
 
size_t _fftComplexSize
 
std::vector< SplitComplex * > _segments
 
std::vector< SplitComplex * > _segmentsIR
 
SampleBuffer _fftBuffer
 
audiofft::AudioFFT _fft
 
SplitComplex _preMultiplied
 
SplitComplex _conv
 
SampleBuffer _overlap
 
size_t _current
 
SampleBuffer _inputBuffer
 
size_t _inputBufferFill
 

Detailed Description

Implementation of a partitioned FFT convolution algorithm with uniform block size.

Some notes on how to use it:

  • After initialization with an impulse response, subsequent data portions of arbitrary length can be convolved. The convolver internally can handle this by using appropriate buffering.
  • The convolver works without "latency" (except for the required processing time, of course), i.e. the output always is the convolved input for each processing call.
  • The 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).

Constructor & Destructor Documentation

◆ FFTConvolver() [1/2]

fftconvolver::FFTConvolver::FFTConvolver ( )

◆ ~FFTConvolver()

fftconvolver::FFTConvolver::~FFTConvolver ( )
virtual

◆ FFTConvolver() [2/2]

fftconvolver::FFTConvolver::FFTConvolver ( const FFTConvolver & )
private

Member Function Documentation

◆ init()

bool fftconvolver::FFTConvolver::init ( size_t blockSize,
const Sample * ir,
size_t irLen )

Initializes the convolver.

Parameters
blockSizeBlock size internally used by the convolver (partition size)
irThe impulse response
irLenLength of the impulse response
Returns
true: Success - false: Failed

◆ operator=()

FFTConvolver & fftconvolver::FFTConvolver::operator= ( const FFTConvolver & )
private

◆ process()

void fftconvolver::FFTConvolver::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

◆ reset()

void fftconvolver::FFTConvolver::reset ( )

Resets the convolver and discards the set impulse response.

Member Data Documentation

◆ _blockSize

size_t fftconvolver::FFTConvolver::_blockSize
private

◆ _conv

SplitComplex fftconvolver::FFTConvolver::_conv
private

◆ _current

size_t fftconvolver::FFTConvolver::_current
private

◆ _fft

audiofft::AudioFFT fftconvolver::FFTConvolver::_fft
private

◆ _fftBuffer

SampleBuffer fftconvolver::FFTConvolver::_fftBuffer
private

◆ _fftComplexSize

size_t fftconvolver::FFTConvolver::_fftComplexSize
private

◆ _inputBuffer

SampleBuffer fftconvolver::FFTConvolver::_inputBuffer
private

◆ _inputBufferFill

size_t fftconvolver::FFTConvolver::_inputBufferFill
private

◆ _overlap

SampleBuffer fftconvolver::FFTConvolver::_overlap
private

◆ _preMultiplied

SplitComplex fftconvolver::FFTConvolver::_preMultiplied
private

◆ _segCount

size_t fftconvolver::FFTConvolver::_segCount
private

◆ _segments

std::vector<SplitComplex*> fftconvolver::FFTConvolver::_segments
private

◆ _segmentsIR

std::vector<SplitComplex*> fftconvolver::FFTConvolver::_segmentsIR
private

◆ _segSize

size_t fftconvolver::FFTConvolver::_segSize
private

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