iCub-main
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
FirstOrderLowPassFilter Class Reference

First order low pass filter implementing the transfer function H(s) = {1}{1+ s}. More...

#include <pidfilter.h>

Public Member Functions

 FirstOrderLowPassFilter (const double cutFrequency, const double sampleTime, const double y0)
 Creates a filter with specified parameters. More...
 
void init (const double y0)
 Internal state reset. More...
 
double getCutFrequency ()
 Retrieve the cut frequency of the filter. More...
 
double getSampleTime ()
 Retrieve the sample time of the filter. More...
 
double filt (double u)
 Performs filtering on the actual input. More...
 
double output ()
 Return current filter output. More...
 

Protected Member Functions

void computeCoeff ()
 

Protected Attributes

double fc
 
double Ts
 
double y
 
double yold
 
double uold
 
double a1
 
double a2
 
double b1
 
double b2
 

Detailed Description

First order low pass filter implementing the transfer function H(s) = {1}{1+ s}.

Definition at line 117 of file pidfilter.h.

Constructor & Destructor Documentation

◆ FirstOrderLowPassFilter()

FirstOrderLowPassFilter::FirstOrderLowPassFilter ( const double  cutFrequency,
const double  sampleTime,
const double  y0 
)
inline

Creates a filter with specified parameters.

Parameters
cutFrequencycut frequency (Hz).
sampleTimesample time (s).
y0initial output.

Definition at line 143 of file pidfilter.h.

Member Function Documentation

◆ computeCoeff()

void FirstOrderLowPassFilter::computeCoeff ( )
inlineprotected

Definition at line 128 of file pidfilter.h.

◆ filt()

double FirstOrderLowPassFilter::filt ( double  u)
inline

Performs filtering on the actual input.

Parameters
ureference to the actual input.
Returns
the corresponding output.

Definition at line 178 of file pidfilter.h.

◆ getCutFrequency()

double FirstOrderLowPassFilter::getCutFrequency ( )
inline

Retrieve the cut frequency of the filter.

Returns
the cut frequency (Hz).

Definition at line 165 of file pidfilter.h.

◆ getSampleTime()

double FirstOrderLowPassFilter::getSampleTime ( )
inline

Retrieve the sample time of the filter.

Returns
the sample time (s).

Definition at line 171 of file pidfilter.h.

◆ init()

void FirstOrderLowPassFilter::init ( const double  y0)
inline

Internal state reset.

Parameters
y0new internal state.

Definition at line 154 of file pidfilter.h.

◆ output()

double FirstOrderLowPassFilter::output ( )
inline

Return current filter output.

Returns
the filter output.

Definition at line 190 of file pidfilter.h.

Member Data Documentation

◆ a1

double FirstOrderLowPassFilter::a1
protected

Definition at line 125 of file pidfilter.h.

◆ a2

double FirstOrderLowPassFilter::a2
protected

Definition at line 125 of file pidfilter.h.

◆ b1

double FirstOrderLowPassFilter::b1
protected

Definition at line 126 of file pidfilter.h.

◆ b2

double FirstOrderLowPassFilter::b2
protected

Definition at line 126 of file pidfilter.h.

◆ fc

double FirstOrderLowPassFilter::fc
protected

Definition at line 120 of file pidfilter.h.

◆ Ts

double FirstOrderLowPassFilter::Ts
protected

Definition at line 121 of file pidfilter.h.

◆ uold

double FirstOrderLowPassFilter::uold
protected

Definition at line 124 of file pidfilter.h.

◆ y

double FirstOrderLowPassFilter::y
protected

Definition at line 122 of file pidfilter.h.

◆ yold

double FirstOrderLowPassFilter::yold
protected

Definition at line 123 of file pidfilter.h.


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