calculates the moving average over a continues input of samples.
More...
#include <MovingAverage.hpp>
calculates the moving average over a continues input of samples.
A circular buffer is maintained so that the last N samples can be inspected. the sum of values in this buffer is also maintained such that the average can be efficiently calculated.
◆ MovingAverage()
constructor creates a MovingAverage filter over a window of N samples.
- Parameters
-
N | [in] the size of the window of samples |
◆ addSample()
void addSample |
( |
double |
sample | ) |
|
|
inline |
◆ getAverage()
returns the current average
- Returns
The documentation for this class was generated from the following file:
- src/rwlibs/algorithms/MovingAverage.hpp