# How to design IIR digital filters?

Practical infinite impulse response (IIR) filters are usually based upon analogue equivalents (Butterworth, Chebyshev, etc.) using a transformation known as the bilinear transform which maps the $$s$$-plane poles and zeros of the analogue filter into the $$z$$-plane. However, it is quite possible to design an IIR filter without any reference to analogue designs, for example, by choosing appropriate locations for the poles and zeroes. Can somebody please explain the latter design of digital IIR filters (i.e., without any reference to analogue design) for the following simple example?

For a digital system with sampling frequency of 60 MHz, design a digital IIR filter with two complex conjugate poles at 23 MHz, and one zero at 18 MHz.

This is basically an equalizer for a lossy channel. The filter is flat at lower frequencies (DC attenuation), with a peaking at higher frequency and then drops rapidly. For that, only knowing the poles and zero locations should be enough which defines the DC attenuation, bandwidth, and boost (peaking) of the filter. The amount of boost or DC attenuation does not matter as they can be tweaked by changing the poles and zeros locations. So I don't think any further information is required here. But if so, simply make an assumption.

• The example you give at the bottom of your question seems (to me) to be very easily answerable: no reference to analog filters required. But the usual way to design a filter is to be given passband, stopband, and transition region specs rather than specifying the pole and zero locations. I've closed the question as duplicate. Have a read through Matt L's good answer to that one. If you think you're asking a different question, ping me here in the comments and I'll reopen.
– Peter K.
Commented Jan 21, 2021 at 20:58
• I read Matt's answer which you referred. I don't think it was the answer to my question, he mainly explained basics about FIR filter design and also IIR using bi-linear transformation. Commented Jan 22, 2021 at 15:39
• OK! I'm still of the opinion that designing the filter you're asking about is pretty straightforward. The only design parameter is the radius of the pole and zero positions (whether they're on the unit circle or elsewhere). Can you please extend or change your question a bit?
– Peter K.
Commented Jan 22, 2021 at 15:55
• Well, I'm not sure what extra information is required. It's a second-order filter, with two complex conjugate poles sitting 23 MHz and one zero sitting at 16 MHz. So any kind of digital filter (given by its numerator and denominator) that its transfer function follows the zero and poles locations that I mentioned here is acceptable. Not sure what's the missing data, but if any please feel free to make an assumption that makes sense. Commented Jan 22, 2021 at 16:08
• As I said in my first comment: But the usual way to design a filter is to be given passband, stopband, and transition region specs rather than specifying the pole and zero locations.. So, either give the filter specs in those terms or give more detail about otherwise how to choose the radius of the pole / zero locations. As it is, there is no way to choose the "right" filter.
– Peter K.
Commented Jan 22, 2021 at 16:18

An approach to design IIR filters without mapping from classical analog designs is the least squares method where the poles and zeros are selected within a constraint of filter order and targets for the magnitude and phase of the frequency response. This can result in non-causal solutions, so some experience is necessary to do this properly. MattL who frequently posts here has provided an excellent example of this in DSP.SE #15007 and for the narrower case of all pass filters with more detail as to the algorithm at his blog post.

Similar to this is Greg Berchin's FDLS Algorthm.

To design a filter directly in the discrete time domain (z transform) from a specification of the poles and zeroes is simple (incidentally, you have no choice but to get an IIR filter since the filter has poles). It works by leveraging that to obtain the frequency response of a filter in the discrete time domain, the following substitution is made: $$z=e^{i\omega T}$$ Where $$\omega$$ is the frequency of interest [rad/s] and $$T$$ is the sample interval [s]. Rearranging gives: $$1-e^{i\omega T}z^{-1}=0$$ Therefore, you can immediately write a 60 MHz sampled filter with two poles at 23 MHz and one zero at 18 MHz: $$\frac{(1-e^{i2\pi\frac{18}{60}}z^{-1})}{(1-e^{i2\pi\frac{23}{60}}z^{-1})^2}$$ However, clearly this filter has complex coefficients, except for any poles and zeroes that were to occur at 0 rad/s or the Nyquist frequency, none of which do. This is easily addressed by placing corresponding poles and zeroes at negative frequencies, which makes all filter coefficients real as shown below: $$\frac{(1-e^{i2\pi\frac{18}{60}}z^{-1})(1-e^{-i2\pi\frac{18}{60}}z^{-1})}{(1-e^{i2\pi\frac{23}{60}}z^{-1})^2(1-e^{-i2\pi\frac{23}{60}}z^{-1})^2}=\frac{1-2\cos\left[2\pi\frac{18}{60}\right]z^{-1}+z^{-2}}{\left(1-2\cos\left[2\pi\frac{23}{60}\right]z^{-1}+z^{-2}\right)^2}$$ This is why you'll find discrete time filter poles and zeroes always come in positive and negative frequency pairs like this, except those at 0 rad/s or the Nyquist frequency, unless you want the filter output to be complex.

• To make it explicit that it is purely a z-plane design method from specification of poles and zeroes alone, I have removed any mention of the matched z-transform method. Commented May 22 at 21:00

Despite previous commenters decrying the design method, I found an interesting online tool at https://www.micromodeler.com which satisfies the questioner's requirement of manual placement of poles & zeros.

This is achieved by drag & drop of the represented poles & zeros on the Z-Plane, or by numerically editing their position. One can even drag a pole outside the unit circle should that be required.

The tool is available by monthly subscription but there is a "Not for Commercial Use" demo which is great for instruction & learning.