You are on page 1of 2

ELECTRONICS & COMMUNICATION

SEM. 7thBATCH- _
ENROLLMENT NO.
GOVERNMENTENGINEERINGCOLLEGE
BHAVNAGAR-364001

EXPERIMENT-2

AIM: Find Impulse response of a given system

OBJECTIVE: Impulse response.

SOFTWARE: MATLAB.

THEORY:

Impulse response of a system

C the impulse response, or impulse response function (IRF), of a dynamic system is its output when
presented with a brief input signal, called an impulse.

Impulse response of a system is defined as,


𝑦(𝑡) = ∫ ℎ(𝑡)𝑥(𝑡 − 𝑘)𝑑𝑘


−∞

Here if h(t) is impulse then the output of this is impulse response of the system.

Below is the block diagram of impulse response.

x(t) y(t)
h(t)

Here x(t) is the input, h(t) is the impulse response and y(t) is output.

CODING:

clc %clear command window ;


clear %clear workspace
b=input('Enter the coefficients of x(n) in the order x(n),x(n-1)...in the Matrix form = '); %input for
variable b
a=input('Enter the coefficients of y(n) in the order y(n),y(n-1)...in the Matrix form = '); %input for
variable a
n=[-5:20]; %defining range for n
x=[(n==0)]; %defining impulse
h=filter(b,a,x) %creating output y
ELECTRONICS & COMMUNICATION Page-
FACULTY NAME: JANAK D. TRIVEDI
DSP LAB
figure(1); %labelling figure
subplot(2,1,1); %differentiating graph in subplots
stem(n,x); %plotting discrete graph for n and x
xlabel('n'); %defining name for x-axis
ylabel('amplitude'); %defining name for y-axis
title('impulse sequence'); %title for graph
subplot(2,1,2); % differentiating graph in subplots
stem(n,h); %plotting discrete graph for n and x
xlabel('n'); %defining name for x-axis
ylabel('amplitude'); %defining name for y-axis
title('impulse response'); %title for graph

SIMULATION RESULT:

CONCLUSION:

You might also like