Exponential filters

The output \(y[n]\) of exponential filters is characterised by an exponential decay of the output if the new inputs \(x[n]\) are set to \(0\). These filters are IIR filters with order 1.

\[y\left[n\right] = p \cdot x[n] + \left( 1 - p \right) \cdot y[n-1]\]

The value of \(p\) must be in the range \(p \in \left[0, 1\right]\) for a stable filter.

Lowpass

For example, here is an IIR exponential low pass:

Filter response

Please enable javascript to see the graphs!
Drawing on a canvas is not supported by your browser!
Drawing on a canvas is not supported by your browser!
Drawing on a canvas is not supported by your browser!
Drawing on a canvas is not supported by your browser!

Code snippets

Here are snippets to create this filter:

Please enable javascript to see the generated code!

Any IIR filter can also be approximated as finite impulse response filter. The conversion can always be done with these steps:

You may have to expirement a bit to find the correct window size for your needs. Smaller window sizes will distort the response of the filter, but reduce the complexity (or computation time). When you design your filter, you must take that into consideration to get a filter that works for your needs. In this case, a window size of 32 was chosen.

Filter response

Please enable javascript to see the graphs!
Drawing on a canvas is not supported by your browser!
Drawing on a canvas is not supported by your browser!
Drawing on a canvas is not supported by your browser!
Drawing on a canvas is not supported by your browser!

Code snippets

Here are snippets to create this filter:

Please enable javascript to see the generated code!