EE 451

Lab 4: Digital Oscillators on the 56002

A touchtone telephone uses two frequencies for each key pressed. The frequencies are shown in the diagram below:


Thus, when you press the ``1'' key you get a tone

\begin{displaymath}y(n) = \frac{1}{2} ( \cos(2 \pi f_L t) + \cos(2 \pi f_H t)) \end{displaymath}

where fL = 697 Hz and fH = 1209 Hz. These tones are called dual-tone multi-frequency (DTMF) signals. In this lab we want to use the 56002 to generate these DTMF signals. We can do this by implementing a discrete-time system with an impulse response

\begin{displaymath}h(n) = \frac{1}{2} ( \cos(\omega_L n) + \cos(\omega_H n))
\end{displaymath} (1)

This is a fourth-order system and can be written in the z-domain as

\begin{displaymath}H(z) = \frac{b_0 + b_1 z^{-1} + b_2 z^{-2} + b_3 z^{-3} + b_4 z^{-4}}
{1 + a_1 z^{-1} + a_2 z^{-2} + a_3 z^{-3} + a_4 z^{-4}}
\end{displaymath} (2)

This can be implemented in several ways. It can be implemented as a fourth-order system by the difference equation:

y(n) & = & b_0 x(n) + b_1 x(n-1) + b_2 x(n...
... a_1 y(n-1) - a_2 y(n-2) - a_3 y(n-3) - a_4 y(n-4)
\end{array}\end{displaymath} (3)

It can be implemented as a cascade of second-order systems - in the z-domain this would look like:

\begin{displaymath}H(z) = \left(\frac{b_{00} + b_{01} z^{-1} + b_{02} z^{-2}}
...b_{12} z^{-2}}
{a_{10} + a_{11} z^{-1} + a_{12} z^{-2}}\right)
\end{displaymath} (4)

It can be implemented in parallel form - in the z-domain this would look like:

\begin{displaymath}H_1(z) = \frac{b_{10} + b_{11} z^{-1} + b_{12} z^{-2}}
{1 + a_{11} z^{-1} + a_{12} z^{-2}} \nonumber \\

\begin{displaymath}H_2(z) = \frac{b_{20} + b_{21} z^{-1} + b_{22} z^{-2}}
{1 + a_{21} z^{-1} + a_{22} z^{-2}} \nonumber \\

H(z) = H1(z) + H2(z) (5)

For reasons of stability in a finite word length processor the form in Equation 5 is the best for implementing this system.

Find the z-transform of Equation 1. Write it in the form of Equation 5.

Write a MATLAB m-file which will calculate the ajk and bjkcoefficients when given the two frequencies $\omega_L$ and $\omega_H$, and will calculate the first few values of h1(n) and h2(n): h1(0), h1(1), h1(2), h2(0), h2(1), and h2(2).

Also, your MATLAB program should plot the impulse responses so you can see what the signals should look like.

Run your MATLAB program to find the ajk's and initial values needed for several different DTMF tones.

Write a program for the 56002 which will implement the difference equation. Modify last week's lab to do this. Perhaps you can calculate H1(z) in Accumulator a and H2(z) in Accumulator b, and add the two together for the final result.

Note that your program needs no input. For n>2 the difference equation for H1 is simply

h1(n) = -a11 h1(n-1) - a12 h1(n-2)

Thus, if you start your system at n = 3, with h1(1) and h1(2) initialized in memory, you do not need to use the bjk coefficients.

Test your program. Listen to the different outputs and see if they sound like touch-tone tones. Look at the outputs on an oscilloscope to determine if the two correct frequencies are present.

Bill Rison