Experiment #4: Lti Systems - Convolution and Difference Equations
Experiment #4: Lti Systems - Convolution and Difference Equations
(2014069342)
4ECE-E
1. Determine the unit-step response of the system described by their impulse responses.
Plot the response using the stem command.
MATLAB code:
>> n = 0:24;
>> un25 = [ zeros(1,25), ones(1,(numel(n)-25)) ];
>> un = [ ones(1,25) ];
>> z = un - un25;
>> hn = ( 0.8.^n );
>> h = conv(z, hn);
>> stem(n,h(1,1:25))
MATLAB code:
4-1
FERRER, Patrick Gerard E. (2014069342)
4ECE-E
>> n = 0:24;
>> un25 = [ zeros( 1, 25 ), ones(1,(numel(n)-25)) ];
>> un = [ ones( 1,25) ];
>> z = un - un25;
>> hn = ( 0.8.^n ).*( cos(0.2*pi.*n) );
>> h = conv( z, hn );
>> stem( n, h(1:25) )
4-2
FERRER, Patrick Gerard E. (2014069342)
4ECE-E
H1
y(n) + H3 y(n)
H2
MATLAB code:
>> n=0:24;
>> xn=10.*cos(0.02*pi.*n);
>> h1n=0.8.^n;
>> h2n=-1*0.5.^n;
>> h3n=(0.3.^n).*cos(0.8*pi.*n);
>> yn=conv((conv(xn,h1n)+conv(xn,h2n)),h3n);
>> stem(n,yn(1,1:25))
4-3
FERRER, Patrick Gerard E. (2014069342)
4ECE-E
a. Compute the values of the first ten (10) samples of y(n) using direct substitution
MATLAB code:
b. Compute the values of the first ten (10) samples of y(n) using the filter function.
MATLAB code:
d. Obtain the first ten (10) samples of h(n) by repeating 3.a using x(n) = δ(n)
MATLAB code:
e. Use h(n) to solve again y(n) for x(n) = 5u(n) by convolving h(n) to x(n).
MATLAB code:
4-4
FERRER, Patrick Gerard E. (2014069342)
4ECE-E
f. Plot the responses from 3.a, 3.b, and 3.e. Use subplot to display the plots on a
single figure window. Comment on the samples computed (plots).
MATLAB code:
Comment:
– END OF EXPERIMENT –
4-5