Ignition Math

API Reference

6.4.0
BiQuad< T > Class Template Reference

Bi-quad filter base class. More...

#include <ignition/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
 
x1 {}
 Gain of the feedback coefficients. More...
 
x2 {}
 
y1 {}
 
y2 {}
 
- Protected Attributes inherited from Filter< T >
y0 {}
 Output. More...
 

Detailed Description

template<class T>
class ignition::math::BiQuad< T >

Bi-quad filter base class.

See also
http://www.earlevel.com/main/2003/03/02/the-bilinear-z-transform/

Constructor & Destructor Documentation

◆ BiQuad() [1/2]

BiQuad ( )
default

Constructor.

◆ BiQuad() [2/2]

BiQuad ( double  _fc,
double  _fs 
)
inline

Constructor.

Parameters
[in]_fcCutoff frequency.
[in]_fsSample rate.

Member Function Documentation

◆ Fc() [1/2]

void Fc ( double  _fc,
double  _fs 
)
inlineoverridevirtual

Set the cutoff frequency and sample rate.

Parameters
[in]_fcCutoff frequency.
[in]_fsSample rate.

Implements Filter< T >.

◆ Fc() [2/2]

void Fc ( double  _fc,
double  _fs,
double  _q 
)
inline

Set the cutoff frequency, sample rate and Q coefficient.

Parameters
[in]_fcCutoff frequency.
[in]_fsSample rate.
[in]_qQ coefficient.

◆ Process()

virtual const T& Process ( const T &  _x)
inlinevirtual

Update the filter's output.

Parameters
[in]_xInput value.
Returns
The filter's current output.

◆ Set()

virtual void Set ( const T &  _val)
inlineoverridevirtual

Set the current filter's output.

Parameters
[in]_valNew filter's output.

Reimplemented from Filter< T >.

Member Data Documentation

◆ a0

double a0 = 0
protected

Input gain control coefficients.

◆ a1

double a1 = 0
protected

◆ a2

double a2 = 0
protected

◆ b0

double b0 = 0
protected

◆ b1

double b1 = 0
protected

◆ b2

double b2 = 0
protected

◆ x1

T x1 {}
protected

Gain of the feedback coefficients.

◆ x2

T x2 {}
protected

◆ y1

T y1 {}
protected

◆ y2

T y2 {}
protected

The documentation for this class was generated from the following file: