You are on page 1of 4

Ninevah University

College of Electronics Engineering


Systems & Control Engineering Department
SCE3201 Digital Signal Processing-I Lab.

Exp. No. 2 Impulse Response of LTI Systems


Digital Signal Processing-I Experiment No. 2

Introduction

The Signal Processing Toolbox is a collection of tools built on the MATLAB® numeric
computing environment. The toolbox supports a wide range of signal processing operations,
from waveform generation to filter design and implementation, parametric modeling, and
spectral analysis. The toolbox provides two categories of tools:
 Signal processing command line functions
 A suite of graphical user interfaces for:
-Interactive filter design
-Signal plotting and analysis
-Spectral analysis
-Filtering signals
-Analyzing filter designs

In MATLAB, you can generate an impulse sequence by a number of ways; one straightforward
way is using the impz command, let’s explain this method by the following steps:
1. From the signal flow-graph we should first find the difference equation of the system.
2. After that, taking all coefficients of the output to the right side of the equation and all the
input coefficients to the left side.
3. Storing all input coefficients in one vector, called ‘b’.
4. Storing all output coefficients in one vector, called ‘a’.
5. Now by using the command ‘IMPZ’ which can find the impulse response of any LTI
system and store the rustle in the vector ‘H’.

IMPZ Impulse response of LTI digital system


[H,T] = IMPZ(B,A) computes the impulse response of the system B/A choosing the number of
samples for you, and returns the response in column vector H and a vector of times (or sample
intervals) in T
(T = [0 1 2 ...]'), T=n.

[H,T] = IMPZ(B,A,N) computes N samples of the impulse response. If N is a vector of integers,


the impulse response is computed only at those integer values (0 is the origin).
Digital Signal Processing-I Experiment No. 2

Objective:
Write a MATLAB program to find the impulse response of a LTI system defined by a difference
equation.

Procedures:

1. Write a MATLAB programs using IMPZ command to find and draw the impulse
response of the following system:

𝑥(𝑛) 𝑦(𝑛)

−0.9

𝑍 −1

𝑦 𝑛 = 𝑥 𝑛 − 0.9𝑦 𝑛 − 1

𝑥 𝑛 = 𝑦 𝑛 + 0.9𝑦 𝑛 − 1
Input coefficients {1}
Output coefficients {1, 0.9}
clc;
clear all;
close all;

N = input ('Enter the required length of impulse response N = ');


n = 0 : N-1;
b = input ('Enter the coefficients of x(n), b = ');
a = input ('Enter the coefficients of y(n), a = ');

% Impulse response of the LTI system given by the difference equation


h = impz (b,a,N);
stem (n,h,'r');
xlabel ('time');
Digital Signal Processing-I Experiment No. 2

ylabel ('amplitude');
title ('IMPULSE RESPONSE');
grid on;

Enter the required length of impulse response N = 10


Enter the co-efficients of x(n), b = [1]
Enter the co=efficients of y(n), a = [1 0.9]

2. Write a MATLAB program to find and plot the following system difference equations:
a. 𝑦 𝑛 = −0.25𝑦 𝑛 − 3 − 0.7𝑦 𝑛 − 2 + 3𝑥(𝑛) – 0.9𝑥(𝑛 − 1) + 1.3𝑥(𝑛 − 2)
b. 𝑦(𝑛) – 𝑦(𝑛 − 1) = 𝑥(𝑛) – 𝑥(𝑛 − 1)
c. 𝑦 𝑛 = 𝑦 𝑛 − 2 − 2𝑥(𝑛) – 𝑥(𝑛 − 2)

Discussion

1. For the following system, find the first three samples of its impulse response. Then if the
input 𝑥 𝑛 = {1, 0, −1,1.5} find the output.

You might also like