VISR  0.11.1
Versatile Interactive Scene Renderer
visr::rcl::BiquadIirFilter Class Reference

#include <biquad_iir_filter.hpp>

Inheritance diagram for visr::rcl::BiquadIirFilter:
visr::AtomicComponent visr::Component

Public Member Functions

 BiquadIirFilter (SignalFlowContext const &context, char const *name, CompositeComponent *parent=nullptr)
 
 BiquadIirFilter (SignalFlowContext const &context, char const *name, CompositeComponent *parent, std::size_t numberOfChannels, std::size_t numberOfBiquads, bool controlInput=false)
 
 BiquadIirFilter (SignalFlowContext const &context, char const *name, CompositeComponent *parent, std::size_t numberOfChannels, std::size_t numberOfBiquads, rbbl::BiquadCoefficient< SampleType > const &initialBiquad, bool controlInput=false)
 
 BiquadIirFilter (SignalFlowContext const &context, char const *name, CompositeComponent *parent, std::size_t numberOfChannels, std::size_t numberOfBiquads, rbbl::BiquadCoefficientList< SampleType > const &coeffs, bool controlInput=false)
 
 BiquadIirFilter (SignalFlowContext const &context, char const *name, CompositeComponent *parent, std::size_t numberOfChannels, std::size_t numberOfBiquads, rbbl::BiquadCoefficientMatrix< SampleType > const &coeffs, bool controlInput=false)
 
void setup (std::size_t numberOfChannels, std::size_t numberOfBiquads, bool controlInput=false)
 
void setup (std::size_t numberOfChannels, std::size_t numberOfBiquads, rbbl::BiquadCoefficient< SampleType > const &initialBiquad, bool controlInput=false)
 
void setup (std::size_t numberOfChannels, std::size_t numberOfBiquads, rbbl::BiquadCoefficientList< SampleType > const &coeffs, bool controlInput=false)
 
void setup (std::size_t numberOfChannels, std::size_t numberOfBiquads, rbbl::BiquadCoefficientMatrix< SampleType > const &coeffs, bool controlInput=false)
 
void process ()
 
void setCoefficients (std::size_t channelIndex, std::size_t biquadIndex, rbbl::BiquadCoefficient< SampleType > const &coeffs)
 
void setChannelCoefficients (std::size_t channelIndex, rbbl::BiquadCoefficientList< SampleType > const &coeffs)
 
void setCoefficientMatrix (rbbl::BiquadCoefficientMatrix< SampleType > const &coeffs)
 
- Public Member Functions inherited from visr::AtomicComponent
 AtomicComponent (SignalFlowContext const &context, char const *name, CompositeComponent *parent=nullptr)
 
 AtomicComponent (AtomicComponent const &)=delete
 
 AtomicComponent (AtomicComponent &&)=delete
 
virtual ~AtomicComponent () override
 
- Public Member Functions inherited from visr::Component
 Component (SignalFlowContext const &context, char const *componentName, CompositeComponent *parent)
 
 Component (SignalFlowContext const &context, std::string const &componentName, CompositeComponent *parent)
 
 Component (Component const &)=delete
 
 Component (Component &&)=delete
 
Componentoperator= (Component const &)=delete
 
Componentoperator= (Component &&)=delete
 
virtual ~Component ()
 
std::string const & name () const
 
std::string fullName () const
 
void status (StatusMessage::Kind status, char const *message)
 
template<typename... MessageArgs>
void status (StatusMessage::Kind status, MessageArgs...args)
 
bool isComposite () const
 
AudioPortBaseaudioPort (char const *portName)
 
AudioPortBase const & audioPort (char const *portName) const
 
AudioPortBaseaudioPort (std::string const &portName)
 
AudioPortBase const & audioPort (std::string const &portName) const
 
ParameterPortBaseparameterPort (char const *portName)
 
ParameterPortBase const & parameterPort (char const *portName) const
 
ParameterPortBaseparameterPort (std::string const &portName)
 
ParameterPortBase const & parameterPort (std::string const &portName) const
 
SamplingFrequencyType samplingFrequency () const
 
std::size_t period () const
 
bool isTopLevel () const
 
impl::ComponentImplementationimplementation ()
 
impl::ComponentImplementation const & implementation () const
 

Additional Inherited Members

- Static Public Member Functions inherited from visr::Component
static const std::string & nameSeparator ()
 
- Protected Member Functions inherited from visr::Component
 Component (impl::ComponentImplementation *impl)
 

Detailed Description

