You are on page 1of 2

Digital Signal Processing Lab

Labsheet 2:

Lab Exercises:
1. Take the following two sinusoids :
x1 (t) = 2 cos(2π ∗ 600t)
x2 (t) = 2 cos 2π ∗ 1000t + π3

Generate a Matlab program to sample each sinusoid and generate a sum of sinusoids
i.e. , x[n] = x1 [n] + x2 [n] using sampling rate of 8000 Hz. Plot x[n] over a range of
time that will exhibit approximately 0.1 sec.
2. Using Matlab, find the even and odd part of the signals given below :
 
i. x1 [n] = 1 2 4 6 8 10
ii. x2 [n] = cos(2π f3 n) + sin(π f3 n)
3. Find the convolution of the given finite length sequences
h i
x1 [n] = 4 2 1 5 −3 2

h i
x2 [n] = −1 0 4 3 1

Note: Arrow points to zero location in above sequences.


(a) Since Matlab command does not give time index of the convolved result, derive
it from the signals to be convolved and plot the convolved signal appropriately.
(b) Find auto correlation and cross correlation x1 and x2 with the help of convolu-
tion.
4. Write your own function to compute convolution of two finite length discrete time
signals ( without using the inbuilt ‘conv’ command ). [ Hint : Lets say you want to
create function called “my conv” which takes 2 finite length sequences as input with
zero locations and output the convolution of these sequences. You can do so by creat-
ing a file named ”my conv.m” with its first line as “ [conv output , conv zero location]
= function my conv( seq1, seq2, zero seq1, zero seq2 ) ” ].
Verify your answer with the output of inbuilt command.
5. Plot the signals shown in Figure l. Sketch the following signals without the interpo-
lation of the missing samples :
a. f [−k] b. f [k + 6] c. f [k − 6] d. f [3k] e. f [k/3]

1
Figure 1:

You might also like