FilterRunningAverage provides an weighted running average filter More...
#include <Filter.h>
Public Member Functions | |
FilterRunningAverage (double _alpha=0.5) | |
double | getAlpha () |
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 | setAlpha (double _alpha) |
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 Attributes | |
double | alpha |
bool | breset |
Protected Attributes inherited from alvar::Filter | |
double | value |
FilterRunningAverage provides an weighted running average filter
The FilterRunningAverage calculates a simple running average using the weight value alpha.
If alpha is larger (near 1.0) the average reacts faster for changes and if it is near 0.0 then it reacts slowly. The weight value alpha may be set in the constructor or with setAlpha() .
|
inline |
|
virtual |
Update the value. All inherited classes need to update value in next().
Implements alvar::Filter.
Reimplemented in alvar::FilterDoubleExponentialSmoothing.
Definition at line 87 of file Filter.cpp.
|
inline |
|
virtual |
|
inline |