tomlankhorst/control
|
#include <biquad.h>
Public Member Functions | |
Biquad (T b0, T b1, T b2, T a1, T a2) | |
Biquad (T b0, T b1, T b2, T a0, T a1, T a2) | |
Biquad (TCS< T > z, TCS< T > p, T k) | |
T | step (T x) |
TCS< T > | poles () |
TCS< T > | zeros () |
bool | stable () |
void | reset () |
Protected Member Functions | |
std::tuple< T, T, T, T, T > | zpk2coef (TCS< T > z, TCS< T > p, T k) |
std::tuple< T, T > | zero2coef (TCS< T > z) |
TCS< T > | solve (T a, T b, T c) |
Protected Attributes | |
T | wz [2] = {0, 0} |
S | B [3] |
S | A [2] |
Filters that - in the z domain - are the ratio of two quadratic functions.
The general form is:
b0 + b1 z^-1 + b2 z^-2
H(z) = -------------------— a0 + a1 z^-1 + a2 z^-2
Normalized by dividing all coefficients by a0.
T | arithmetic type |
S | parameter type (const T) |
|
inline |
Initialize a biquad filter with normalized (5) coefficients
T | b0 |
T | b1 |
T | b2 |
T | a1 |
T | a2 |
|
inline |
Initialize a biquad with unnormalized (6) coefficients
b0 | |
b1 | |
b2 | |
a0 | |
a1 | |
a2 |
|
inline |
Initialize a biquad with ZPK
TCS<T> | z zeros |
TCS<T> | p poles |
T | k gain |
|
inline |
Poles of the biquad
Get a tuple of two complex values that represent the biquads poles. Poles of a biquad are the solution to the denominator, a quadratic equation.
|
inline |
Reset the biquad
|
inlineprotected |
Solve a quadratic polynomial
ax^2+bx+c -> k(x-z1)(x-z2)
a | T |
b | T |
c | T |
|
inline |
Stability of the biquad
Checks stability through evaluating the magnitude of the poles
|
inlinevirtual |
Step the biquad
T | x input value |
Implements control::system::SISO< T >.
|
inlineprotected |
Coefficients of quadratic poly. corresponding to zeros
Gets the coefficients of the quadratic polynomial s.t. its solutions are p
(x-z1)(x-z2) -> x^2-(z1+z2)+z1*z2
TCS<T> | z tuple of two complex Ts |
|
inline |
|
inlineprotected |
Convert ZPK to coefs