Arduino Filters master
Filter library for Arduino
Public Member Functions | List of all members
BiQuadFilterDF2< T > Class Template Reference

#include <Filters/BiQuad.hpp>

Detailed Description

template<class T = float>
class BiQuadFilterDF2< T >

Generic BiQuad (Bi-Quadratic) filter class, Direct Form 2 implementation.

Uses the NormalizingBiQuadFilterDF2 implementation for floating point types, and NonNormalizingBiQuadFilterDF2 for all other types.

Implements the following difference equation:

\[ y[n] = \frac{b_0 \cdot x[n] + b_1 \cdot x[n-1] + b_2 \cdot x[n-2] - a_1 \cdot y[n-1] - a_2 \cdot y[n-2]}{a_0} \]

Definition at line 485 of file BiQuad.hpp.

+ Inheritance diagram for BiQuadFilterDF2< T >:
+ Collaboration diagram for BiQuadFilterDF2< T >:

Public Member Functions

 BiQuadFilterDF2 ()=default
 
 BiQuadFilterDF2 (const AH::Array< T, 3 > &b_coefficients, const AH::Array< T, 3 > &a_coefficients)
 Construct a new BiQuad (Bi-Quadratic) Filter object. More...
 
 BiQuadFilterDF2 (const BiQuadCoefficients< T > &coefficients)
 
 BiQuadFilterDF2 (const AH::Array< T, 3 > &b_coefficients, const AH::Array< T, 3 > &a_coefficients, T gain)
 Construct a new BiQuad (Bi-Quadratic) Filter object. More...
 
 BiQuadFilterDF2 (const BiQuadCoefficients< T > &coefficients, T gain)
 
operator() (T input)
 Update the internal state with the new input \( x[n] \) and return the new output \( y[n] \). More...
 

Constructor & Destructor Documentation

◆ BiQuadFilterDF2() [1/5]

BiQuadFilterDF2 ( )
default

◆ BiQuadFilterDF2() [2/5]

BiQuadFilterDF2 ( const AH::Array< T, 3 > &  b_coefficients,
const AH::Array< T, 3 > &  a_coefficients 
)
inline

Construct a new BiQuad (Bi-Quadratic) Filter object.

The coefficients \( b \) and \( a \) can be derived from the transfer function:

\[ H(z) = \frac{b_0 + b_1 z^{-1} + b_2 z ^{-2}} {a_0 + a_1 z^{-1} + a_2 z ^{-2}} \]

Parameters
b_coefficientsThe coefficients of the transfer function numerator.
a_coefficientsThe coefficients of the transfer function denominator.

Definition at line 505 of file BiQuad.hpp.

◆ BiQuadFilterDF2() [3/5]

BiQuadFilterDF2 ( const BiQuadCoefficients< T > &  coefficients)
inline

Definition at line 509 of file BiQuad.hpp.

◆ BiQuadFilterDF2() [4/5]

BiQuadFilterDF2 ( const AH::Array< T, 3 > &  b_coefficients,
const AH::Array< T, 3 > &  a_coefficients,
gain 
)
inline

Construct a new BiQuad (Bi-Quadratic) Filter object.

The coefficients \( b \) and \( a \) can be derived from the transfer function:

\[ H(z) = K \frac{b_0 + b_1 z^{-1} + b_2 z ^{-2}} {a_0 + a_1 z^{-1} + a_2 z ^{-2}} \]

Parameters
b_coefficientsThe coefficients of the transfer function numerator.
a_coefficientsThe coefficients of the transfer function denominator.
gainGain factor \( K \).

Definition at line 530 of file BiQuad.hpp.

◆ BiQuadFilterDF2() [5/5]

BiQuadFilterDF2 ( const BiQuadCoefficients< T > &  coefficients,
gain 
)
inline

Definition at line 534 of file BiQuad.hpp.

Member Function Documentation

◆ operator()()

T operator() ( input)
inline

Update the internal state with the new input \( x[n] \) and return the new output \( y[n] \).

Parameters
inputThe new input \( x[n] \).
Returns
The new output \( y[n] \).

Definition at line 545 of file BiQuad.hpp.


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