Skip to content

Convolver

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

Detailed Description

Some notes on how to use it:

  • After initialization with an impulse response, further 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), e.g., 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).

Public Functions

Type Name
Convolver ()
Default constructor.
Convolver (const Convolver & other) = delete
Copy constructor and assignment operator are deleted to prevent copying.
AmSize GetSegmentCount () const
Gets the number of convolution segments.
AmSize GetSegmentSize () const
Gets the size of a single convolution segment.
bool Init (AmSize blockSize, const AmAudioSample * ir, AmSize irLen)
Initializes the convolver.
void Process (const AmAudioSample * input, AmAudioSample * output, AmSize len)
Convolves the given input samples and immediately outputs the result.
void Reset ()
Resets the convolver state and discards the set impulse response.
Convolver & operator= (const Convolver & other) = delete
Copy constructor and assignment operator are deleted to prevent copying.
virtual ~Convolver ()
Destructor.

Public Functions Documentation

Convolver[1/2]

Default constructor.

Amplitude::Convolver::Convolver () 

Creates an uninitialized convolver.

Convolver[2/2]

Copy constructor and assignment operator are deleted to prevent copying.

Amplitude::Convolver::Convolver (
    const Convolver & other
) = delete

This class does not allow assignment between instances. It ensures that each instance has its own unique state and prevents accidental sharing of internal resources.

Parameters:

  • other The Convolver instance to assign from. This is explicitly disallowed.

Returns:

This method does not return a value since it is deleted.

GetSegmentCount

Gets the number of convolution segments.

AmSize Amplitude::Convolver::GetSegmentCount () const

Returns:

The number of convolution segments.

GetSegmentSize

Gets the size of a single convolution segment.

AmSize Amplitude::Convolver::GetSegmentSize () const

Returns:

The size of a single convolution segment.

Init

Initializes the convolver.

bool Amplitude::Convolver::Init (
    AmSize blockSize,
    const AmAudioSample * ir,
    AmSize irLen
) 

Parameters:

  • blockSize Block size internally used by the convolver (partition size)
  • ir The impulse response
  • irLen Length of the impulse response

Returns:

true when the convolver is successfully initialized, false otherwise.

Process

Convolves the given input samples and immediately outputs the result.

void Amplitude::Convolver::Process (
    const AmAudioSample * input,
    AmAudioSample * output,
    AmSize len
) 

Parameters:

  • input The input samples.
  • output The convolution result.
  • len Number of input/output samples to process.
Reset

Resets the convolver state and discards the set impulse response.

void Amplitude::Convolver::Reset () 

The convolver will need to be initialized again after this call.

operator=

Copy constructor and assignment operator are deleted to prevent copying.

Convolver & Amplitude::Convolver::operator= (
    const Convolver & other
) = delete

This class does not allow assignment between instances. It ensures that each instance has its own unique state and prevents accidental sharing of internal resources.

Parameters:

  • other The Convolver instance to assign from. This is explicitly disallowed.

Returns:

This method does not return a value since it is deleted.

~Convolver

Destructor.

virtual Amplitude::Convolver::~Convolver () 

Destroys the convolver and frees all allocated resources.


The documentation for this class was generated from the following file: include/SparkyStudios/Audio/Amplitude/DSP/Convolver.h