[DSP homepage]

Lab Exercise:

Digital Sinusoidal Oscillators

In this exercise you will use Excel to generate samples of sinusoids using a difference equation that acts as a digital sinusoidal oscillator. More information on these oscillators is provided [here].

First, use the pi( ) and sin( ) functions of Excel to generate samples of the analog signal

sin( 2 pi f1 t - phi)

where f1 and phi are the frequency and phase assigned to you. [frequency and phase assignments] Note that phi is specified in radians (NOT degrees). Use a sampling rate of 8000 Hz, and generate at least 100 samples starting at t = 0. Use an XY(scatter) graph [from the menu: Insert >> Chart >> XY(scatter) ] to graph the resulting discrete-time signal against n on the horizontal scale.

Next, you are to generate samples of the same function

sin( 2 pi f1 t - phi)

(or one whose phase is as close as possible to phi) using a difference equation. In this part of the exercise you are not supposed to use the pi( ) and sin( ) functions of Excel, except possibly to compute appropriate coefficients and initial conditions.

Use a difference equation of the form

y(n) = -a1 y(n-1) - a2 y(n-2)

with appropriate coefficients a1 and a2 and appropriate initial conditions y(-1) and y(-2). This difference equation specifies how the outputs y(n) may be obtained without the need for any input.

Use the same sampling rate of 8000 Hz, and generate at least 100 samples starting at t = 0. Use an XY(scatter) graph [from the menu: Insert >> Chart >> XY(scatter) ] to graph the resulting discrete-time signal against n on the horizontal scale.

 


 

This page has been accessed
Counter
times since November 19, 2002.

Last updated: November 21, 2002
lui_agustin@yahoo.com
1