Exponential moving average of a discrete-time input signal.
More...
#include <GREM/core/statistics.hpp>
|
| constexpr | ExponentialMovingAverage ()=default |
| | Default-construct an exponential moving average.
|
| constexpr | ExponentialMovingAverage (T value) |
| | Construct an exponential moving average with a specific initial value.
|
| constexpr void | reset (T newValue={}) |
| | Reset the exponential moving average to a specific value.
|
| template<typename Coefficient> |
| constexpr T | update (T newSignalValue, Coefficient alpha) |
| | Update the exponential moving average given the next discrete input signal sample value.
|
| constexpr T | get () const |
| | Get the current exponential moving average value.
|
template<typename T>
class grem::ExponentialMovingAverage< T >
Exponential moving average of a discrete-time input signal.
- Template Parameters
-
| T | signal value type. Must be a type that behaves like a number. |
◆ ExponentialMovingAverage() [1/2]
Default-construct an exponential moving average.
◆ ExponentialMovingAverage() [2/2]
Construct an exponential moving average with a specific initial value.
- Parameters
-
| value | initial value to set the exponential moving average to. |
◆ reset()
Reset the exponential moving average to a specific value.
- Parameters
-
| newValue | new value to set the exponential moving average to. |
◆ update()
template<typename T>
template<typename Coefficient>
Update the exponential moving average given the next discrete input signal sample value.
- Parameters
-
| newSignalValue | new sample value of the input signal. |
| alpha | amount of the new value that is contributed to the average. Must be between 0 and 1 (inclusive). |
- Returns
- the new exponential moving average of the input signal.
◆ get()
Get the current exponential moving average value.
- Returns
- the current exponential moving average of the input signal.
The documentation for this class was generated from the following file: