Why IIR Filters?
Now I am going to switch gears from FIRs to their poorer and much less famous cousins, IIR filters. Recursive or Infinite Impulse Response filters tend to have a very bad reputation and are rarely used compared with Non-Recursive, Finite Impulse Response ones. The list of the drawbacks of IIRs is quite long, here are just a few of them:
1. FIRs are simpler and easier to work with. The Dirac impulse response of an FIR is simply the set of coefficients, if you zero pad this to whatever size you want and take the Discrete Fourier Transform you get the filter transfer function. This means that the link between filter coefficients and the transfer function (the filter analysis problem) is very straightforward. The inverse filter synthesis problem, finding the coefficients given a desired transfer function, is not as simple and there are no explicit formulas to do that but there are well known iterative algorithms that can be used, like Parks-McClellan for example. IIRs are not that easy, in particular there is no simple and direct link between the filter coefficients and the impulse response, which by the way, is infinite and the DFT does not work with infinite size data. Both analysis and synthesis tasks are more complicated for IIRs when compared with FIRs. One needs to do real work when designing IIRs and then making sure they perform as expected, FIRs are for lazy designers.
2. IIRs can never exhibit linear phase. Linear phase, or equivalently constant group delay, is a very desirable feature that many filter applications (but not all) require. FIRs achieve this automatically as long as the coefficients are symmetric or anti-symmetric. IIRs will never have linear phase.
3. IIRs can be unstable and oscillate or have output values that grow to infinity, even with all zero input samples. They can also have sensitivity problems - even if the filter designed using real numbers is stable, when the coefficients are quantized the final transfer function will be different and in some extreme cases even lead to an unstable filter. FIRs are inherently stable, they too can have coefficient quantization sensitivity issues but an FIR will never be unstable or oscillate - if the input samples are zero the filter output will become zero after a finite number of clocks.
4. Because of their infinite impulse response nature, an exact IIR implementation in the strictest mathematical sense is not even physically realizable. A stable IIR filter's impulse response will decay exponentially but will never reach zero. No matter how samples are represented, fixed point or floating point, even double precision floating point, sooner rather than later the output sample values will become smaller than the smallest representable number. At that point two things can happen, either the output becomes zero and stays like that (and then it is no longer and IIR but and FIR!) or the output will get stuck in a repeating sequence of very small values, called a limit cycle (and then the filter is no longer linear and timing invariant). FIRs do not exhibit this kind of behavior.
5. IIRs have very tight feedback loops, which makes pipelining virtually impossible. FIRs have no feedback loops at all and pipelining them is trivial. For this reason, FIRs will always achieve faster sample rates than similar IIR implementations.
So why would anybody even bother with IIR filters at all? They have only one redeeming quality, if you do not mind all the issues mentioned above, especially the non-linear phase aspect - an IIR with a similar frequency transfer function to an FIR filter will have a much less computational load, in terms of number of multiplications per output sample, typically 5x to 20x smaller. This is not insignificant.
The rest of the following blog posts will discuss how to mitigate all the limitations mentioned above while taking advantage of the only IIR good feature, the much smaller size. I will talk about unconditionally stable IIR architectures with good sensitivity characteristics, that are a good match for the FPGA DSP primitives and can even be pipelined in a certain fashion and run as fast as FIR implementations. In particular, I will present three different ways to achieve linear phase using IIR filters.
Back to the top: The Art of FPGA Design Season 2