![]() |
Open FFBoard
Open source force feedback firmware
|
#include <FastAvg.h>
Public Member Functions | |
| FastMovingAverage (int32_t len=0) | |
| ~FastMovingAverage () | |
| void | clear () |
| T | getAndReset () |
| T | getAverage () |
| T | addValue (T v) |
Private Attributes | |
| T | curAvg = 0 |
| const int32_t | fixedLen |
| int32_t | count = 0 |
Calculates a moving average of variable length Can periodically get and reset a value to average for an unknown amount of data points If len != 0 calculates an exponential moving average with length len. If len = 0 length equals the current amount of samples up to 0x7FFFFFFF.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
|
private |
|
private |