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

Median Filter. More...

#include <filters.h>

+ Inheritance diagram for iCub::ctrl::MedianFilter:

Public Member Functions

 MedianFilter (const size_t n, const yarp::sig::Vector &y0=yarp::sig::Vector(1, 0.0))
 Creates a median filter of the specified order. More...
 
virtual void init (const yarp::sig::Vector &y0)
 Internal state reset. More...
 
void setOrder (const size_t n)
 Sets new filter order. More...
 
size_t getOrder () const
 Returns the current filter order. 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

double median (std::deque< double > &v)
 

Protected Attributes

std::deque< std::deque< double > > uold
 
yarp::sig::Vector y
 
size_t n
 
size_t m
 

Detailed Description

Median Filter.

Definition at line 318 of file filters.h.

Constructor & Destructor Documentation

◆ MedianFilter()

MedianFilter::MedianFilter ( const size_t  n,
const yarp::sig::Vector &  y0 = yarp::sig::Vector(1,0.0) 
)

Creates a median filter of the specified order.

Parameters
nthe filter order.
y0initial output.

Definition at line 296 of file filters.cpp.

Member Function Documentation

◆ filt()

const Vector & MedianFilter::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 338 of file filters.cpp.

◆ getOrder()

size_t iCub::ctrl::MedianFilter::getOrder ( ) const
inline

Returns the current filter order.

Definition at line 352 of file filters.h.

◆ init()

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

Internal state reset.

Parameters
y0new internal state.

Implements iCub::ctrl::IFilter.

Definition at line 304 of file filters.cpp.

◆ median()

double MedianFilter::median ( std::deque< double > &  v)
protected

Definition at line 323 of file filters.cpp.

◆ output()

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

Return current filter output.

Returns
the filter output.

Implements iCub::ctrl::IFilter.

Definition at line 365 of file filters.h.

◆ setOrder()

void MedianFilter::setOrder ( const size_t  n)

Sets new filter order.

Parameters
nnew filter order.
Note
the internal memory is reset.

Definition at line 315 of file filters.cpp.

Member Data Documentation

◆ m

size_t iCub::ctrl::MedianFilter::m
protected

Definition at line 324 of file filters.h.

◆ n

size_t iCub::ctrl::MedianFilter::n
protected

Definition at line 323 of file filters.h.

◆ uold

std::deque<std::deque<double> > iCub::ctrl::MedianFilter::uold
protected

Definition at line 321 of file filters.h.

◆ y

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

Definition at line 322 of file filters.h.


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