A multichannel IIR filter consisting of a fixed, arbitrary number of biquads per channel. This class has one input port named "in" and one output port named "out". The widths of the input and the output port are identical and is set by the argument numberOfChannels in the setup() method.

Constructor & Destructor Documentation

visr::rcl::BiquadIirFilter::BiquadIirFilter ( SignalFlowContext const &  context,
char const *  name,
CompositeComponent parent = nullptr 
)
explicit

Constructor that yields a basic, uninitialised object. A setup() method must be called before the component can be used for rendering.

Parameters
contextConfiguration object containing basic execution parameters.
nameThe name of the component. Must be unique within the containing composite component (if there is one).
parentPointer to a containing component if there is one. Specify nullptr in case of a top-level component.
visr::rcl::BiquadIirFilter::BiquadIirFilter ( SignalFlowContext const &  context,
char const *  name,
CompositeComponent parent,
std::size_t  numberOfChannels,
std::size_t  numberOfBiquads,
bool  controlInput = false 
)
explicit

Constructor that yields a fully initialised object. It is not needed to call a setup() afterwards. This overload sets all EQs to a flat response.

Parameters
contextConfiguration object containing basic execution parameters.
nameThe name of the component. Must be unique within the containing composite component (if there is one).
parentPointer to a containing component if there is one. Specify nullptr in case of a top-level component.
numberOfChannelsThe number of single audio waveforms in the multichannel input and output waveforms. .
numberOfBiquadsThe number of biquads per audio channel.
controlInputFlag whether to instantiate a parameter port for receiving filter update commands.
visr::rcl::BiquadIirFilter::BiquadIirFilter ( SignalFlowContext const &  context,
char const *  name,
CompositeComponent parent,
std::size_t  numberOfChannels,
std::size_t  numberOfBiquads,
rbbl::BiquadCoefficient< SampleType > const &  initialBiquad,
bool  controlInput = false 
)
explicit

Constructor that yields a fully initialised object. It is not needed to call a setup() afterwards. This overload sets all biquad sections to the same initial value.

Parameters
contextConfiguration object containing basic execution parameters.
nameThe name of the component. Must be unique within the containing composite component (if there is one).
parentPointer to a containing component if there is one. Specify nullptr in case of a top-level component.
numberOfChannelsThe number of single audio waveforms in the multichannel input and output waveforms. .
numberOfBiquadsThe number of biquads per audio channel.
initialBiquadThe initial setting for the filter characteristics. All biquads in all channels are set to this coefficient set. The default is a flat, direct-feedthrough filter
controlInputFlag whether to instantiate a parameter port for receiving filter update commands.
visr::rcl::BiquadIirFilter::BiquadIirFilter ( SignalFlowContext const &  context,
char const *  name,
CompositeComponent parent,
std::size_t  numberOfChannels,
std::size_t  numberOfBiquads,
rbbl::BiquadCoefficientList< SampleType > const &  coeffs,
bool  controlInput = false 
)
explicit

Constructor that yields a fully initialised object. It is not needed to call a setup() afterwards. This overload sets each channel to the same sequence of biquad sections.

Parameters
contextConfiguration object containing basic execution parameters.
nameThe name of the component. Must be unique within the containing composite component (if there is one).
parentPointer to a containing component if there is one. Specify nullptr in case of a top-level component.
numberOfChannelsThe number of signals in the input signal.
numberOfBiquadsThe number of biquad sections for each channel.
coeffsThe initial biquad coefficients, which are set identically for all channels. The number of biquad coefficient sets in this parameter must equal the numberOfBiquads parameter.
controlInputFlag whether to instantiate a parameter port for receiving filter update commands.
visr::rcl::BiquadIirFilter::BiquadIirFilter ( SignalFlowContext const &  context,
char const *  name,
CompositeComponent parent,
std::size_t  numberOfChannels,
std::size_t  numberOfBiquads,
rbbl::BiquadCoefficientMatrix< SampleType > const &  coeffs,
bool  controlInput = false 
)
explicit

Constructor that yields a fully initialised object. It is not needed to call a setup() afterwards. This overload accepts a matrix of biquad filters to specifically initialise every biquad section for each channel.

Parameters
contextConfiguration object containing basic execution parameters.
nameThe name of the component. Must be unique within the containing composite component (if there is one).
parentPointer to a containing component if there is one. Specify nullptr in case of a top-level component. Setup method to initialise the object and set the biquad filters individually for each filter channel and biquad section.
numberOfChannelsThe number of signals in the input signal.
numberOfBiquadsThe number of biquad sections for each channel.
coeffsThe initial biquad coefficients as a matrix of size numberOfChannels x numberOfBiquads
controlInputFlag whether to instantiate a parameter port for receiving filter update commands.

