Sie sind auf Seite 1von 5

Lab 2 Report: Convolution CT321: Digital Signal Processing Prof.

Aditya Tatu
Group Members: Vaishali Behl: 201001223 Rushik Patel: 201101108

0.1

Question 1

Write a MATLAB function myeig.m that takes in any impulse response h = (h0; h1; h2) with N = 3, computes and outputs the eigenvalues and eigenvectors of the circular convolution matrix H. This should be done by rst analytically computing the characteristic polynomial1 det(H ), whose roots can be computed using roots.m and basis of the nullspace of H (i.e., eigenvectors) can be computed using null.m. Verify if the eigenvectors and eigenvalues are what you expect them to be, giving appropriate reasons if they are not what you expect them to be. Ans. Linear convolution can be easily computed by matrix multiplication. Here we will model our input sequence and impulse response as column vectors. Now, We know that discrete convolution rule that computes the output sequence y for any input sequence x given the sequence h known as the impulse response can be given as:
n

y=
n=0

x[k ].h[n k ] y =xh

We can compute the matrix represenrtation of Linear convolution by treating it as a linear operator. Thus equation of Linear Convolution matrixis as follows: h0 0 ... ... 0 h1 h0 0 ... 0 h0 [T ] = h hM N M 1 hM 2 ... ... 0 hM 1 ... ... hM N 1 0 ... 0 0 hM 1 N +M 1XN so, y0 y1 yn ym1 ym ym+n1 h0 h1 0 h0 ... ... 0 ... 0 0 h0 hM 2 hM 1 ... ... ... ... ... 0 0 hM N hM N +1 hM 1 x0 x1 xnk xn1

= hM 1 0 0

1 Thus By giving input x = 2 to system having a impulse response h = 3 0 1 1 2 gives y = 2 which is depicted in the below gure. Computing the 3 3 4

Figure 1: Figure 2: Figures of Question 2 convolution by conv function of MATLAB gives the same results.

0.2

Question 3

. Write a MATLAB function mycircconvmat.m that takes in the impulse response and outputs the matrix representing the circular convolution matrix. Compute and plot the convolution results for some cases. Compare your results with the convolution output obtained using the inbuilt MATLAB function cconv.m. ANS: Circular convolution is done for two periodic sequences of same period. If sequence is periodic with period n then we can model it with sequence of length

n.Thus equation of Circular Convolution matrix is as follows: h0 hn1 ... h1 h1 h0 ... h2 [T ] = hn1 so, y0 y1 = yn h0 h1 hn1 h0 ... ... h1 x0 h2 x1 hn2 ... h0
N XN

hn1 hn2 ... h0 xn 1 2 Thus By giving input x = 8 to system having a impulse response h = 5 4 1 2 3 gives y which is depicted in the below gure. 4 5

Figure 3: Computing the convolution by cconv function of MATLAB gives the same results.

0.3

Question 4

. Write a MATLAB function mycircconvmat2.m that takes in the impulse response and an input sequence, possibly of dierent lengths and produces an output corresponding to the linear convolution between the two sequences using mycircconvmat.m. Compute and plot the convolution results for some cases. Compare your results with the convolution output obtained using the inbuilt MATLAB function conv.m. ANS: In this question we are asked to do linear convolution via circular convolution. here function would use second function and generate the circular convolution matrix. after that it will modify that matrix and compute the linear convolution of given sequences. computing the linear convolution by conv function of MATLAB gives the same output.here is the input ,impulse and output se 1 2 quences. Thus By giving input x = 3 to system having a impulse response 4 5 1 h = 2 gives y which is depicted in the below gure. 3

Figure 4: Figure 5: Figures of Question 4

Das könnte Ihnen auch gefallen