Bi-quad filter base class. More...
#include <ignition/math/Filter.hh>
Public Member Functions | |
| BiQuad ()=default | |
| Constructor. | |
| BiQuad (double _fc, double _fs) | |
| Constructor. | |
| void | Fc (double _fc, double _fs) |
| Set the cutoff frequency and sample rate. | |
| void | Fc (double _fc, double _fs, double _q) |
| Set the cutoff frequency, sample rate and Q coefficient. | |
| virtual const T & | Process (const T &_x) |
| Update the filter's output. | |
| virtual void | Set (const T &_val) |
| Set the current filter's output. | |
Public Member Functions inherited from ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Filter< T > | |
| virtual | ~Filter () |
| Destructor. | |
| virtual void | Fc (double _fc, double _fs)=0 |
| Set the cutoff frequency and sample rate. | |
| virtual void | Set (const T &_val) |
| Set the output of the filter. | |
| virtual const T & | Value () const |
| Get the output of the filter. | |
Protected Attributes | |
| double | a0 = 0 |
| Input gain control coefficients. | |
| double | a1 = 0 |
| double | a2 = 0 |
| double | b0 = 0 |
| double | b1 = 0 |
| double | b2 = 0 |
| T | x1 {} |
| Gain of the feedback coefficients. | |
| T | x2 {} |
| T | y1 {} |
| T | y2 {} |
Protected Attributes inherited from ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Filter< T > | |
| T | y0 {} |
| Output. | |
Bi-quad filter base class.
|
default |
Constructor.
|
inline |
Constructor.
| [in] | _fc | Cutoff frequency. |
| [in] | _fs | Sample rate. |
References ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::Fc().
|
inlinevirtual |
Set the cutoff frequency and sample rate.
| [in] | _fc | Cutoff frequency. |
| [in] | _fs | Sample rate. |
Implements ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Filter< T >.
References ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::Fc().
Referenced by ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::BiQuad(), and ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::Fc().
|
inline |
Set the cutoff frequency, sample rate and Q coefficient.
| [in] | _fc | Cutoff frequency. |
| [in] | _fs | Sample rate. |
| [in] | _q | Q coefficient. |
References ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::a0, ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::a1, ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::a2, ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::b0, ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::b1, ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::b2, and IGN_PI.
|
inlinevirtual |
Update the filter's output.
| [in] | _x | Input value. |
References ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::a0, ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::a1, ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::a2, ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::b1, ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::b2, ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::x1, ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::x2, ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Filter< T >::y0, ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::y1, and ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::y2.
|
inlinevirtual |
Set the current filter's output.
| [in] | _val | New filter's output. |
Reimplemented from ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Filter< T >.
References ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::x1, ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::x2, ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Filter< T >::y0, ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::y1, and ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::y2.
|
protected |
Input gain control coefficients.
Referenced by ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::Fc(), and ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::Process().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Gain of the feedback coefficients.
Referenced by ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::Process(), and ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::Set().
|
protected |
|
protected |
|
protected |