EE 451 - LAB 6

Simple Bandpass Filter

In the Lab 4 you wrote a program to generate DTMF (Dual Tone Multiple Frequency) tones using the 56002. In the next few labs you will build a decoder to indicate which DTMF tone is being generated. This can be accomplished in many ways. The way we will do it in this lab is to build a bandpass filter and detector for each of the eight DTMF frequencies. Thus, if the number 8'' is pressed the outputs of the 853 Hz and 1336 Hz detectors should go high, while the outputs of the other detectors should remain low. In Lab 6 you will design the bandpass filter which can be used for this detector. In the next labs you will add the detectors to be able to detect the presence of the eight possible frequencies, and a decoder to indicate which of the frequencies are present.

This lab will deal with telephone-line frequencies. A telephone line has a low-pass cutoff of about 3 kHz. Thus, we can get all the information about any signal on a telephone line by sampling the signal at any frequency above 6 kHz. For this lab we will use a sampling frequency of 8 kHz, which will make filter design easier than if we sampled at 48 kHz.

We will design the bandpass filter by placement of poles and zeros. For example, suppose we want to detect a frequency of 770 Hz. We want a bandpass filter which will pass 770 Hz (and a few hertz above and below 770), while blocking frequencies at 697 Hz and 892 Hz. We could do this by placing a pole just inside the unit circle from 770 Hz, and zeros at 0 Hz and 4,000 Hz. (See Section 4.5.2 of the text.) It turns out that this two-pole filter will not give a suitably narrow bandpass response with poles sufficiently far from the unit cirle that roundoff errors do not produce an unstable system. However a four-pole filter, with two poles just inside the unit circle at +770 Hz and -770 Hz, will give a suitable bandpass filter. Figure 1 below shows the pole-zero placement for a four-pole bandpass filter. Figure 2 shows the frequency response of this filter. Figure 3 shows the response of the filter to an in-band 770 Hz signal and an out-of-band 697 Hz signal.

To design your bandpass filter put poles just inside the unit circle at a frequency of 770 Hz. Adjust the radius of the poles until the gains at 693 Hz and 852 Hz (the signals the bandpass filter should stop) are less 5% of the maximum gain at about 770 Hz. Use Formula 4.113 from Mitra to determine the transfer function of each two-pole section.

The detector for 770 Hz is simple to design. One method is to just square the output signal from the output of the bandpass filter and average it over one period. Then if the output of the detector exceeds some threshold value you can set a pin high to indicate that that particular frequency is present in the input signal. Figure 4 shows the response of such a detector to a 770 Hz pulse.

You also need an external indication of when the 770 Hz signal is present, to see if your program is working correctly. To do this you must toggle an external pin on the 56002. Like the 68HC11, the 56002 has several dual-purpose pins - pins which can be used for a specific purpose (like serial I/O), or can be used for general purpose I/O if not being used for their specific purpose. The 56002 has 15 pins devoted to Port B, the the Host Interface (HI) port. When used as a host interface, the 56002 can communicate with a host computer over an eight-bit parallel bus. When not used as a host interface, the 15 pins of Port B can be used for general purpose I/O. Section 5.2 of DSP56002: Digital Signal Processor User's Manual describes how to set up Port B for use for general purpose I/O. Read this section of the manual.

In this lab you will design and implement a bandpass filter for one of the DTMF frequencies. In subsequent labs you will add a detector for that frequency, then add filters and detectors for the other seven frequencies.

1. Design a bandpass filter to pass 770 Hz while blocking all the other frequencies of the DTMF tones. Do this as discussed above: design a four-pole filter, with poles just inside the unit circle at about 765 Hz and 775 Hz. Adjust the radius of the poles until the poles are as far away from the unit circle as possible, while the gain at the adjacent frequencies (693 Hz and 852 Hz) is about 5% of the gain at the desired frequencies.

2. Use MATLAB to plot the gain of your bandpass filter, and to plot the poles and zeros. Write the filter in the form of a difference equation which can be implemented on the 56002.

3. Implement your filter using the Motorola 56002. The lecture in the laboratory will discuss how to implement this IIR filter in an efficient manner.

4. Verify that the frequency response of the bandpass filter matches the theoretical response from MATLAB.

Bill Rison
2001-10-01