Digital Signal Processing Lab 2
Digital Signal Processing Lab 2
Digital Signal Processing Lab Semester II, Due Date: March 12, 2014
Lab 2. Random and Deterministic Signals Introduction: In this lab session, we will familiarize ourselves with basics of MATLAB. We will write MATLAB programs to generate deterministic and random signals. We will also write programs to plot various graphs that will illustrate Fourier series theory. Procedure: 1. To run MATLAB go to Start >> Programs >> MATLAB. Click the left button of the mouse on icon MATLAB.
2. Create a directory called DSP lab 2. Make this directory the current Directory of MATLAB. To perform this step click on the icon and browse to the DSP lab 2 directory. Save all your MATLAB files in this directory. I. Deterministic Signals I.I Sinusoidal Signals 3. Write the following program to plot a sine wave. Save this program and name it as sine_wave.m. Run this program. ( Hint: Use sin MATLAB command.) Q1) Determine the amplitude, phase, period, sampling frequency, circular frequency (Hz), and angular frequency (rad/sec) of the sine wave. I.II Fourier Series Fourier series theory states that a periodic wave can be represented as a summation of sinusoidal waves with different frequencies, amplitudes and phase values. 4. Write a program that plots the signal s(t). Name this program as sine_wave_1.m.
N
s (t ) =
n =1
sin(2 nt ) n
where n = 1, 3, 5, 7, 9
and N = 9
or
s (t ) = sin(2t ) +
5.
Write a program that plots the signal s(t) in step 2 but with N = 100. Name this program as sine_wave_2.m
Q2) What do you conclude from steps 4 & 5? I.III Other Signals
6. Plot the discrete signal x = [0, 1, 3, 1, -2, 0, 2, 0, 1, 4]. Name this program as Discrete_1.m. (Hint: Use stem MATLAB command) 7. Write the following program to plot a discrete-time square wave. Name this program as square_wave.m. (Hint: Use square MATLAB command)
Q3) Determine the sampling frequency, circular frequency (Hz), relative frequency, period, and duty cycle of the square wave signal.
8. Write a program that plots a discrete time sawtooth signal. Name this program as sawtooth_wave.m. (Hint: use sawtooth MATLAB command)