Filter is pure virtual class describing the basic virtual interface for all filters More...
#include <Filter.h>
Public Member Functions | |
Filter () | |
Constructor. More... | |
double | get () const |
Get the latest value. More... | |
virtual double | next (double y)=0 |
Update the value. All inherited classes need to update value in next(). More... | |
operator double () | |
Get the latest value. More... | |
virtual void | reset ()=0 |
Reset the filter state. More... | |
Protected Attributes | |
double | value |
Filter is pure virtual class describing the basic virtual interface for all filters
Basic usage:
The Filter library provides also the assignment operators (operator=) to simplify the process where you want to replace existing double's in code with filtered values. For example if you want to filter the d over time in the following code...
...you can add filter just by replacing the double with the selected filter:
However, using the assignment operator for setting time series data is a little counter-intuitive, so please use next() instead when possible.
Filter::Filter | ( | ) |
Constructor.
Definition at line 37 of file Filter.cpp.
|
inline |
|
pure virtual |
Update the value. All inherited classes need to update value in next().
Implemented in alvar::FilterDoubleExponentialSmoothing, alvar::FilterRunningAverage, alvar::FilterMedian, and alvar::FilterAverage.
|
inline |
|
pure virtual |
Reset the filter state.
Implemented in alvar::FilterRunningAverage, and alvar::FilterAverage.