## Sunday, November 9, 2014

### Linear phase FIR filters: 4 types

This post is about the 4 types of linear phase finite impulse response (FIR) filters. The possibility to have a causal filter with an exactly linear phase response can be an advantage of FIR filters over infinite impulse response (IIR) filters for certain applications.
1. Type I: symmetrical impulse response, odd length
2. Type II: symmetrical impulse response, even length
3. Type III: asymmetrical impulse response, odd length
4. Type IV: asymmetrical impulse response, even length
When choosing one of these 4 types of linear phase filters there are mainly 3 things to consider:
1. constraints on the zeros of the transfer function $H(z)$ at $z=1$ (DC) and $z=-1$ (Nyquist)
2.  integer/non-integer group delay
3.  phase shift (apart from the linear phase)
For type I filters (odd number of taps, even symmetry) there are no constraints on the zeros at $z=1$ and $z=-1$, the phase shift is zero (apart from the linear phase), and the group delay is an integer value.

Type II filters (even number of taps, even symmetry) always have a zero at $z=-1$ (i.e., half the sampling frequency), they have a zero phase shift, and they have a non-integer group delay.

Type III filters (odd number of taps, odd symmetry) always have zeros at $z=1$ and $z=-1$ (i.e. at $f=0$ and $f=f_s/2$), they have a 90 degrees phase shift, and an integer group delay.

Type IV filters (even number of taps, odd symmetry) always have a zero at $z=1$, a phase shift of 90 degrees, and a non-integer group delay.

This implies (among other things) the following:
• Type I filters are pretty universal, but they cannot be used whenever a 90 degrees phase shift is necessary, e.g. for differentiators or Hilbert transformers.
• Type II filters would normally not be used for high pass or band stop filters, due to the zero at $z=-1$, i.e. at $f=f_s/2$. Neither can they be used for applications where a 90 degrees phase shift is necessary.
• Type III filters cannot be used for standard frequency selective filters because in these cases the 90 degrees phase shift is usually undesirable. For Hilbert transformers, type III filters have a relatively bad magnitude approximation at very low and very high frequencies due to the zeros at $z=1$ and $z=-1$. On the other hand, a type III Hilbert transformer can be implemented more efficiently than a type IV Hilbert transformer because in this case every other tap is zero.
• Type IV filters cannot be used for standard frequency selective filters, for the same reasons as type III filters. They are well suited for differentiators and Hilbert transformers, and their magnitude approximation is usually better because, unlike type III filters, they have no zero at $z=-1$.
• In some applications an integer group delay is desirable. In these cases type I or type III filters are preferred.