This Biquad class implements a second-order recursive linear filter, containing two poles and two zeros.
More...
|
constexpr | biquad () noexcept=default |
|
constexpr | biquad (const biquad &) noexcept=default |
|
constexpr | biquad (biquad &&) noexcept=default |
|
constexpr biquad & | operator= (const biquad &) noexcept=default |
|
constexpr biquad & | operator= (biquad &&) noexcept=default |
|
constexpr | biquad (const std::complex< T > &pole, const std::complex< T > &zero) |
| Initialize a Biquad filter with one single pole and zero. More...
|
|
constexpr | biquad (const std::complex< T > &pole_first, const std::complex< T > &zero_first, const std::complex< T > &pole_second, const std::complex< T > &zero_second) |
| Initialize a Biquad filter with a pair of zero-pole. More...
|
|
constexpr | biquad (value_type a0, value_type a1, value_type a2, value_type b0, value_type b1, value_type b2) noexcept |
| Initialize a Biquad fitler with the given coefficients. More...
|
|
| ~biquad ()=default |
| Default destructor. More...
|
|
constexpr value_type | a0 () const noexcept |
| Returns the value of the coefficient \( a_0 \). More...
|
|
constexpr value_type | a1 () const noexcept |
| Returns the value of the coefficient \( a_1 \). More...
|
|
constexpr value_type | a2 () const noexcept |
| Returns the value of the coefficient \( a_2 \). More...
|
|
constexpr value_type | b0 () const noexcept |
| Returns the value of the coefficient \( b_0 \). More...
|
|
constexpr value_type | b1 () const noexcept |
| Returns the value of the coefficient \( b_1 \). More...
|
|
constexpr value_type | b2 () const noexcept |
| Returns the value of the coefficient \( b_2 \). More...
|
|
constexpr void | set_a0 (T value) noexcept |
| Updates the value of the coefficient \( a_0 \). More...
|
|
constexpr void | set_a1 (T value) noexcept |
| Updates the value of the coefficient \( a_1 \). More...
|
|
constexpr void | set_a2 (T value) noexcept |
| Updates the value of the coefficient \( a_2 \). More...
|
|
constexpr void | set_b0 (T value) noexcept |
| Updates the value of the coefficient \( b_0 \). More...
|
|
constexpr void | set_b1 (T value) noexcept |
| Updates the value of the coefficient \( b_1 \). More...
|
|
constexpr void | set_b2 (T value) noexcept |
| Updates the value of the coefficient \( b_2 \). More...
|
|
template<typename InputIt , typename OutputIt > |
constexpr void | filter (InputIt first, InputIt last, OutputIt d_first) |
| Filters the signal in the range [first, last) and stores the result in another range, beginning at d_first. More...
|
|
constexpr void | reset () noexcept |
| Reset the filter to the original state. More...
|
|
constexpr bool | stability () const noexcept |
| Checks if the Biquad Filter is stable. More...
|
|
constexpr | operator bool () const noexcept |
| Boolean operator to checks if the filter is stable. More...
|
|
constexpr value_type | tick (T value) noexcept |
| Computes the output of filtering one digital time-step. More...
|
|
template<typename T>
class edsp::filter::biquad< T >
This Biquad class implements a second-order recursive linear filter, containing two poles and two zeros.
In the Z domain, its transfer function is:
\[ H(z)={\frac {b_{0}+b_{1}z^{{-1}}+b_{2}z^{{-2}}}{a_{0}+a_{1}z^{{-1}}+a_{2}z^{{-2}}}} \]
Which is often normalized by dividing all coefficients by a0. This class performs the filtering with a Direct Form I:
\[ y[n]={\frac {1}{a_{0}}}\left(b_{0}x[n]+b_{1}x[n-1]+b_{2}x[n-2]-a_{1}y[n-1]-a_{2}y[n-2]\right) \]