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