Generate first order IIR filter forget factor (unique coefficient) from cut-off frequency.

Namespace: dsp::filter

Prototype

float ema_coef(Frequency fc)

Parameters

fcNormalized cut-off frequency, in [0, 0.5]

Returns

Coeficient \(\gamma\) for the IIR filter

Description

This function computes the forget factor for a first order IIR filter (that is, an exponential filter), as a function of the desired cut-off frequency.

\[ y_{n+1} = (1-\gamma) * y_n + \gamma * x_n = y_n + \gamma * (x_n - y_n) \]

\[ \gamma = 1 - e^{-2\pi f_c} \]

See also

design_iir1(), iir1_tc2coef()