Member Function Documentation

void visr::rcl::BiquadIirFilter::process ( )
virtual

The process method applies the IIR filters to the audio channels. values to the stream of input samples.

Implements visr::AtomicComponent.

void visr::rcl::BiquadIirFilter::setChannelCoefficients ( std::size_t  channelIndex,
rbbl::BiquadCoefficientList< SampleType > const &  coeffs 
)

Set the biquad coefficients for a filter channel.

Parameters
channelIndexThe index of the filter channel.
coeffsThe biquad coefficients. The number of sections must match the configured number of biquads of the component.
Exceptions
std::out_of_rangeIf channelIndex exceeds the number of filter channels.
std::invalid_argumentIf the number of biquads in coeffs does not match the number of biquad sections in this component.
void visr::rcl::BiquadIirFilter::setCoefficientMatrix ( rbbl::BiquadCoefficientMatrix< SampleType > const &  coeffs)

Set the biquad coefficients for a filter channel.

Parameters
coeffsThe matrix of biquad coefficients, dimension numberOfChannels x numberOfBiquadSections
Exceptions
std::invalid_argumentIf the matrix dimension differs from numberOfChannels x numberOfBiquadSections
void visr::rcl::BiquadIirFilter::setCoefficients ( std::size_t  channelIndex,
std::size_t  biquadIndex,
rbbl::BiquadCoefficient< SampleType > const &  coeffs 
)

Support for runtime changes of the filter coefficients.

Note
At the moment, the coefficients are appplied instantaneously, with not precautions against transients or potential instabilities. Set the IIR biquad coefficients for a specific biquad section of a becific filter channel.
Parameters
channelIndexThe index of the filter channel.
biquadIndexThe index of the biquad section to be set.
coeffsThe set of biquad IIR coefficients.
Exceptions
std::out_of_rangeIf channelIndex exceeds the number of filter channels.
std::out_of_rangeIf biquadIndex exceeds the number of biquad sections of this component.
void visr::rcl::BiquadIirFilter::setup ( std::size_t  numberOfChannels,
std::size_t  numberOfBiquads,
bool  controlInput = false 
)

Setup method to initialise the object and set all eq parameters to a default (flat) response.

Parameters
numberOfChannelsThe number of single audio waveforms in the multichannel input and output waveforms. .
numberOfBiquadsThe number of biquads per audio channel.
controlInputFlag whether to instantiate a parameter port for receiving filter update commands.
void visr::rcl::BiquadIirFilter::setup ( std::size_t  numberOfChannels,
std::size_t  numberOfBiquads,
rbbl::BiquadCoefficient< SampleType > const &  initialBiquad,
bool  controlInput = false 
)

Setup method to initialise the object and set the parameters.

Parameters
numberOfChannelsThe number of single audio waveforms in the multichannel input and output waveforms. .
numberOfBiquadsThe number of biquads per audio channel.
initialBiquadThe initial setting for the filter characteristics. All biquads in all channels are set to this coefficient set. The default is a flat, direct-feedthrough filter
controlInputFlag whether to instantiate a parameter port for receiving filter update commands.
void visr::rcl::BiquadIirFilter::setup ( std::size_t  numberOfChannels,
std::size_t  numberOfBiquads,
rbbl::BiquadCoefficientList< SampleType > const &  coeffs,
bool  controlInput = false 
)

Setup method to initialise the object and set the parameters.

Parameters
numberOfChannelsThe number of signals in the input signal.
numberOfBiquadsThe number of biquad sections for each channel.
coeffsThe initial biquad coefficients, which are set identically for all channels. The number of biquad coefficient sets in this parameter must equal the numberOfBiquads parameter.
controlInputFlag whether to instantiate a parameter port for receiving filter update commands.
void visr::rcl::BiquadIirFilter::setup ( std::size_t  numberOfChannels,
std::size_t  numberOfBiquads,
rbbl::BiquadCoefficientMatrix< SampleType > const &  coeffs,
bool  controlInput = false 
)

Setup method to initialise the object and set the biquad filters individually for each filter channel and biquad section.

Parameters
numberOfChannelsThe number of signals in the input signal.
numberOfBiquadsThe number of biquad sections for each channel.
coeffsThe initial biquad coefficients as a matrix of size numberOfChannels x numberOfBiquads
controlInputFlag whether to instantiate a parameter port for receiving filter update commands.

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