Está en la página 1de 4

EE443 INTRODUCTION TO DIGITAL SIGNAL PROCESSING

NAME

LAB3: THE LINEAR CONVOLUTION


All answers and observations are to be recorded in the spaces given
EXERCISE 1 Manual convolution and convolution using Matlab Convolve the following sequences manually (by hand) x = [1, 1, -1, -1 ] y = [1, 2, 4, 2]

........................................ DATE ..............................

The convolutions is ........................................................................................................................ Check your answer using the MATLAB command conv(x,y) same not same

What is the relationship between number of samples in the convolution sequence and number of samples in x and y ? ......................................................................................................................... Is conv(x,y) = conv(y,x) ?.............................................

EXERCISE 2 Convolution of different pulse sequences 2.1 Write MATLAB function called sq1_youridno to generate a square wave alternating between an amplitude of 0 and A, of length L samples, period T samples and on for S samples per period. Create a vector delta1 of length 1 representing an impulse (delta1 = [1]). Use your function to create a square wave sq1 of length 55, period 5, and height 1 that is on for 3 samples per period. Use conv to convolve sq1 and delta1 and plot the result using stem. .

2.2

2.3

Instructor Verification 2.4 Create another vector delta2 representing an impulse but of length 10 (delta2 = [1,zeros(1,9)];) Convolve sq1 and delta2 and plot the result. Explain any differences you observe.

Instructor Verification

Explanation of differences

2.5

Reverse the order of sq1 and delta2 in the conv command. Are there any differences? Observation and explanation:

2.6

Let y(n) = x(n) + x(n+1). Find the impulse response of this system analytically.

2.7

Create a flat impulse response hn2 that is two points long (hn2 = ones(1,2)). Convolve hn2 with sq1. Increase the length of the impulse response to 5 then 9, then 15. What happens as the length of the impulse response is increased? Explain. Observations and Explanations

2.8

x(n) u(n) u(n 5) u(n 10) u(n 15) and h(n) (n) 3 (n 1) (n 2) Determine x(n) h(n) analytically, explaining each step
Let

2.9

Check your result to 2.8 using MATLAB and explain below how you checked the result.

EXERCISE 3 Linearity property of the convolution of an LTI system 3.1 Write MATLAB statements to generate 500 samples the following input signals (a) x1(n) = sin(2*pi*n/100); How many cycles are there in the signal? Answer:.................cycles (b) x2(n) = 4*exp(-(n-150).^2./300) exp(-(n-150).^2/2500) What are its maximum and minimum values? Answer: Min = ......, Max = ......... x3(n) =

1 , 241 n 299 -2 , 300 n 379 0 n otherwise (d) x4(n) = random sequence of mean value 0 uniformly distributed between 1 and +1 Matlab statement for this is ....................................................................................................... (c) Instructor Verification 3.2 Generate the LTI system impulse response sequence h(n) = exp(-n./50)

3.3

Test the linearity property of the convolution of LTI systems as follows: (a) Convolve each input with h(n) to get y1 = conv(x1,h) x1 y2 = conv(x2,h) x2 h(n) y3 = conv(x3,h) x3 y4 = conv(x4,h) x4

y1 y2 y3 y4

Evaluate out1 = y1 + y2 + y3 + y4 Note that each input signal is applied to the system separately and outputs summed. (b) Convolve the x(n) with h(n), where x = x1 + x2 + x3 + x4

x1 x2 Evaluate out2 = conv(x,h) x3 x4 Here all input signals are applied simultaneously (c)

h(n)

out2

Compare out1 and out2 by subtracting them and plotting the error.

Instructor Verification If the system with impulse response h(n) is LTI, then out1 and out2 should be equal. What is your maximum error and where does it occur? Maximum error is ..............................and it occurs at ............................. In which region are there big errors? Why is this so? Write your answer in the space below

También podría gustarte