#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/)
Public Member Functions | |
EMA_f (float pole) | |
Create an exponential moving average filter with a pole at the given location. | |
float | filter (float value) |
Filter the input: Given \( x[n] \), calculate \( y[n] \). | |
float | operator() (float value) |
Filter the input: Given \( x[n] \), calculate \( y[n] \). | |
Private Attributes | |
float | alpha |
float | filtered = 0 |