You are on page 1of 3

To find the impulse response of an LTI system, given the input &

output sequence
clc;
close all;
clear all;
y= input('The output sequence y(n) of the system=');
x=input('the input sequence of the system=');

Compute the Deconvolution


[h,r]=deconv(y,x);
disp('the impulse response of the system is=');

the impulse response of the system is=

disp(h);

1 1 1

disp('The remainder is=');

The remainder is=

disp(r);

0 0 0 -2 0 0

Plotting the results


N=length(h);
n=0:1:N-1;
stem(n,h);
xlabel('Time index n');
ylabel('Amplitude');
title('Impulse response of a system')

1
Verification
yv=conv(x,h)+r;
disp('The verified output sequence is');

The verified output sequence is

disp(yv)

1 2 1 -1 0 1

Inference
%% The impulse response h[n] is of finite duration.
%%The verified convolution output sequence is the same as the given y[n].

To find impulse response of a system for the given difference


equation

clc;
close all;
clear all;
N=input('Length of impulse response required=');

2
x[n] coefficient
b=[1];

y[n] coefficients
a=[1,-1,0.9];

Impulse response
h=impz (b,a,N);

Plot of Impulse Response Sequence


n=0:N-1;
stem (n,h);
title('impulse response');
xlabel('n');
ylabel('h(n)');

Inference
%%The impulse response h[n] is of infinite duration. h[n] is stable

You might also like