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

A one-pole DSP filter. More...

#include <ignition/math/Filter.hh>

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

Public Member Functions

 OnePole ()=default
 Constructor.
 
 OnePole (double _fc, double _fs)
 Constructor.
 
virtual void Fc (double _fc, double _fs)
 Set the cutoff frequency and sample rate.
 
const T & Process (const T &_x)
 Update the filter's output.
 
- Public Member Functions inherited from ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Filter< T >
virtual ~Filter ()
 Destructor.
 
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.
 
double b1 = 0
 Gain of the feedback.
 
- 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::OnePole< T >

A one-pole DSP filter.

See also
http://www.earlevel.com/main/2012/12/15/a-one-pole-filter/

Constructor & Destructor Documentation

◆ OnePole() [1/2]

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

Constructor.

◆ OnePole() [2/2]

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

Constructor.

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

References Fc().

Member Function Documentation

◆ Fc()

template<class T>
virtual void ignition::math::IGNITION_MATH_VERSION_NAMESPACE::OnePole< 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 a0, b1, and IGN_PI.

Referenced by OnePole().

◆ Process()

template<class T>
const T & ignition::math::IGNITION_MATH_VERSION_NAMESPACE::OnePole< T >::Process ( const T & _x)
inline

Update the filter's output.

\paran[in] _x Input value.

Returns
The filter's current output.

References a0, b1, and ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Filter< T >::y0.

Member Data Documentation

◆ a0

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

Input gain control.

Referenced by Fc(), and Process().

◆ b1

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

Gain of the feedback.

Referenced by Fc(), and Process().


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