FilterDoubleExponentialSmoothing provides an weighted running average filter More...
#include <Filter.h>
Public Member Functions | |
FilterDoubleExponentialSmoothing (double _alpha=0.5, double _gamma=1.0) | |
double | getGamma () |
virtual double | next (double y) |
Update the value. All inherited classes need to update value in next(). More... | |
double | operator= (double _value) |
void | setGamma (double _gamma) |
Public Member Functions inherited from alvar::FilterRunningAverage | |
FilterRunningAverage (double _alpha=0.5) | |
double | getAlpha () |
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 | gamma |
double | slope |
Protected Attributes inherited from alvar::FilterRunningAverage | |
double | alpha |
bool | breset |
Protected Attributes inherited from alvar::Filter | |
double | value |
FilterDoubleExponentialSmoothing provides an weighted running average filter
The FilterDoubleExponentialSmoothing calculates a simple running average for both the average and slope using the weight values alpha and gamma.
If the weight values (alpha , gamma) are larger (near 1.0) the formulas react faster for changes and if they are near 0.0 then the reaction is slower. The weight values alpha and gamma may be set in the constructor or with setAlpha() and setGamma() .
|
inline |
|
inline |
|
virtual |
Update the value. All inherited classes need to update value in next().
Reimplemented from alvar::FilterRunningAverage.
Definition at line 99 of file Filter.cpp.
|
inline |
|
inline |
|
protected |
|
protected |