IIR Filter Block

IIR Filter Block

The Infinite Impulse Response Filter block emits a low pass filter of the input, analogous to a first-order RC filter. For more details on derivation, read up here.

This simple, efficient filter is generally good at removing noise from a sensor measurement, with only a single, intuitive parameter to tune.

The value of the filter at each step is the weighted sum of the current input value, and the previous output value:

\( \ f(x_i) = \alpha*x_i + (1 - \alpha) * f(x_{i-1}) \)

where

\( \ \alpha = \frac{dt}{RC +dt} \)

Parameters

  • Time Constant (default = 1.0): Time constant (RC) for the filter. Physically, the time constant represents the elapsed time required for the system response to decay to zero if the system had continued to decay at the initial rate (source).

Examples

IIR Filter Example