ELEC 470

Prof. Rich Kozick

Spring, 1998

Prof. Rich Kozick

Spring, 1998

**Date Assigned:** Wednesday, January 28, 1998

**Date Due:** Wednesday, February 4, 1998

The ``touch-tones'' that we use to place a telephone call
are encoded using the dual-tone multifrequency (DTMF) code.
Each button on the telephone is encoded by a sum of two
equal-amplitude sine waves, with frequencies
as shown in the following table.

Frequency (Hz) | 1209 | 1336 | 1477 |

697 | 1 | 2 | 3 |

770 | 4 | 5 | 6 |

852 | 7 | 8 | 9 |

941 | * | 0 | # |

An audio file that plays each tone for 0.5 seconds is available by clicking here. The sequence is 123456789*0#.

Suppose that you are designing a system to decode the DTMF signals.
How long must the DTMF signal stay ``on'' in order for your
decoder to reliably distinguish between the 12 signals?
You would like to design a system that requires a signal duration
that is as small as possible.
We will examine this question from three viewpoints.
First, we will use Fourier transform *analysis* to estimate
the required duration of the signals.
Then we will use MATLAB to verify and further refine our estimate.
Finally, we will use the Fast Fourier Transform (FFT) to analyze
sampled DTMF signals.
This exercise will also help introduce you to MATLAB and the FFT.

**Analytical Approach**

A DTMF signal with duration T seconds can be modeled as
a sum of two cosine signals with frequencies
*f*_{r} and *f*_{c}, multiplied by a rectangle function.
For example, the DTMF signal for ``1'' is

Questions:

- 1.
- What is the expression for the Fourier transform of a DTMF signal?
- 2.
- Sketch the amplitude spectrum of a DTMF signal with infinite duration, i.e., with T = infinity.
- 3.
- What happens to the DTMF spectrum when T is too small?
- 4.
- What would you estimate as
the
*smallest*value of signal duration T so that the spectra of the 12 DTMF signals are distinguishable from each other? Explain your reasoning.

**Plotting Fourier Transforms with MATLAB**

We can use MATLAB to plot the amplitude spectra
of DTMF signals.
An example MATLAB program
`dtmf_ft.m`
can be downloaded from the Web page for this assignment.
To run this program:

- Save the file in your directory with name
`dtmf_ft.m` - Start MATLAB version 5 by typing
`matlab5`at the UNIX prompt on the Sun computers. - At the MATLAB prompt, type
`dtmf_ft`

- You should view the file in an editor, and make sure that you understand all of the steps. Note that you can change a line in the program in order to plot the spectrum of various DTMF signals.
- The
`imzoom`feature in MATLAB is useful to zoom-in on interesting portions of a plot. - If you want to print a figure in MATLAB,
first click on the window for that figure,
and then type at the MATLAB prompt:
`print -Plwc``lw3`for room 350.

Run the program for various choices of signal duration T. You should be able to verify and possibly refine your estimate of the minimum duration T that you determined above. Please discuss how these results relate to your analysis.

**Analysis of Sampled DTMF Signals with the FFT**

In this section, we will analyze data files that contain samples of DTMF signals. Three different values of signal duration T are used in the data files. The sampling rate is 8192 samples per second, so samples are spaced by 1/8192 seconds. Your results in this section should agree with your previous analysis.

Begin by downloading the following 15 data files. Each data set (A, B, and C) uses a different value for T.

- Data set A: dtmfa1, dtmfa2, dtmfa3, dtmfa4, dtmfa5
- Data set B: dtmfb1, dtmfb2, dtmfb3, dtmfb4, dtmfb5
- Data set C: dtmfc1, dtmfc2, dtmfc3, dtmfc4, dtmfc5

A sample MATLAB program that uses the FFT to plot the amplitude spectrum
of a data set is available at
`dtmf_fft.m`

Please answer the following questions for each data set A, B, and C.

- What is the duration T of the DTMF signal?
- If possible, specify the symbol (1,2,3,4,5,6,7,8,9,*,0,#) that is encoded in each signal.
- Do your results in this section agree with your previous estimate of the minimum value for T?