Loading...
Searching...
No Matches
ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T > Class Template Reference

Bi-quad filter base class. More...

#include <ignition/math/Filter.hh>

Inheritance diagram for ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >:

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

Detailed Description

template<class T>
class ignition::math::IGNITION_MATH_VERSION_NAMESPACE::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]

template<class T>
ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::BiQuad ( )
default

Constructor.

◆ BiQuad() [2/2]

template<class T>
ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::BiQuad ( double _fc,
double _fs )
inline

Constructor.

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

References Fc().

Member Function Documentation

◆ Fc() [1/2]

template<class T>
void ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::Fc ( double _fc,
double _fs )
inlinevirtual

Set the cutoff frequency and sample rate.

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

Implements ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Filter< T >.

References Fc().

Referenced by BiQuad(), and Fc().

◆ Fc() [2/2]

template<class T>
void ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::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.

References a0, a1, a2, b0, b1, b2, and IGN_PI.

◆ Process()

template<class T>
virtual const T & ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::Process ( const T & _x)
inlinevirtual

Update the filter's output.

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

References a0, a1, a2, b1, b2, x1, x2, ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Filter< T >::y0, y1, and y2.

◆ Set()

template<class T>
virtual void ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::Set ( const T & _val)
inlinevirtual

Set the current filter's output.

Parameters
[in]_valNew filter's output.

Reimplemented from ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Filter< T >.

References x1, x2, ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Filter< T >::y0, y1, and y2.

Member Data Documentation

◆ a0

template<class T>
double ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::a0 = 0
protected

Input gain control coefficients.

Referenced by Fc(), and Process().

◆ a1

template<class T>
double ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::a1 = 0
protected

Referenced by Fc(), and Process().

◆ a2

template<class T>
double ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::a2 = 0
protected

Referenced by Fc(), and Process().

◆ b0

template<class T>
double ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::b0 = 0
protected

Referenced by Fc().

◆ b1

template<class T>
double ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::b1 = 0
protected

Referenced by Fc(), and Process().

◆ b2

template<class T>
double ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::b2 = 0
protected

Referenced by Fc(), and Process().

◆ x1

template<class T>
T ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::x1 {}
protected

Gain of the feedback coefficients.

Referenced by Process(), and Set().

◆ x2

template<class T>
T ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::x2 {}
protected

Referenced by Process(), and Set().

◆ y1

template<class T>
T ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::y1 {}
protected

Referenced by Process(), and Set().

◆ y2

template<class T>
T ignition::math::IGNITION_MATH_VERSION_NAMESPACE::BiQuad< T >::y2 {}
protected

Referenced by Process(), and Set().


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