0% found this document useful (0 votes)
77 views7 pages

Ss Lab10

This document describes an lab experiment on Z-transforms and inverse Z-transforms. The objectives are to understand and implement the Z-transform, check stability of discrete systems using Z-transforms, compute impulse responses from transfer functions, and compute inverse Z-transforms. Several examples are provided to demonstrate how to compute Z-transforms, pole-zero diagrams, frequency responses, and inverse Z-transforms using MATLAB. As tasks, students are asked to repeat an example with a different transfer function and compute an impulse response.

Uploaded by

AaqibR
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
77 views7 pages

Ss Lab10

This document describes an lab experiment on Z-transforms and inverse Z-transforms. The objectives are to understand and implement the Z-transform, check stability of discrete systems using Z-transforms, compute impulse responses from transfer functions, and compute inverse Z-transforms. Several examples are provided to demonstrate how to compute Z-transforms, pole-zero diagrams, frequency responses, and inverse Z-transforms using MATLAB. As tasks, students are asked to repeat an example with a different transfer function and compute an impulse response.

Uploaded by

AaqibR
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Mehran University Of Engineering & Technology, Szab Campus, Khairpur Mirs

Department Of Electrical Engineering


Signals and systems
Lab #10
Name: ____________________________________ Roll No: ______________________

Score: ________________ Signature: __________ Date: _______________

Z TRANSFORM AND INVERSE Z TRANSFORM


OBJECTIVES:
Following are the main objectives of this lab.
 To understand & implement the Z-transform.
 To check the stability of a discrete time system using Z-transform.
 To compute and plot impulse response of the transfer function.
 To compute inverse Z-transform

EQUIPMENT:

 IBM compatible computer
 MATLAB

DISCUSSION:

In mathematics and signal processing, the Z-transform converts a discrete time-


domain signal, which is a sequence of real or complex numbers, into a complex
frequency-domain representation.
The Z-transform, like many other integral transforms, can be defined as either a one-sided
or two-sided transform.

Unilateral Z transform
Alternatively, in cases where x[n] is defined only for n ≥ 0, the single-sided or
unilateral Z- transform is defined as

𝑋(𝑍) = ∑ 𝑥[𝑛]𝑍−𝑛
𝑛=0
Bilateral Z-transform
The bilateral or two-sided Z-transform of a discrete-time signal x[n] is the function
X(z) defined as

𝑋(𝑍) = ∑ 𝑥[𝑛]𝑍−𝑛
𝑛=−∞
The z-transform is the discrete-time counter-part of the Laplace transform and a
generalization of the Fourier transform of a sampled signal. The z-transform allows insight into
the transient behavior, the steady state behavior, and the stability of discrete-time
systems. A working knowledge of the z-transform is essential to the study of digital filters and
system
Stability of a system
A system is said to be stable if the poles lie inside of a unit circle on the z-plane.

Z transform

Programs:

Example: 01

(𝑛) = (1/16)n u(n)

syms Z n
a=ztrans(1/16^n)
pretty (a)

Example:02

syms n
f=sin(n);
r=ztrans(f);
disp('z trans using function')
disp(r)

Example:03
Use the following MATLAB code to determine z-transform of the signal
x[n] = [3(2n) – 4(3n)]u[n].
syms n x
x=(3*(2.^n)-4*(3.^n));
F = ztrans(x)
Pretty(F)
POLE ZERO DIAGRAM FOR A FUNCTION IN Z DOMAIN

Z plane command computes and display the pole-zero diagram of Z function.

The Command is Zplane(b,a)

To display the pole value, use root(a)


To display the zero value, use root(b)

Example:04
The following example illustrates the use of MATLAB to compute zero and poles of a transfer
function and to plot them onto the z-plane.
Find poles and zeros of the following pulse transfer function and plot them onto the z-plane.
2−z−1
H ( z )=
1−0 . 1 z −1 −0 . 02 z −2

num = [2 -1]; % numerator of H(z)


den = [1 -0.1 -0.02]; % denominator of H(z)
zplane(num,den)

On the z-plane, “x” indicate the poles and “0” indicate the zeros.

Example:05

Find the z transform of the given sequence:

syms n;
f = ((-1).^n)*2^-n
ztrans(f)

Example:06

Plot the pole zero diagram of:

z=[0 ]
p=[0.5;-75]
zplane(z,p)

Example:07

Matlab Code:

b=[0 1 1 ]
a= [1 -2 +3]
roots(a)
roots(b)
zplane(b,a);

