Skip to Main Content Skip to Search
Home |   Select Country  Choose Country  |  Contact Us  |  Cart Store 
Create Account | Log In
Products & Services Industries Academia Support User Community Company

 

Newsletters - MATLAB Digest

Filter Design Using SPTool's Pole/Zero Editor

by Paul Pacheco and Anne Mascarin

Introduction

The Pole/Zero Editor is one of several components of the Signal Processing Toolbox's SPTool Graphical User Interface (GUI). The Pole/Zero Editor, which is accessible through SPTool's Filter Designer, provides an alternative to the common paradigm of designing filters where the specifications are in the frequency or the time domain. With the Pole/Zero Editor, you can design your filter graphically by placing individual poles and zeros in the z-plane. Additionally, you can specify poles and zeros by entering their exact locations.

The Pole/Zero Editor enables you to accurately place a zero at a certain frequency to "null out" (or remove) that frequency from the filter response. You can drag and drop a single pole or zero, or a pair of complex conjugate poles or zeros. As you drag the poles and zeros unto the z-plane, the magnitude, angle and x, y coordinates are displayed in the Measurements section. Moreover the Pole/Zero Editor GUI provides feedback on the stability and phase characteristics such as minimum phase of the filter.

Another advantage of the Pole/Zero Editor is its ability to edit existing filters. You can import a filter, in any form, into the SPTool data manager and then edit it with the Pole/Zero Editor. Used in conjunction with SPTool's Filter Viewer, the Pole/Zero Editor makes it easy to modify your filter's pole and zero locations and see the results in real time. You can tweak the values of the poles and zeros in the Pole/Zero Editor and get immediate feedback on the results by viewing the frequency response, impulse response or the step response in the Filter Viewer. The Pole/Zero Editor is a great addition to any filter designer's tool set.

Usage Example: Comb Filters and the Pole/Zero Editor

Comb filters are essentially notch filters with deep notches equally spaced in a band of frequencies. The periodic, deep notches make comb filters ideal for applications that need to eliminate specific frequency components. For example, instrumentation and recording systems require that the power-line frequency of 60 Hz and its harmonics be eliminated [1]. Comb filters are used in audio engineering to achieve special sound effects. Comb filters are used in the construction of digital reverb processors, where they represent the effects of multiple reflections of a sound wave off the walls of a listening space [2]. In digital TV, comb filters are used in the case when both signals are periodic and must be separated from each other. The comb/notch filters are used to separate the luminance (black & white) and chrominance (color) signals from composite video signal, and also to reduce video noise [2].

A comb filter can be designed by placing zeros equally spaced around the unit circle at the desired notch locations. However, the resulting FIR notch filter will exhibit relatively large bandwidth at each notch, which will result in the attenuation of desired frequency components. One approach to addressing this problem is to pair a pole with every zero. The effect of the poles is to introduce a resonance in the vicinity of the null and thus to reduce the bandwidth of the notch [2]. The closer the poles are to the unit circle the narrower the notches will be and the less attenuation the desired frequencies will experience.

EXAMPLE

Using SPTool's Pole/Zero Editor we will design an FIR (Finite Impulse Response) comb filter. We will improve our comb filter by adding poles making it an IIR (Infinite Impulse Response) filter. We will then further improve the IIR filter's response by moving the poles closer to the unit circle; this will in effect decrease the transition regions of the comb filter we design.

A common application of comb filters is to remove periodic noise, such as a 60 Hz tone and its harmonics. In this example [2] we will assume a system is operating at 600 Hz and we'll design our comb filter to remove the 60 Hz fundamental along with its 10 harmonics. This can be achieved by creating an FIR filter, placing 10 equally spaced zeros around the unit circle separated by the fundamental frequency f1=60 Hz. In angular frequency that is

w1 = 2*π *f1/fs = 2*π*60/600 = .2*π radians/sample

We will design the filter directly in the Pole/Zero Editor by placing the zeros on the unit circle. Therefore the zeros will have a radius of 1 (Mag = 1) and angles at multiples of 0.2π (starting at 0). After placing all 10 zeros, we can then modify the FIR filter by adding poles; the resulting filter will be an IIR filter with narrower notches. We will add 10 poles at the same angle locations as the zeros with a slightly smaller radius of Mag = 0.95 (to ensure stability, the poles must be located within the unit circle; i.e., the magnitude must be <1). Then, we will decrease the transition regions of our comb filter by increasing the radius of the poles to Mag = 0.98.

