Plaquette
 
Loading...
Searching...
No Matches
pq::MovingAverage Class Reference

An exponential moving average class. More...

#include <MovingAverage.h>

Public Member Functions

 MovingAverage ()
 Default constructor (infinite time window).
 
void reset ()
 Resets the moving average.
 
void reset (float initialValue)
 Resets the moving average with initial value.
 
virtual float update (float v, float alpha)
 Updates the moving average with new value v# (also returns the current value).
 
virtual float amend (float previousValue, float newValue, float alpha)
 Amends the moving average latest update (needs to be called with same #alpha# parameter).
 
virtual float delta (float d)
 Applies a moving average step directly using a delta value.
 
float get ()
 Returns the value of the moving average. This is undefined if isValid() == false.
 
float constGet () const
 

Protected Attributes

float _value
 

Detailed Description

An exponential moving average class.


The documentation for this class was generated from the following files: