sfFDN
Loading...
Searching...
No Matches
sfFDN::PartitionedConvolver Class Reference

A partitioned convolution engine that can filter audio signals with an FIR filter. More...

#include <partitioned_convolver.h>

Inheritance diagram for sfFDN::PartitionedConvolver:
[legend]
Collaboration diagram for sfFDN::PartitionedConvolver:
[legend]

Public Member Functions

 PartitionedConvolver (uint32_t block_size, std::span< const float > fir, uint32_t rep_count=8)
 Constructs a PartitionedConvolver.
 
 PartitionedConvolver (const PartitionedConvolver &)=delete
 
PartitionedConvolveroperator= (const PartitionedConvolver &)=delete
 
 PartitionedConvolver (PartitionedConvolver &&) noexcept
 Move constructor for the partitioned convolver.
 
PartitionedConvolveroperator= (PartitionedConvolver &&) noexcept
 Move assignment operator for the partitioned convolver.
 
void Process (const AudioBuffer &input, AudioBuffer &output) noexcept override
 Processes the audio buffer.
 
uint32_t GetBlockSize () const
 Gets the block size used for processing.
 
void DumpInfo () const
 Dumps internal information to the standard output for debugging purposes.
 
std::string GetShortInfo () const
 Gets a short string representation of the internal state of the convolver for debugging purposes.
 
uint32_t InputChannelCount () const override
 Gets the number of input channels supported.
 
uint32_t OutputChannelCount () const override
 Gets the number of output channels supported.
 
void Clear () override
 Clears the internal state of the processor.
 
std::unique_ptr< AudioProcessorClone () const override
 Creates a copy of the PartitionedConvolver.
 
- Public Member Functions inherited from sfFDN::AudioProcessor

Detailed Description

A partitioned convolution engine that can filter audio signals with an FIR filter.

Constructor & Destructor Documentation

◆ PartitionedConvolver()

sfFDN::PartitionedConvolver::PartitionedConvolver ( uint32_t block_size,
std::span< const float > fir,
uint32_t rep_count = 8 )

Constructs a PartitionedConvolver.

Parameters
block_sizeThe block size to use for processing.
firThe FIR filter coefficients.
rep_countThe number of times to repeat each block in the partitioned convolution. The PartitionedConvolver only works if the block size stays constant during use. Process() expects the input and output buffers to have a sample count equal to the block size.

Member Function Documentation

◆ Clear()

void sfFDN::PartitionedConvolver::Clear ( )
overridevirtual

Clears the internal state of the processor.

This function resets the internal buffers and states of the convolver, but keeps the FIR filter intact.

Implements sfFDN::AudioProcessor.

◆ Clone()

std::unique_ptr< AudioProcessor > sfFDN::PartitionedConvolver::Clone ( ) const
overridevirtual

Creates a copy of the PartitionedConvolver.

Returns
A unique pointer to the cloned PartitionedConvolver.

Implements sfFDN::AudioProcessor.

◆ GetBlockSize()

uint32_t sfFDN::PartitionedConvolver::GetBlockSize ( ) const

Gets the block size used for processing.

Returns
The block size used for processing.

◆ GetShortInfo()

std::string sfFDN::PartitionedConvolver::GetShortInfo ( ) const

Gets a short string representation of the internal state of the convolver for debugging purposes.

Returns
A short string representation of the internal state of the convolver.

◆ InputChannelCount()

uint32_t sfFDN::PartitionedConvolver::InputChannelCount ( ) const
inlineoverridevirtual

Gets the number of input channels supported.

This is always 1, as PartitionedConvolver processes one channel at a time.

Returns
The number of input channels supported.

Implements sfFDN::AudioProcessor.

◆ operator=()

PartitionedConvolver & sfFDN::PartitionedConvolver::operator= ( PartitionedConvolver && )
noexcept

Move assignment operator for the partitioned convolver.

Returns
A reference to the assigned partitioned convolver.

◆ OutputChannelCount()

uint32_t sfFDN::PartitionedConvolver::OutputChannelCount ( ) const
inlineoverridevirtual

Gets the number of output channels supported.

This is always 1, as PartitionedConvolver processes one channel at a time.

Returns
The number of output channels supported.

Implements sfFDN::AudioProcessor.

◆ Process()

void sfFDN::PartitionedConvolver::Process ( const AudioBuffer & input,
AudioBuffer & output )
overridevirtualnoexcept

Processes the audio buffer.

Parameters
inputThe input audio buffer.
outputThe output audio buffer. The input and output buffers must have the same number of samples equal to the block size.

Implements sfFDN::AudioProcessor.


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