filter_ema

First order IIR filter (exponential filter).

Namespace: dsp::filter

Prototype

sptr<FilterGen<T>> filter_ema(float γ)

Parameters

γForget factor.

Description

This filter, also called the "numerical RC filter", or "exponential filter", is one of the simplest filter, as it is completely speficied by only one coefficient.

It is defined by the following equation: \[ y_{n+1} = (1-\gamma) * y_n + \gamma * x_n = y_n + \gamma * (x_n - y_n) \]

The \(\gamma\) parameter (forget factor) can be tuned easily as a function of time constant or of the desired cut-off frequency (see iir1_coef()).

See also

ema_fcut(), ema_coef(), design_ema()