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.
Creates an uninitialized convolver.
Convolver[2/2]
Copy constructor and assignment operator are deleted to prevent copying.
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:
otherTheConvolverinstance 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.
Returns:
The number of convolution segments.
GetSegmentSize
Gets the size of a single convolution segment.
Returns:
The size of a single convolution segment.
Init
Initializes the convolver.
Parameters:
-
blockSizeBlock size internally used by the convolver (partition size) -
irThe impulse response -
irLenLength 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:
-
inputThe input samples. -
outputThe convolution result. -
lenNumber of input/output samples to process.
Reset
Resets the convolver state and discards the set impulse response.
The convolver will need to be initialized again after this call.
operator=
Copy constructor and assignment operator are deleted to prevent copying.
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:
otherTheConvolverinstance to assign from. This is explicitly disallowed.
Returns:
This method does not return a value since it is deleted.
~Convolver
Destructor.
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