In my articles on filter design I mostly focus on a rather specific subset of all possible filters, namely *symmetrical FIR filters with an odd number of coefficients*. Each of these properties (1. FIR, 2. symmetrical, and 3. an odd number of coefficients) was chosen for the purpose of making the filters easier to work with. The three properties each have clear advantages, as described below.

## FIR

*Finite Impulse Response* (*FIR*) filters are inherently stable, in the sense that they guarantee *BIBO stability*, where BIBO stands for *bounded-input, bounded-output*. Mathematically, BIBO stability is defined as follows. A signal \(x[n]\) is bounded if there exists a real number \(b\in\mathbb{R}\) so that \(|x[n]|\leq b\) for all \(n\in\mathbb{Z}\). A filter is BIBO stable if every bounded input signal results in a bounded output signal. In other words, **you don’t need to worry about the ouput of your filter “blowing up” if the input is okay**.

## Symmetrical FIR

*Symmetrical* FIR filters are *linear phase*. This means that **all frequencies in the input signal are delayed in the same way**, because the filter does not introduce phase distortion (also see The Phase Response of a Filter). For example, if you use a FIR filter to change some characteristic of an audio signal, it will not also introduce a delay in some of the frequencies. Of course, this also implies that you cannot use symmetrical FIR filters to correct or pre-compensate frequency delay…

A major effect of nonlinear phase delay is that rising and falling edges are affected differently. This is illustrated in Figure 1. The plot on the left shows a (slightly noisy) block pulse filtered with a low-pass moving-average filter, with the original signal in blue and the filtered signal in red. The effect of the filter on the rising and falling edges is exactly symmetrical. The plot on the right shows the same block pulse filtered with a low-pass single-pole IIR filter. The effect on both edges is quite different. Hence, for applications where the edges in the signal are important, this filter is often unsuitable.

## Symmetrical FIR with an Odd Number of Coefficients

A symmetrical FIR filter with an odd number of coefficients has a delay of an *integer* number of samples. This might be a minor advantage in most cases, but it does let you **compare the original signal with the filtered one simply by shifting samples**. Figure 2 shows the signal of Figure 1, with the moving-average-filtered signal shifted over 5 samples. The length of the filter is 11 samples, so that its delay is exactly 5 samples, according to the formula

\[d=\frac{N-1}{2},\]

with \(d\) the delay and \(N\) the length of the filter.

The conclusion is that, if your application allows it, you should strongly consider going for a symmetrical FIR filter with an odd number of coefficients.

## Add new comment