Let's step through the process in the Pole/Zero Editor.

  1. At the MATLAB command prompt, type:
    sptool
    to launch the SPTool data manager.
  2. Click on New Design in the Filters column. This will open the Filter Designer GUI.
  3. Choose the Pole/Zero Editor from the Algorithm pull-down menu. Click Delete All to clear out all poles and zeros from previous designs.
  4. Enter 600 in the Sampling Frequency box.
  5. Select the Add Zeros button.
    Figure 1. The Add Zeros button.
  6. After selecting the Add Zeros button click on the desired area in the z-plane to place a zero. The readouts in the "Coordinates" section under the "Measurements" area can help guide zero placement.

    By default, the Conjugate Pair box is checked upon entering the Pole/Zero Editor. Therefore, we will place all complex conjugate pairs first (as the box is checked). Place 4 zeros on the unit circle (Mag = 1) equally spaced at multiples of 0.2π (0.2π, 0.4π , 0.6π , 0.8π ).

    To place the zeros at exact locations, select a zero on the z-plane and type the new values directly into the Mag and Angle boxes in the Specifications section. Note that expressions such as "0.2*π" can be typed in directly.

    The complex conjugates are shown on the bottom half of the z-plane (for example, the complex conjugate of 0.2π is -0.2π Therefore, 8 zeros should be visible on the unit circle.

  7. Uncheck Conjugate Pair to place single zeros at 0 and π. Now there should be a total of 10 equally spaced zeros on the unit circle, as shown in Figure 2.
    Figure 2. Filter Designer illustrating an FIR filter with 10 equally spaced zeros.Click to enlarge
  8. We can now use the Filter Viewer GUI to verify the filter's response. In the SPTool data manager, the name of the filter that we have been designing will be highlighted in the Filters column (filt1 in this example). Select View to enter the Filter Viewer. Select Magnitude and Phase on the left side under Plots. Select the linear option from the pop-up menu for magnitude, and the degrees option for phase. At this point, you can visually verify that the notches or "nulls" in the spectrum occur at 60 Hz intervals, starting at 0 Hz (see Figure 3).
    Figure 3. Filter Viewer illustrating that the "nulls" in the magnitude plot occur every at 60 Hz..
  9. After placing all the zeros, repeat the process by placing 10 poles with a smaller radius of Mag = 0.95 at the same angle locations as the zeros in step 4 above. Remember to check the Conjugate Pair box before placing the poles at 0.2π, 0.4π, 0.6π, and 0.8π.
  10. View the resulting IIR filter in the Filter Viewer (see step 8). Observe that the filter exhibits a much flatter response with narrower transition regions than the FIR filter.
    Figure 4. Filter Viewer with frequency response of IIR filter with pole magnitude of 0.95.
  11. Using the same example, we will make the notches narrower by increasing the magnitude of the poles. We can do this by simply selecting each complex conjugate pole pair (or an individual pole) and setting its magnitude to Mag = 0.98 in the Mag box in the Specifications section.
  12. View the filter in the Filter Viewer to verify that moving the poles closer to the unit circle did indeed improve the filter response by decreasing the transition region (see Figure 5).
    Figure 5. Frequency response of IIR filter with pole magnitudes of 0.98.Click to enlarge.

Conclusion

As we have demonstrated the Pole/Zero Editor is a useful graphical tool to design filters by placing poles and zeros in the z-plane. By importing existing filter designs (in any form) into SPTool, you can edit the location of its poles or zeros. Using the Pole/Zero Editor in conjunction with the Filter Viewer, one can tweak the pole and zero locations of a filter while viewing its frequency response, impulse response, step response, or group delay. In addition, the Pole/Zero Editor provides important filter characteristics such as stability and phase.

References

[1] Proakis, John. G. and Manolakis, Dimitris G., Digital Signal Processing Principles, Algorithms, and Applications, Prentice-Hall Inc. Upper Saddle River New Jersey, 1996
[2] Orfanidis, Sophocles J., Introduction to Signal Processing, Prentice-Hall Inc. Upper Saddle River New Jersey, 1996

Contact sales
E-mail this page
Print this page
Subscribe to newsletters