Pole-Zero placement v2

Pole mag
Pole angle
Zero mag
Zero angle
Sample rate (Hz)
Plot

A new pole-zero calculator

An JavaScript remake of the old Java-based pole-zero placement applet—visit that page for tips on pole-zero locations for standard biquads. The main additions are input fields for precision pole-zero placement, and an option to display the response with a log frequency scale.

The basic idea is that poles blow, zeros suck. Think of poles as controlling a frequency-dependent feedback or resonance—the impulse response of a pole inside the unit circle decays, while one outside is like runaway feedback (think of a mic feeding back into a loudspeaker). A pole on the unit circle gives a sustained oscillation (but watch out for numerical errors—keep your poles inside the unit circle, typically). Zeros absorb a particular frequency; when on the unit circle, they absorb the corresponding frequency completely.

So, poles push the frequency response up around their corresponding frequency, and zeros pull down around theirs. Keep in mind that the frequency response graph is normalized, just as the filter coefficients are. So, while a pole pushes up the response, it appears as though all other frequencies are being pushed down instead. Of course, normalization is important in practical application, but be aware of it when visualizing how poles and zeros interact.

This entry was posted in Biquads, Digital Audio, Filters, IIR Filters, Widgets. Bookmark the permalink.

15 Responses to Pole-Zero placement v2

  1. Piezo says:

    I found a very nice web app showing interactive filter design with direct visualization in frequency domain and z-domain ( poles and zeros ) :
    http://www.micromodeler.com/dsp/

    This is intended for embedded dsp applications, but it’s still a incredibly useful pedagogical material.

  2. Richard says:

    Hi there,

    Very nice applet.

    Any chance you could add the phase graph too? i.e.: atan(Im(H)/Re(H)). I’d like to get a better intuitive idea of how that works.

    (And then, for a future version, could we manually select the number of poles & zeros? Add support for all-pass filters… :o)

    Many thanks,
    Richard.

    • Nigel Redmon says:

      Hi Richard. I’ve thought many times about some of these features, and as you noted, one leads to another, and the only sound solution would be to go into the business of a making a commercial filter design software package, and I’d be heading far off track from what I’m trying to do…

      The phase plot is the most obvious, but in the end we’ve got a second order filter, for which you can look up the unexciting phase characteristics elsewhere, and they are simply an accepted byproduct of this type of filter. (That is, the parametric EQs in your analog mixing console and their digital equivalents in your DAW do the same thing—do you demand to see their phase response before purchasing? No, because you accept what that type of filter gives you.) Now, it would be very helpful as you add some of the other things you mentioned—more poles and zeros, all pass filter…then you’re back in the business of making a filter design package. 😉

      Nigel

  3. Antony says:

    This tool seems to be getting the signs for b1 and b2 the wrong way round, although that depends on how you write your equation;
    In your other material you write y[n] = …. – b1 * y[n-1] – b2 * y[n-2]
    In that case the signs are wrong, or rather, inconsistent with how you write the direct forms.

    • Nigel Redmon says:

      Thank you for catching that, Anthony. While I was at it, I improved the log tick value scaling. I also took the opportunity to restore continuous update on slider movement (broken when Safari and Chrome fixed their errors in HTML5 interpretation).

  4. mclaren says:

    Clearest description I’ve ever read of poles and zeroes in the real world. Excellent!

  5. Matthijs van Delft says:

    To get a more complete example it would be great is the cut off frequency would be part of the parameters. It would also be very nice if the frequency on the -3dB point of the graph would be readable in some way.

    Nevertheless, thanks for the great explaination!

  6. Eugene says:

    Here “a” coefficients represents numerator, right? In most sources b is a numerator.

    • Nigel Redmon says:

      Hi Eugene—asked and answered a few times in comments on the site, but since you bring it up, I’ll put together a short article explaining the choice. Short version: In the internet age, I don’t doubt that b-in-the-numerator has become most common. But I’m not going to edit articles going back to 2003, so yes, a in the numerator here 😉

  7. dino says:

    How do you calculate the coefficients from the poles to get the frequency response? I know to use the quadratic formula to get the opposite so I naively attempted making a quadratic using the poles but couldn’t get the same result as the calculator. I’m guessing it’s something obvious I’m missing but I couldn’t find anywhere that shows it being done other than an uncommented line of code…

    • Nigel Redmon says:

      On this one, I’m calculating the frequency response directly from the locations of the poles and zeros. But since I also calculated and display the coefficients, of course it could have been derived from the coefficients (as in Evaluating filter frequency response).

      You can look at the Javascript source with your browsers developer tools, or directly here. The function getBiquadCoefs_polezero2 converts from pole-zero to coefficients (OK, I see I multiply and add a term I’ve already determined to be zero, but I do these things quickly.)

  8. kees says:

    I was busy with class D to put lpf in feedback, therefore use a lowpass filter on cutoff 60 Khz and use a lead filter to put poles in left plane.

    But I stil not understand how to do that, I have now with ltspice simulated, I did have to use small capcitor and 3,9k resistor to get 500 Khz, but making capacitor bigger it jumps to 1.5 Mhz oscillation.

    Th amp did work with 3.9 K and 47 Pf cap, ascilate on 4.5 Khz, and had a quite good control over the 60 Khz butterworth with a square test.

    Need some ease stuf to learn about poles and zero,s I bow that a pole is the -3dB point and a zero where it cross 0 dB.

    regards

    • Nigel Redmon says:

      I guess you’re talking about a first order filter. the frequency is related to RC, so yes, change C will change frequency. Yes, the pole would determine the 3 dB point for a lowpass, assuming the zero wasn’t close. But the zero pulls down—to -infinity when it’s on the unit circle. For a lowpass, you’d normally put it at an angle of pi and magnitude 1, to pull down at half the sample rate.

Leave a Reply

Your email address will not be published. Required fields are marked *