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

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

#include <filters.h>

+ Inheritance diagram for iCub::ctrl::FirstOrderLowPassFilter:

Public Member Functions

 FirstOrderLowPassFilter (const double cutFrequency, const double sampleTime, const yarp::sig::Vector &y0=yarp::sig::Vector(1, 0.0))
 Creates a filter with specified parameters. More...
 
virtual ~FirstOrderLowPassFilter ()
 Destructor. More...
 
virtual void init (const yarp::sig::Vector &y0)
 Internal state reset. More...
 
bool setCutFrequency (const double cutFrequency)
 Change the cut frequency of the filter. More...
 
bool setSampleTime (const double sampleTime)
 Change the sample time of the filter. More...
 
double getCutFrequency ()
 Retrieve the cut frequency of the filter. More...
 
double getSampleTime ()
 Retrieve the sample time of the filter. More...
 
virtual const yarp::sig::Vector & filt (const yarp::sig::Vector &u)
 Performs filtering on the actual input. More...
 
virtual const yarp::sig::Vector & output () const
 Return current filter output. More...
 
- Public Member Functions inherited from iCub::ctrl::IFilter
virtual ~IFilter ()
 Destructor. More...
 

Protected Member Functions

void computeCoeff ()
 

Protected Attributes

Filterfilter
 
double fc
 
double Ts
 
yarp::sig::Vector y
 

Detailed Description

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

Definition at line 243 of file filters.h.

Constructor & Destructor Documentation

◆ FirstOrderLowPassFilter()

FirstOrderLowPassFilter::FirstOrderLowPassFilter ( const double  cutFrequency,
const double  sampleTime,
const yarp::sig::Vector &  y0 = yarp::sig::Vector(1,0.0) 
)

Creates a filter with specified parameters.

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

Definition at line 218 of file filters.cpp.

◆ ~FirstOrderLowPassFilter()

FirstOrderLowPassFilter::~FirstOrderLowPassFilter ( )
virtual

Destructor.

Definition at line 231 of file filters.cpp.

Member Function Documentation

◆ computeCoeff()

void FirstOrderLowPassFilter::computeCoeff ( )
protected

Definition at line 282 of file filters.cpp.

◆ filt()

const Vector & FirstOrderLowPassFilter::filt ( const yarp::sig::Vector &  u)
virtual

Performs filtering on the actual input.

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

Implements iCub::ctrl::IFilter.

Definition at line 272 of file filters.cpp.

◆ getCutFrequency()

double iCub::ctrl::FirstOrderLowPassFilter::getCutFrequency ( )
inline

Retrieve the cut frequency of the filter.

Returns
the cut frequency (Hz).

Definition at line 290 of file filters.h.

◆ getSampleTime()

double iCub::ctrl::FirstOrderLowPassFilter::getSampleTime ( )
inline

Retrieve the sample time of the filter.

Returns
the sample time (s).

Definition at line 296 of file filters.h.

◆ init()

void FirstOrderLowPassFilter::init ( const yarp::sig::Vector &  y0)
virtual

Internal state reset.

Parameters
y0new internal state.

Implements iCub::ctrl::IFilter.

Definition at line 238 of file filters.cpp.

◆ output()

virtual const yarp::sig::Vector& iCub::ctrl::FirstOrderLowPassFilter::output ( ) const
inlinevirtual

Return current filter output.

Returns
the filter output.

Implements iCub::ctrl::IFilter.

Definition at line 309 of file filters.h.

◆ setCutFrequency()

bool FirstOrderLowPassFilter::setCutFrequency ( const double  cutFrequency)

Change the cut frequency of the filter.

Parameters
cutFrequencythe new cut frequency (Hz).

Definition at line 246 of file filters.cpp.

◆ setSampleTime()

bool FirstOrderLowPassFilter::setSampleTime ( const double  sampleTime)

Change the sample time of the filter.

Parameters
sampleTimethe new sample time (s).

Definition at line 259 of file filters.cpp.

Member Data Documentation

◆ fc

double iCub::ctrl::FirstOrderLowPassFilter::fc
protected

Definition at line 247 of file filters.h.

◆ filter

Filter* iCub::ctrl::FirstOrderLowPassFilter::filter
protected

Definition at line 246 of file filters.h.

◆ Ts

double iCub::ctrl::FirstOrderLowPassFilter::Ts
protected

Definition at line 248 of file filters.h.

◆ y

yarp::sig::Vector iCub::ctrl::FirstOrderLowPassFilter::y
protected

Definition at line 249 of file filters.h.


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