Example:08

Following program plot the impulse response using ‘impz’ function


−1
1+2 z
H ( z)=
1+0 . 4 z−1 −0 .12 z−2
L = 11; % Length of output vector
num = [1 2];
den = [1 0.4 -0.12];
[y, t] = impz(num,den,L);
stem(t,y)

FREQUENCY RESPONSE:
The Freqz function computes and display the frequency response of given Z- Transform of
the function

freqz(b,a,npt,Fs)
b= Coeff. Of Numerator
a= Coeff. Of Denominator
Fs= Sampling Frequency
Npt= no. of free points between and Fs/2

Matlab Code

b=[2 5 9 5 3];
a= [5 45 2 1 1];
freqz(b,a);

Example:09

Plot the magnitude and phase of the frequency response of the given digital filter
Using freqz function:
Y(n) = 0.2x(n) + 0.52y(n-1) – 0.68(y(n-2)
Matlab Code:

b = [0.2];
a= [1, -0.52, 0.68];
w = [0:1:500]*pi/500;
H=freqz(b,a,w);
magH = abs(H);
phaH = angle(H)*180/pi;
subplot(2,1,1);
plot(w/pi,magH);
title('Magnitude Response');
xlabel('frequency ');
ylabel('│H│');
subplot(2,1,2);
plot(w/pi,phaH);
title('Phase Response');
xlabel('frequency');
ylabel('Degrees');

Example:10
Write a program to perform the z transform on user defined sequence
syms z
a=input('input sequence');
x=0;
n=length(a);
for i=1:n;
x=x+a(i)*z^-(i-1); % x=x+a(i)*z^-(i-3) when x[n] starts with n=-2.
end
disp('z-trasnform of the sequence is')
display(x)

Example:11

linearity property
If X(n) and Y(n) having Z-transform X(z) and Y(z) respectively, and and b are arbitrary
constants,

then:
clc;
close all;
clear all;
syms Z n
a1=1/2;
a2=1/2;
f1=n;
f2=n;
display('z-transform of first function')
ft1=a1*f1;
fs1=ztrans(ft1)
display('z-transform of second function')
ft2=a2*f2;
fs2=ztrans(ft2)
display('sum of the first and second s domain function')
fs12=fs1+fs2
display('z-transform of the sum of (first and second) time domain function')
ft=((a1*f1)+(a2*f2));
fs=ztrans(ft)
display('fs12 and fs are same which verifies the property of linearity')

INVERSE Z-TRANSFORM
Syntax
f=izatrans(F)
DESCRIPTION:
f=izatrans(F) is the inverse z-transform of scalar symbolic object F with default independent
variable z. the default return is a function of n.

example:
2z
The following piece of code finds the inverse z-transform of x(n)=
2 z−1
syms z n
iztrans((2*z)/(2*z-1))

output will be;


ans =

(1/2)^n

As we know, there are two methods to find inverse z-transform:


(a) Partial fraction method
(b) Power series method

MATLAB has build-in functions to find the inverse z-transform by using both of the
above methods.

Partial Fraction Method:

We can determine the partial fraction by using MATLAB function residuez(num,den);

Power Series Method:

To find inverse z-transform by power series, one may use the built-in function “impz”.
Use on-line help facility of MATLAB to find-out more about this built-in function. That
is, type
help impz
You may also use MATLAB function “filter” for the same purpose.
Following program determines the partial fraction of the following expansion using
‘residuez’funciton

num=[18 0 0 0];
den = [18 3 -4 -1];
[r, p, k] = residuez (num,den);
disp(‘Residues’);
disp(r)
disp(‘Poles’);
disp(p)
disp(‘Constants’);
disp(k)

The result of your program should be as under:

TASKS:
1:

Repeat example 4 for


2 . 25−2 .1 z−1 −3. 95 z−2 −1. 6 z−3 −0 .2 z−4
H ( z )=
4−2 . 96 z−1 +0 . 8 z −2 −0 . 1184 z−3 −0 .0064 z −4

2:

Compute the impulse response of the given transfer function using dimpulse command
2 . 25−2 .1 z−1 −3. 95 z−2 −1. 6 z−3 −0 .2 z−4
H ( z )=
4−2 . 96 z−1 +0 . 8 z −2 −0 . 1184 z−3 −0 .0064 z −4
Review Questions:

1. Define the unit impulse response of the system?

Final Check List:

 Save your programs & turn off PC.


 Submit your answers to questions, and results before the next laboratory.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy