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

Implements a bank of IIR filters. More...

#include <filterbank.h>

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

Public Member Functions

 IIRFilterBank ()
 Constructs an empty IIR filter bank.
 
 IIRFilterBank (const IIRFilterBank &)=delete
 
IIRFilterBankoperator= (const IIRFilterBank &)=delete
 
 IIRFilterBank (IIRFilterBank &&) noexcept
 Move constructor for the IIR filter bank.
 
IIRFilterBankoperator= (IIRFilterBank &&) noexcept
 Move assignment operator for the IIR filter bank.
 
void Clear () override
 Clears the internal state of the processor.
 
void SetFilter (std::span< const FilterCoefficients > coeffs, uint32_t channel_count)
 Sets the biquad coefficients for each stage.
 
void Process (const AudioBuffer &input, AudioBuffer &output) noexcept override
 Processes a block of input samples through the filter bank.
 
uint32_t InputChannelCount () const override
 Returns the number of input channels supported by this processor.
 
uint32_t OutputChannelCount () const override
 Returns the number of output channels produced by this processor.
 
std::unique_ptr< AudioProcessorClone () const override
 Creates a copy of the filter bank.
 
- Public Member Functions inherited from sfFDN::AudioProcessor

Detailed Description

Implements a bank of IIR filters.

On MacOS, this uses the Accelerate framework for optimized processing. On other platforms, this is equivalent to using a FilterBank with CascadedBiquads filters.

Member Function Documentation

◆ Clear()

void sfFDN::IIRFilterBank::Clear ( )
overridevirtual

Clears the internal state of the processor.

Implements sfFDN::AudioProcessor.

◆ Clone()

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

Creates a copy of the filter bank.

Returns
A unique pointer to the cloned filter bank.

Implements sfFDN::AudioProcessor.

◆ InputChannelCount()

uint32_t sfFDN::IIRFilterBank::InputChannelCount ( ) const
overridevirtual

Returns the number of input channels supported by this processor.

This is equal to the number of filters in the filter bank.

Returns
The number of input channels.

Implements sfFDN::AudioProcessor.

◆ operator=()

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

Move assignment operator for the IIR filter bank.

Returns
A reference to the assigned IIR filter bank.

◆ OutputChannelCount()

uint32_t sfFDN::IIRFilterBank::OutputChannelCount ( ) const
overridevirtual

Returns the number of output channels produced by this processor.

This is equal to the number of filters in the filter bank.

Returns
The number of output channels.

Implements sfFDN::AudioProcessor.

◆ Process()

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

Processes a block of input samples through the filter bank.

Parameters
inputThe input audio buffer.
outputThe output audio buffer. The input and output buffers must have the same number of channels and sample count. The number of channels must be equal to the number of filters in the filter bank.

Implements sfFDN::AudioProcessor.

◆ SetFilter()

void sfFDN::IIRFilterBank::SetFilter ( std::span< const FilterCoefficients > coeffs,
uint32_t channel_count )

Sets the biquad coefficients for each stage.

Parameters
coeffsA span of FilterCoefficients, one for each biquad stage.
channel_countThe number of channels (filters) in the filter bank. Will throw an exception if coeffs.size() is not a multiple of channel_count.

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