Professional Documents
Culture Documents
Marks:
A P C
Sessional 2-
Ques 1:
Find the output of Discrete Time System having input and impulse response given;
us = 0.*(t<0)+1.*(t>=0)
end
Main File:
clc;
clear all;
close all;
n = -20:20;
figure;
stem(n, X,'r');
xlabel('n');
ylabel('X(n)');
title('Input: X(n)');
% h is impulse response
h = unit_step(n)-unit_step(n-10);
figure;
stem(n, h,'r');
xlabel('n');
ylabel('h(n)');
title('Impulse Response: h(n)');
Y=conv(h, X, 'same');
figure;
stem(n, Y,'b');
xlabel('n');
ylabel('Y(n)');
title('Output: Y(n)');
Output:
Figure 1:
Figure 2:
Figure 3:
Code Picture:
THE END