FilterAverage provides an average filter More...
#include <Filter.h>
Public Member Functions | |
double | deviation () const |
FilterAverage (int size=3) | |
int | getCurrentSize () |
int | getWindowSize () |
virtual double | next (double y) |
Update the value. All inherited classes need to update value in next(). More... | |
double | operator= (double _value) |
virtual void | reset () |
Reset the filter state. More... | |
void | setWindowSize (int size) |
Public Member Functions inherited from alvar::Filter | |
Filter () | |
Constructor. More... | |
double | get () const |
Get the latest value. More... | |
operator double () | |
Get the latest value. More... | |
Protected Member Functions | |
void | push_to_buffer (double y) |
Protected Attributes | |
std::deque< double > | buffer |
unsigned int | count |
unsigned int | window_size |
Protected Attributes inherited from alvar::Filter | |
double | value |
FilterAverage provides an average filter
The FilterAverage remembers window_size last elements in the time series and returns always the average of these elements. The size of the window window_size can be set in the constructor or with setWindowSize() .
Note, that when the window_size is <= 0 we calculate the average over the whole sequence without using the buffer.
double alvar::FilterAverage::deviation | ( | ) | const |
Definition at line 67 of file Filter.cpp.
|
virtual |
Update the value. All inherited classes need to update value in next().
Implements alvar::Filter.
Reimplemented in alvar::FilterMedian.
Definition at line 48 of file Filter.cpp.
|
inline |
|
protected |
Definition at line 41 of file Filter.cpp.
|
virtual |
|
inline |