EE 451
Lab 6: Digital Oscillators on the 56002

A discrete-time system with an impulse response

```        h(n) = 0.5 ( cos(w n) + cos(w n))
L          H
```
is described by a difference equation
```        y(n) + a y(n-1) + a y(n-2) + a y(n-3) + a y(n-4) =
1          2          3          4

b x(n) + b x(n-1) + b x(n-2) + b x(n-3)
0        1          2          3
```
You can get the 56002 to act as a digital oscillator by programming it to implement this system.

1. Write a MATLAB m-file which will calculate the a and b coefficients when given the two frequencies.

2. Write a program for the 56002 which will implement the difference equation.

1. Modify last week's lab to handle a fourth order IIR system.

2. At time n = 0, y(n) = 1.0 and x(n) = 1.0. For n > 0, x(n) = 0. In the initialization section of your program, set y(nmk) = 0 for all k except k = 0; for k = 0, set y(nm0) = 1.0. Set x(nmk) = 0 for all k except k = 0; for k = 0, set x(nm0) = 1.0.

3. From this point on, your program needs no input. In the section of the program where you read data from the A/D converter, just clr a before you use this data value.

3. Figure 8.1.3 of the text shows the two frequencies associated with telephone keypad -- e.g., pressing the ``1'' key will generate a tone with frequencies 697 Hz and 1209 Hz. Run your MATLAB program to find the a and b coefficients for several different keys.

4. Test your program. Listen to the different outputs and see if they sound like telephone key presses. Look at the outputs on an oscilloscope and try to determine if the two correct frequencies are present.

Bill Rison, <rison@ee.nmt.edu >
Mon Oct 7 1996