EE 451 - LAB 6

DTMF Detector

Part 1: 770 Hz Bandpass Filter and Detector

In the Lab 4 you wrote a program to generate DTMF (Dual Tone Multiple Frequency) tones using the 56002. For this lab 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 Part 1 of Lab 6 you will design the bandpass filter and detector for the 770 Hz frequency. In the next part you will add the filters and detectors for the other frequencies to be able to detect all eight frequencies.

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 low and high frequencies. 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. It turns out that this two-pole filter will not give a suitably narrow bandpass response. However a four-pole filter, with poles just inside the unit circle at about 765 Hz and 775 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 693 Hz signal.


  
Figure 1: Pole-Zero Placement for Four-Pole DTMF Bandpass Filter.
\begin{figure}
\begin{center}
\epsfig{file=pole_zero.eps}\end{center}\end{figure}

To design your bandpass filter put poles just inside the unit circle at frequencies of about 765 Hz and 775 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 the 5% of the maximum gain at about 770 Hz.


  
Figure 2: Gain of Four-Pole DTMF Bandpass Filter.
\begin{figure}
\begin{center}
\epsfig{file=gain.eps,width=3.5in}\end{center}\end{figure}


  
Figure 3: Response of Four-Pole DTMF Bandpass Filter to Two Different Frequencies.
\begin{figure}
\begin{center}
\epsfig{file=response.eps,width=5.5in}\end{center}\end{figure}

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.


  
Figure 4: Response of Four-Pole DTMF Bandpass Filter to Two Different Frequencies.
\begin{figure}
\begin{center}
\epsfig{file=detector.eps,height=6.0in}\end{center}\end{figure}

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. Note that you will have to change the sampling frequency of your codec to 8 kHz.The lecture in the laboratory will discuss how to implement this IIR filter in an efficient manner. Here is a macro iir7.asm which you can use to implement the filter on the 56002, and here is the program iir_test.asm which shows how to use it.

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



Bill Rison
1999-10-11