Bi-quad filter base class. More...
#include <gz/math/Filter.hh>
Public Member Functions | |
BiQuad ()=default | |
Constructor. More... | |
BiQuad (double _fc, double _fs) | |
Constructor. More... | |
void | Fc (double _fc, double _fs) override |
Set the cutoff frequency and sample rate. More... | |
void | Fc (double _fc, double _fs, double _q) |
Set the cutoff frequency, sample rate and Q coefficient. More... | |
virtual const T & | Process (const T &_x) |
Update the filter's output. More... | |
virtual void | Set (const T &_val) override |
Set the current filter's output. More... | |
Public Member Functions inherited from Filter< T > | |
virtual | ~Filter () |
Destructor. More... | |
virtual const T & | Value () const |
Get the output of the filter. More... | |
Protected Attributes | |
double | a0 = 0 |
Input gain control coefficients. More... | |
double | a1 = 0 |
double | a2 = 0 |
double | b0 = 0 |
double | b1 = 0 |
double | b2 = 0 |
T | x1 {} |
Gain of the feedback coefficients. More... | |
T | x2 {} |
T | y1 {} |
T | y2 {} |
Protected Attributes inherited from Filter< T > | |
T | y0 {} |
Output. More... | |
Detailed Description
template<class T>
class gz::math::BiQuad< T >
Bi-quad filter base class.
Constructor & Destructor Documentation
◆ BiQuad() [1/2]
|
default |
Constructor.
◆ BiQuad() [2/2]
|
inline |
Member Function Documentation
◆ Fc() [1/2]
|
inlineoverridevirtual |
Set the cutoff frequency and sample rate.
- Parameters
-
[in] _fc Cutoff frequency. [in] _fs Sample rate.
Implements Filter< T >.
Referenced by BiQuad< T >::BiQuad().
◆ Fc() [2/2]
|
inline |
Set the cutoff frequency, sample rate and Q coefficient.
- Parameters
-
[in] _fc Cutoff frequency. [in] _fs Sample rate. [in] _q Q coefficient.
References BiQuad< T >::a0, BiQuad< T >::a1, BiQuad< T >::a2, BiQuad< T >::b0, BiQuad< T >::b1, BiQuad< T >::b2, and GZ_PI.
◆ Process()
|
inlinevirtual |
Update the filter's output.
- Parameters
-
[in] _x Input value.
- Returns
- The filter's current output.
References BiQuad< T >::a0, BiQuad< T >::a1, BiQuad< T >::a2, BiQuad< T >::b1, BiQuad< T >::b2, BiQuad< T >::x1, BiQuad< T >::x2, Filter< T >::y0, BiQuad< T >::y1, and BiQuad< T >::y2.
◆ Set()
|
inlineoverridevirtual |
Set the current filter's output.
- Parameters
-
[in] _val New filter's output.
Reimplemented from Filter< T >.
References BiQuad< T >::x1, BiQuad< T >::x2, Filter< T >::y0, BiQuad< T >::y1, and BiQuad< T >::y2.
Member Data Documentation
◆ a0
|
protected |
Input gain control coefficients.
Referenced by BiQuad< T >::Fc(), and BiQuad< T >::Process().
◆ a1
|
protected |
Referenced by BiQuad< T >::Fc(), and BiQuad< T >::Process().
◆ a2
|
protected |
Referenced by BiQuad< T >::Fc(), and BiQuad< T >::Process().
◆ b0
|
protected |
Referenced by BiQuad< T >::Fc().
◆ b1
|
protected |
Referenced by BiQuad< T >::Fc(), and BiQuad< T >::Process().
◆ b2
|
protected |
Referenced by BiQuad< T >::Fc(), and BiQuad< T >::Process().
◆ x1
|
protected |
Gain of the feedback coefficients.
Referenced by BiQuad< T >::Process(), and BiQuad< T >::Set().
◆ x2
|
protected |
Referenced by BiQuad< T >::Process(), and BiQuad< T >::Set().
◆ y1
|
protected |
Referenced by BiQuad< T >::Process(), and BiQuad< T >::Set().
◆ y2
|
protected |
Referenced by BiQuad< T >::Process(), and BiQuad< T >::Set().
The documentation for this class was generated from the following file: