#include <AH/Filters/EMA.hpp>
A class for single-pole infinite impulse response filters or exponential moving average filters.
This version uses floating point maths.
Difference equation: \( y[n] = \alpha·x[n]+(1-\alpha)·y[n-1] \) \( x \) is the input sequence, and \( y \) is the output sequence.
[An in-depth explanation of the EMA filter] (https://tttapa.github.io/Pages/Mathematics/Systems-and-Control-Theory/Digital-filters/Exponential%20Moving%20Average/)
Definition at line 152 of file EMA.hpp.
|
| EMA_f (float pole) |
| Create an exponential moving average filter with a pole at the given location. More...
|
|
float | filter (float value) |
| Filter the input: Given \( x[n] \), calculate \( y[n] \). More...
|
|
float | operator() (float value) |
| Filter the input: Given \( x[n] \), calculate \( y[n] \). More...
|
|
◆ EMA_f()
Create an exponential moving average filter with a pole at the given location.
- Parameters
-
pole | The pole of the filter ( \(1-\alpha\)).
Should be a value in the range \( \left[0,1\right) \).
Zero means no filtering, and closer to one means more filtering. |
Definition at line 164 of file EMA.hpp.
◆ filter()
float filter |
( |
float |
value | ) |
|
|
inline |
Filter the input: Given \( x[n] \), calculate \( y[n] \).
- Parameters
-
value | The new raw input value. |
- Returns
- The new filtered output value.
Definition at line 173 of file EMA.hpp.
◆ operator()()
float operator() |
( |
float |
value | ) |
|
|
inline |
Filter the input: Given \( x[n] \), calculate \( y[n] \).
- Parameters
-
value | The new raw input value. |
- Returns
- The new filtered output value.
Definition at line 179 of file EMA.hpp.
◆ alpha
◆ filtered
The documentation for this class was generated from the following file: