I'm studying the IIR filter design that is described in the book: Algorithms for the constrained design of digital filters with arbitrary phase and magnitude responses.

You can get the code at page 171 (at least the main function), and here is an example of a filter design :


This is the design of a pass-band linear phase lowpass filter

enter image description here

There is something I don't understand in this code: exp(-1i*om(1:20)*tau) is a way to create regularly spaced points with constant phase change and magnitude = 1. But I don't understand the parameter tau. I tried to change that parameter and I had totally different results: like a notch instead of a lowpass.

  • How do you choose that number ?
  • I have to design my filters according to the user desire but how to guess that parameter?
  • And also how to you choose the phase angles shift ?



2 Answers 2


The variable tau was chosen so that the phase of D at $om = 0.2$ is $-\pi$.

It is easier to understanding what is going on if you plot D, which is the desired magnitude/phase response of the filter. Add the following code to help you visualize what is going on:

  title('Magnitude Response');
  xlabel('Frequency (normalized)');
  ylabel('Magnitude (dB)');
  axis([0, 1, -80, 10]);
  title('Phase Response');
  xlabel('Frequency (normalized)');
  ylabel('Phase (degrees)');
  axis([0, 1, -180, 180]);

When you look at the resulting plot, you can see that the current value of tau gives a phase response which dips down to $-180^\circ$ at the cutoff frequency. Notice that the phase will wrap back around from $-180^\circ$ to $180^\circ$. This will almost always lead to undesired results in a system.


Well, let's decode it:


om is a variable that ranges from 0 to pi with two different spacings (one from 0 to 0.2*pi and one from 0.4*pi to pi.

Then, to find D (the desired response), we do:


This takes the first twenty entries in om and multiplies them by tau and -i1 = $-\sqrt{-1}$.

That makes the frequency range (D in the above) from 0 to 0.2*pi*tau (i.e. pi since tau is 5).

Checking page 171, we see:

om frequency grid 0<=om<= pi
D complex desired frequency response on the grid om

which means that om has to be between 0 and pi, and D is the desired response.

If you've changed tau, causing D to have a greater phase (more delay).

What I suspect is happening is that the phase (and, therefore, the delay) you've changed it to cannot easily be approximated by a $4^{\rm th}$ order filter (N or M in your script).

  • $\begingroup$ Changing the value of tau does not actually affect the value of om. $\endgroup$
    – nispio
    Aug 23, 2013 at 17:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.