#include <Filters/BiQuad.hpp>
BiQuad filter Direct Form 2 implementation that does not normalize the coefficients upon initialization, the division by \( a_0 \) is carried out on each filter iteration.
This class is slower than NormalizingBiQuadFilterDF2, but it works better for integer types, because it has no rounding error on the coefficients.
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 391 of file BiQuad.hpp.
Public Member Functions | |
NonNormalizingBiQuadFilterDF2 ()=default | |
NonNormalizingBiQuadFilterDF2 (const AH::Array< T, 3 > &b, const AH::Array< T, 3 > &a) | |
NonNormalizingBiQuadFilterDF2 (const BiQuadCoefficients< T > &coefficients) | |
NonNormalizingBiQuadFilterDF2 (const AH::Array< T, 3 > &b, const AH::Array< T, 3 > &a, T gain) | |
NonNormalizingBiQuadFilterDF2 (const BiQuadCoefficients< T > &coefficients, T gain) | |
T | operator() (T input) |
Update the internal state with the new input \( x[n] \) and return the new output \( y[n] \). More... | |
Static Public Member Functions | |
template<bool Enable = true> | |
static std::enable_if_t< std::is_floating_point< T >::value &&Enable, T > | update (T input, AH::Array< T, 2 > &w, const AH::Array< T, 3 > &b, const AH::Array< T, 2 > &a, T a0) |
template<bool Enable = true> | |
static std::enable_if_t<!std::is_floating_point< T >::value &&Enable, T > | update (T input, AH::Array< T, 2 > &w, const AH::Array< T, 3 > &b, const AH::Array< T, 2 > &a, T a0) |
Private Attributes | |
AH::Array< T, 2 > | w = {{}} |
Internal state. More... | |
AH::Array< T, 3 > | b = {{}} |
Numerator coefficients. More... | |
AH::Array< T, 2 > | a = {{}} |
Denominator coefficients. More... | |
T | a0 = T(1.) |
First denominator coefficient. More... | |
|
default |
|
inline |
Definition at line 395 of file BiQuad.hpp.
|
inline |
Definition at line 399 of file BiQuad.hpp.
|
inline |
Definition at line 402 of file BiQuad.hpp.
|
inline |
Definition at line 406 of file BiQuad.hpp.
|
inlinestatic |
Definition at line 412 of file BiQuad.hpp.
|
inlinestatic |
Definition at line 427 of file BiQuad.hpp.
|
inline |
Update the internal state with the new input \( x[n] \) and return the new output \( y[n] \).
input | The new input \( x[n] \). |
Definition at line 448 of file BiQuad.hpp.
|
private |
Internal state.
Definition at line 451 of file BiQuad.hpp.
|
private |
Numerator coefficients.
Definition at line 452 of file BiQuad.hpp.
|
private |
Denominator coefficients.
Definition at line 453 of file BiQuad.hpp.
|
private |
First denominator coefficient.
Definition at line 454 of file BiQuad.hpp.