IIR and FIR.
More...
#include <filters.h>
|
| Filter (const yarp::sig::Vector &num, const yarp::sig::Vector &den, const yarp::sig::Vector &y0=yarp::sig::Vector(1, 0.0)) |
| Creates a filter with specified numerator and denominator coefficients.
|
|
virtual void | init (const yarp::sig::Vector &y0) |
| Internal state reset.
|
|
virtual void | init (const yarp::sig::Vector &y0, const yarp::sig::Vector &u0) |
| Internal state reset for filter with zero gain.
|
|
void | getCoeffs (yarp::sig::Vector &num, yarp::sig::Vector &den) |
| Returns the current filter coefficients.
|
|
void | setCoeffs (const yarp::sig::Vector &num, const yarp::sig::Vector &den) |
| Sets new filter coefficients.
|
|
bool | adjustCoeffs (const yarp::sig::Vector &num, const yarp::sig::Vector &den) |
| Modifies the values of existing filter coefficients without varying their lengths.
|
|
void | getStates (std::deque< yarp::sig::Vector > &u, std::deque< yarp::sig::Vector > &y) |
| Returns the current filter states.
|
|
virtual const yarp::sig::Vector & | filt (const yarp::sig::Vector &u) |
| Performs filtering on the actual input.
|
|
virtual const yarp::sig::Vector & | output () const |
| Return current filter output.
|
|
virtual | ~IFilter () |
| Destructor.
|
|
|
yarp::sig::Vector | b |
|
yarp::sig::Vector | a |
|
yarp::sig::Vector | y |
|
std::deque< yarp::sig::Vector > | uold |
|
std::deque< yarp::sig::Vector > | yold |
|
size_t | n |
|
size_t | m |
|
IIR and FIR.
Definition at line 76 of file filters.h.
◆ Filter()
Filter::Filter |
( |
const yarp::sig::Vector & |
num, |
|
|
const yarp::sig::Vector & |
den, |
|
|
const yarp::sig::Vector & |
y0 = yarp::sig::Vector(1,0.0) |
|
) |
| |
Creates a filter with specified numerator and denominator coefficients.
- Parameters
-
num | vector of numerator elements given as increasing power of z^-1. |
den | vector of denominator elements given as increasing power of z^-1. |
y0 | initial output. |
- Note
- den[0] shall not be 0.
Definition at line 26 of file filters.cpp.
◆ adjustCoeffs()
bool Filter::adjustCoeffs |
( |
const yarp::sig::Vector & |
num, |
|
|
const yarp::sig::Vector & |
den |
|
) |
| |
Modifies the values of existing filter coefficients without varying their lengths.
- Parameters
-
num | vector of numerator elements given as increasing power of z^-1. |
den | vector of denominator elements given as increasing power of z^-1. |
- Returns
- true/false on success/fail.
- Note
- den[0] shall not be 0.
-
the adjustment is carried out iff num.size() and den.size() match the existing numerator and denominator lengths.
Definition at line 118 of file filters.cpp.
◆ filt()
const Vector & Filter::filt |
( |
const yarp::sig::Vector & |
u | ) |
|
|
virtual |
Performs filtering on the actual input.
- Parameters
-
u | reference to the actual input. |
- Returns
- the corresponding output.
Implements iCub::ctrl::IFilter.
Definition at line 140 of file filters.cpp.
◆ getCoeffs()
void Filter::getCoeffs |
( |
yarp::sig::Vector & |
num, |
|
|
yarp::sig::Vector & |
den |
|
) |
| |
Returns the current filter coefficients.
- Parameters
-
num | vector of numerator elements returned as increasing power of z^-1. |
den | vector of denominator elements returned as increasing power of z^-1. |
Definition at line 91 of file filters.cpp.
◆ getStates()
void Filter::getStates |
( |
std::deque< yarp::sig::Vector > & |
u, |
|
|
std::deque< yarp::sig::Vector > & |
y |
|
) |
| |
Returns the current filter states.
- Parameters
-
u | the current input states. |
y | the current output states. |
Definition at line 132 of file filters.cpp.
◆ init() [1/2]
virtual void iCub::ctrl::Filter::init |
( |
const yarp::sig::Vector & |
y0 | ) |
|
|
virtual |
◆ init() [2/2]
virtual void iCub::ctrl::Filter::init |
( |
const yarp::sig::Vector & |
y0, |
|
|
const yarp::sig::Vector & |
u0 |
|
) |
| |
|
virtual |
Internal state reset for filter with zero gain.
- Parameters
-
y0 | new internal state. |
u0 | expected next input. |
- Note
- The gain of a digital filter is the sum of the coefficients of its numerator divided by the sum of the coefficients of its denumerator.
◆ output()
virtual const yarp::sig::Vector & iCub::ctrl::Filter::output |
( |
| ) |
const |
|
inlinevirtual |
◆ setCoeffs()
void Filter::setCoeffs |
( |
const yarp::sig::Vector & |
num, |
|
|
const yarp::sig::Vector & |
den |
|
) |
| |
Sets new filter coefficients.
- Parameters
-
num | vector of numerator elements given as increasing power of z^-1. |
den | vector of denominator elements given as increasing power of z^-1. |
- Note
- den[0] shall not be 0.
-
the internal state is reinitialized to the current output.
Definition at line 99 of file filters.cpp.
yarp::sig::Vector iCub::ctrl::Filter::a |
|
protected |
yarp::sig::Vector iCub::ctrl::Filter::b |
|
protected |
size_t iCub::ctrl::Filter::m |
|
protected |
size_t iCub::ctrl::Filter::n |
|
protected |
◆ uold
std::deque<yarp::sig::Vector> iCub::ctrl::Filter::uold |
|
protected |
yarp::sig::Vector iCub::ctrl::Filter::y |
|
protected |
◆ yold
std::deque<yarp::sig::Vector> iCub::ctrl::Filter::yold |
|
protected |
The documentation for this class was generated from the following files:
- icub-main/src/libraries/ctrlLib/include/iCub/ctrl/filters.h
- icub-main/src/libraries/ctrlLib/src/filters.cpp