0% found this document useful (0 votes)
29 views

Discrete Time Systems in Time Domain Task 1: Write MATLAB Code To Find The Response To The Input X (N) of LTI System With Impulse Response

We convolved the input signal and impulse response to find the output of an LTI system. Then, we convolved the input signal with the impulse response multiplied by a unit step function to model the effect of the unit step and find the overall output of the combined system for the given input signal over the specified sample range. MATLAB code using convolution and unit step functions was written to calculate and plot the outputs.

Uploaded by

Eysha qureshi
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Discrete Time Systems in Time Domain Task 1: Write MATLAB Code To Find The Response To The Input X (N) of LTI System With Impulse Response

We convolved the input signal and impulse response to find the output of an LTI system. Then, we convolved the input signal with the impulse response multiplied by a unit step function to model the effect of the unit step and find the overall output of the combined system for the given input signal over the specified sample range. MATLAB code using convolution and unit step functions was written to calculate and plot the outputs.

Uploaded by

Eysha qureshi
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Discrete Time Systems in Time Domain

Task 1: Write MATLAB code to find the response to the input x(n) of LTI system with impulse response
h(n) for −5 ≤ 𝑛 ≤ 20.

clc;
close all;
clear all;
n=-5:20;
x=ones(1,5);
h=[zeros(1,7) ones(1,6) zeros(1,3) ones(1,6)];
y=conv(x,h);
stem(n,y);
xlabel('sampels')
ylabel('magnitude')
title('Output of LTI system')

Output of LTI system


5

4.5

3.5

3
magnitude

2.5

1.5

0.5

0
-5 0 5 10 15 20
sampels
We convolved input signal and system impulse response to find output. Conv command is used
to convolve the two signals to find output.

Task 2: The output of LTI system with an impulse response h(n) is multiplied by a unit step function u(n)
to yield the output of the overall system as shown in Fig 1. Write MATLAB code for output of the overall
system for the input shown in Fig.2 for −20 ≤ 𝑛 ≤ 20

clc;
close all;
clear all;
n=-20:20;
n1=-17:18;
x=[6 5 4 3 2 1];
u1=[zeros(1,7) ones(1, 29)];
h=(0.25.^n1).*u1;
y1=conv(x,h);
u=[zeros(1,20) ones(1,21)];
y=y1.*u;
stem(n,y);
xlabel('sampels')
ylabel('magnitude')
title('Overall Output of LTI system')
Overall Output of LTI system
30

25

20
magnitude

15

10

0
-20 -15 -10 -5 0 5 10 15 20
sampels

we convolved input signal and system response and then multiply by unit step to find overall
output.

You might also like