Professional Documents
Culture Documents
Name Shahzad Arif Reg No. FA19-EPE-109 Section 4C Subject Signal and System Lab Engineer Sir Izhar Khan LAB Lab Sessional 2 Date MAY 23,2021
Name Shahzad Arif Reg No. FA19-EPE-109 Section 4C Subject Signal and System Lab Engineer Sir Izhar Khan LAB Lab Sessional 2 Date MAY 23,2021
ABBOTTABAD CAMPUS
Find the output of Discrete Time System having input and impulse response give
Matlab code:
clc;
clear all;
close all;
n=-20:20;
%performing convolution
X=((sign(n+eps)+1)/2);
subplot(311)
stem(n,X,'r')
grid('on')
title('Shahzad Arif FA19 EPE 109___ X[n]')
%plotting impluse response
h=((sign(n+eps)+1)/2)-((sign((n-10)+eps)+1)/2);
subplot(312)
stem(n,h,'b')
grid('on')
title('h[n]--impluse response')
Y=conv(h,X,'same');
figure,
stem(n,Y)
title(' Convolution ')
Xlable('time')
Ylabel('Y[n]=h[n]*X[n]')
subplot(313)
gride('on')
COMSATS UNIVERSITY ISLAMABAD
ABBOTTABAD CAMPUS