![]() |
My Project
|
FilterDoubleExponentialSmoothing provides an weighted running average filter More...
#include <Filter.h>
Public Member Functions | |
FilterDoubleExponentialSmoothing (double _alpha=0.5, double _gamma=1.0) | |
void | setGamma (double _gamma) |
double | getGamma () |
double | operator= (double _value) |
virtual double | next (double y) |
Update the value. All inherited classes need to update value in next(). | |
![]() | |
FilterRunningAverage (double _alpha=0.5) | |
void | setAlpha (double _alpha) |
double | getAlpha () |
double | operator= (double _value) |
virtual void | reset () |
Reset the filter state. | |
![]() | |
Filter () | |
Constructor. | |
double | get () const |
Get the latest value. | |
operator double () | |
Get the latest value. | |
Protected Attributes | |
double | gamma |
double | slope |
![]() | |
double | alpha |
bool | breset |
![]() | |
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() .