Digital Signal Processing: LAB # 05 Inverse Z-Transform and Filter Response Computation Using Matlab

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Digital Signal Processing

LAB # 05

Inverse z-Transform and filter response computation using


MATLAB

Date: 19-11-2021

Name: Muhammad Hunzilah Ahmad

Session: BSEE 2018-2022(Electronics)

Instructors: Dr. Sufi Tabassum Gul

Engr. Javeria Ayub

Engr. Ayesha Ashraf

Department of Electrical Engineering

Pakistan Institute of Engineering and Applied Sciences

Nilore, Islamabad
6.1 Objectives
• To determine inverse z-transform.
• To compute frequency response of moving average filter.
6.2 Equipment
• Computer / laptop
• MATLAB software
6.3 Useful Matlab functions

impz, filter, freqz, abs, angle
• subplot, input, stem
6.4 Tasks

1. Determine inverse z-transform using impz() command.

𝐳(𝐳+𝟐.𝟎)
H(z) = (𝐳−𝟎.𝟐)(𝐳+𝟎.𝟔)

MATLAB Code

z = tf('z');
H = z*(z+2)/((z-0.2)*(z+0.6));
[num, den] = tfdata(H,'v');
[h,t] = impz(num,den);
impz(num,den)
2. Determine inverse z-transform using filter () command.
MATLAB CODE

l = 20; % length of output vector


num = [1 2];
den = [1 0.4 -0.12];
a = [1 zeros(1,l-1)];
b = filter(num ,den ,x)
stem(b)

RESULTS

3. Generate filter coefficients and compute frequency response of moving average


filter.
MATLAB CODE

den= 1; % denominator of cofficients

num = 0:0.1:1; % numerator of cofficients

a= tf(num,den);

w = -10:0.01:10;

x = [4 3 2 1 1 2 3 4]; %Input data points

y = filter (num,den,x) %filter coefficients

freqz(y,w) %frequency response plot


Results
Filter coefficients

frequency response of moving average filter

You might also like