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 &&other) noexcept
 Move constructor for the IIR filter bank.
 
IIRFilterBankoperator= (IIRFilterBank &&other) 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 SFFDN_NONBLOCKING override
 Processes a block of input samples through the filter bank.
 
uint32_t InputChannelCount () const noexcept SFFDN_NONBLOCKING override
 Returns the number of input channels supported by this processor.
 
uint32_t OutputChannelCount () const noexcept SFFDN_NONBLOCKING 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

Additional Inherited Members

- Protected Member Functions inherited from sfFDN::AudioProcessor
 AudioProcessor (const AudioProcessor &)=default
 
AudioProcessoroperator= (const AudioProcessor &)=default
 
 AudioProcessor (AudioProcessor &&) noexcept=default
 
AudioProcessoroperator= (AudioProcessor &&) noexcept=default
 

Detailed Description

Implements a bank of IIR filters.

On Apple Silicon, short cascades use single-channel Accelerate filters and longer cascades use channel-major CascadedBiquads processing. On Intel macOS, it uses the Accelerate framework when enabled. Other platforms use a portable multichannel implementation.

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
overridevirtualnoexcept

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 && other)
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
overridevirtualnoexcept

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: