VCV Rack API v2
Loading...
Searching...
No Matches
rack::dsp::IIRFilter< B_ORDER, A_ORDER, T > Struct Template Reference

Digital IIR filter processor. More...

#include <filter.hpp>

Public Member Functions

 IIRFilter ()
 
void reset ()
 
void setCoefficients (const T *b, const T *a)
 
process (T in)
 
std::complex< T > getTransferFunction (T s)
 Computes the complex transfer function $H(s)$ at a particular frequency s: normalized angular frequency equal to $2 \pi f / f_{sr}$ ($\pi$ is the Nyquist frequency)
 
getFrequencyResponse (T f)
 
getFrequencyPhase (T f)
 

Public Attributes

b [B_ORDER] = {}
 transfer function numerator coefficients: b_0, b_1, etc.
 
a [A_ORDER - 1] = {}
 transfer function denominator coefficients: a_1, a_2, etc.
 
x [B_ORDER - 1]
 input state x[0] = x_{n-1} x[1] = x_{n-2} etc.
 
y [A_ORDER - 1]
 output state
 

Detailed Description

template<int B_ORDER, int A_ORDER, typename T = float>
struct rack::dsp::IIRFilter< B_ORDER, A_ORDER, T >

Digital IIR filter processor.

https://en.wikipedia.org/wiki/Infinite_impulse_response

Constructor & Destructor Documentation

◆ IIRFilter()

template<int B_ORDER, int A_ORDER, typename T = float>
rack::dsp::IIRFilter< B_ORDER, A_ORDER, T >::IIRFilter ( )
inline

Member Function Documentation

◆ reset()

template<int B_ORDER, int A_ORDER, typename T = float>
void rack::dsp::IIRFilter< B_ORDER, A_ORDER, T >::reset ( )
inline

◆ setCoefficients()

template<int B_ORDER, int A_ORDER, typename T = float>
void rack::dsp::IIRFilter< B_ORDER, A_ORDER, T >::setCoefficients ( const T * b,
const T * a )
inline

◆ process()

template<int B_ORDER, int A_ORDER, typename T = float>
T rack::dsp::IIRFilter< B_ORDER, A_ORDER, T >::process ( T in)
inline

◆ getTransferFunction()

template<int B_ORDER, int A_ORDER, typename T = float>
std::complex< T > rack::dsp::IIRFilter< B_ORDER, A_ORDER, T >::getTransferFunction ( T s)
inline

Computes the complex transfer function $H(s)$ at a particular frequency s: normalized angular frequency equal to $2 \pi f / f_{sr}$ ($\pi$ is the Nyquist frequency)

◆ getFrequencyResponse()

template<int B_ORDER, int A_ORDER, typename T = float>
T rack::dsp::IIRFilter< B_ORDER, A_ORDER, T >::getFrequencyResponse ( T f)
inline

◆ getFrequencyPhase()

template<int B_ORDER, int A_ORDER, typename T = float>
T rack::dsp::IIRFilter< B_ORDER, A_ORDER, T >::getFrequencyPhase ( T f)
inline

Member Data Documentation

◆ b

template<int B_ORDER, int A_ORDER, typename T = float>
T rack::dsp::IIRFilter< B_ORDER, A_ORDER, T >::b[B_ORDER] = {}

transfer function numerator coefficients: b_0, b_1, etc.

◆ a

template<int B_ORDER, int A_ORDER, typename T = float>
T rack::dsp::IIRFilter< B_ORDER, A_ORDER, T >::a[A_ORDER - 1] = {}

transfer function denominator coefficients: a_1, a_2, etc.

a_0 is fixed to 1 and omitted from the a array, so its indices are shifted down by 1.

◆ x

template<int B_ORDER, int A_ORDER, typename T = float>
T rack::dsp::IIRFilter< B_ORDER, A_ORDER, T >::x[B_ORDER - 1]

input state x[0] = x_{n-1} x[1] = x_{n-2} etc.

◆ y

template<int B_ORDER, int A_ORDER, typename T = float>
T rack::dsp::IIRFilter< B_ORDER, A_ORDER, T >::y[A_ORDER - 1]

output state


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