DSP Lab 4-Handout Modified
-
Upload
mehboob-khokhar -
Category
Documents
-
view
213 -
download
0
Transcript of DSP Lab 4-Handout Modified
-
8/13/2019 DSP Lab 4-Handout Modified
1/2
Department of Telecommunication Engineering,
Mehran University of Engineering & Technology
Digital Signal Processing Lab 4
(6thTerm, 09TL)
StudentsName: _________________________________ Roll no: _________ Group: ____
Points: _______ Date of Submission: _____________ Teachers Signature: _____________
IN-LAB ASSIGNMENT
Lab Task 1: Plot the following signals
(a) u[n-10] (b) u[n]-u[n-10] (c) u[-n+10]-u[n-10]
Lab Task 2: Plot the signal
in time-domain and frequency domain. Use f = 1
KHz, 20 KHz, 50 KHz. Verify the signal frequency content in frequency-domain
---------------------------------------------------------------------------------------------------------------------------
The first part of this task requires you to create a sinusoidal signal with the given
frequencies. This is straightforward and I believe most of you were already able to do this.
One problem was that, you could not really observe the signal in time-domain. But you
should have expected it, since the frequency is too high, you have more than 2000 samples
for f = 1 KHz, in a second. It is difficult to observe the signal with so many samples in time-
domain (entire plot gets filled up with blue colour!), but, you can select a few samples and
observe it. Check out this code.
% Matlab Code for f = 1 KHz
f = 1e3; % 1KHz frequencyfs = 3*f; % sampling frequency, greater than Nyquist's rateT = 1/fs; % sampling instantn = 0:T:5; % time vector, using step equal to sampling instanty = -sin(2*pi*f*n); % sinusoidstem(n(1:100),y(1:100)) % small number of samples being plotted% If you can't observe the sinusoid, replace stem by plotfigure,plot(n(1:100),y(1:100))
Now, the next part, to represent this signal in frequency domain, using the user definedfunction dtft.m However, the default function which you would have copied from Lab
Handout 3, only has a frequency range from -10 to 10 Hz. Obviously, using the original
function to view the 1 KHz signal in frequency domain wont give accurate results. Therefore,
you need to modify it.
The simple modification is to change the frequency range from -10 Hz : 10 Hz to something
suitable. In our case, it can be -5 KHz : 100 : 5KHz (Whats the 100 for?)
Now you can use this function for frequency domain analysis. Be advised, if you dont have
a powerful processor, youd better skip the 50 KHz signal
---------------------------------------------------------------------------------------------------------------------------
-
8/13/2019 DSP Lab 4-Handout Modified
2/2
Department of Telecommunication Engineering,
Mehran University of Engineering & Technology
Lab Task 4: Write a Matlab program to find the impulse and the step responses of the
systems described by the following difference equations
(a) y[n] + 0.7y[n-1]
0.45y[n-2]
0.6 y[n-3] = 0.8x[n]
0.44x[n-1] + 0.36x[n-2] + 0.02x[n-3]
(b) [ ] Lab Task 5:Find the convolution sum of the following pair of sequences
(a) { { (b)
{
Organize your Matlab Programs, Plots and Submit them