Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
102 views

Lab 05-The Z Transform: Objectives: Time Required: 3 Hrs Programming Language: MATLAB Software Required

This lab document provides instructions on using MATLAB to analyze signals and systems using the Z-transform. It discusses the Z-transform and its properties. It also describes functions like tf, tf2zp, zp2tf, residuez, zp2sos and impz that can be used to analyze systems in the Z-domain. Exercises are provided to help students practice converting between time and Z-domain representations and determining stability.

Uploaded by

Aleena Qureshi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
102 views

Lab 05-The Z Transform: Objectives: Time Required: 3 Hrs Programming Language: MATLAB Software Required

This lab document provides instructions on using MATLAB to analyze signals and systems using the Z-transform. It discusses the Z-transform and its properties. It also describes functions like tf, tf2zp, zp2tf, residuez, zp2sos and impz that can be used to analyze systems in the Z-domain. Exercises are provided to help students practice converting between time and Z-domain representations and determining stability.

Uploaded by

Aleena Qureshi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

1|Page Digital Signal Processing

Lab 05-The Z Transform

Lab Engineer: Muhammad Hammad

1 Objectives:
. The goal of this laboratory is to gain familiarity with the Z Transform of the signals and systems
2 Time Required: 3 hrs
.
3 Programming Language: MATLAB
.
4 Software Required:
. (a). MATLAB 7 or above
.

Laplace transform can be considered to be a generalization of the Fourier Transform (FT) in the
continuous-time domain. Similarly, in the discrete-time domain, Z-transform is a generalization of
the discrete-time Fourier Transform (DTFT). Z-transform plays an important role in both analysis
and design of discrete-time systems. It provides another domain in which signals and systems can be
investigated.

The two–sided or bilateral Z-transform can be written as the following summation

X(Z)=∑∞
𝑛=−∞ 𝑥 [𝑛]𝑍
−𝑛

or notationally as X(Z) = X{X[n]}. Two important properties of Z-transform are apparent from its
definition. First, this transform is linear. Its second property enables the treatment of shifted
sequences, i.e.

X[n] => X(z) Thus X [n-k] => 𝑍 −𝑘 X(Z)

Z-transform has many other valuable properties that make it a powerful analysis tool. One of the
most important properties is the equivalence of convolution of two sequences and the multiplication
of Z-transform in the transform domain, i.e.
X[n] * Y[n] => X(Z)Y(Z)

Where * id the convolution operator in time domain.

By expressing the complex variable Z in the polar form as 𝑍 = 𝑟𝑒 𝑗𝜔 , Z-transform has an


interpretation in terms of Fourier transform. With Z so expressed, the Z-transform becomes
2|Page Digital Signal Processing

∞ ∞

𝑋(𝑟𝑒 𝑗𝜔 ) = ∑ 𝑥[𝑛](𝑟𝑒 𝑗𝜔 )−𝑛 = ∑ 𝑥[𝑛]𝑟 −𝑛 𝑒 −𝑗𝜔𝑛


𝑛=−∞ 𝑛=−∞

If r=1, i.e. |Z| =1, the Z transform is equal to DTFT of the sequence x[n]. Z Transform plays role in
the design and analysis of discrete time systems. Fourier transform is used for conversion of time
domain to frequency domain while Z transform is used for conversion of time domain into the
complex domain. If DTFT of the X[n] exists, it should be convergent (stable) sequence. DTFT does
not exist for non convergent sequences e.g.
1
For x [n] = an u(n) , DTFT is −𝑗𝜔
for |a| < 1
1−𝑎 𝑒

The system will be unstable for |a| > 1 and its DTFT wont exist but its Z transform will exist. If the
region of convergence (ROC) of a system covers the unit circle than system will be stable or un
stable otherwise. Fourier transform for the sequence 2nu(n) is not possible. To handle this, we use
another factor r.
2 𝑛 2 𝑛
(𝑟 ) 𝑢(𝑛) => DTFT => ∑∞
𝑛=−∞ (𝑟 ) 𝑒
−𝑗𝜔𝑛
|r| should be >2 for the system to be stable
1
 2
(1−( )𝑒 −𝑗𝜔𝑛
𝑟

From Fourier transform We get ∑∞ 𝑛 −𝑛 −𝑗𝜔𝑛


𝑛=−∞(2 𝑟 )𝑒 => (2)𝑛 (𝑟𝑒 𝑗𝜔 )−𝑛 where 𝑧 = 𝑟𝑒 𝑗𝜔
1
Thus in this case 𝑋(𝑍) = (1−2𝑧 −1 )
, pole is at Z=2 and ROC >2 so this is unstable sequence

The pole zero plot of rational Z Transform G(Z) can be obtained in matlab using the function
Zplane. The function freqz can be used to evaluate the values of a rational z transform on the unit
circle.
Exercise 1: Evaluate the following Z transform on the unit circle using program 1 of Lab 5

There are two versions of the function zplane. If the function is given in rational form in terms of
numerator and denominator, the command to use is zplan(num,den) where num and den are row
vectors containing the coefficients. If the zeros and poles of G(Z) are given the command to use is
zplane(zeros,poles) where zeros and poles are column vectors. In the pole zero plot generated my
MATLAB, poles are plotted as X and zeros as o. the function tf2zp can be used to determine the poles
and zeros of rational z transform G(Z)
3|Page Digital Signal Processing

Program to check the stability of system

disp('stability');
nr=input('input the numerator coefficients:');
dr=input('input the denominator coefficients:');
z=tf(nr,dr,1)
[r,p,k]=residuez(nr,dr)
figure
zplane(nr,dr);
if abs(p)<1
disp('the system is stable');
else
disp('the system is unstable');
end;

Explore the usage of functions tf ,tf2zp,zp2tf, residuez ,zp2sos and their return values by finding the
help of MATLAB .

Example :
Express the following z-transform in factored form, plot its poles and zeros and then
determine the ROC.

2𝑧 4 + 16𝑧 3 + 44𝑧 2 + 56𝑍 + 32


𝐺(𝑍) =
3𝑧 4 + 3𝑧 3 − 15𝑧 2 + 18𝑧 − 12

we can use a matlab program like the one below:

num = input(`Type in the numerator coefficients =`)


den = input(`Type in the denominator coefficients =`)
[z,p,k]=tf2pz(num,den)
m = abs(p) % to find distance from origin of poles
disp(`Zeros are at`); disp(z);
disp(`poles are at`); disp(p);
disp(`gain constant`); disp(k);
disp(`Radius of poles`); disp(m);
sos= zp2sos(z,p,k);
disp(‘Second order sections’);disp(real(sos));
zplane(num,den)
4|Page Digital Signal Processing

Exercise 2: Write a MATLAB program to compute and display the poles and zeros, to compute and
display the factored form, and to generate the pole-zero plot of a z-transform that is a ratio of two
polynomials in z−1. Using this program, analyze the z-transform G(z) of given Eq.

Exercise 3: From the pole-zero plot generated in Question Q5, determine the number of regions of
convergence (ROC) of G(z). Show explicitly all possible ROCs . Can you tell from the pole-zero plot
whether or not the DTFT exists?

Inverse z-Transform

The inverse g[n] of a rational z-transform G(z) can be computed using MATLAB in basically two
different ways . To this end, it is necessary to know a priori the ROC of G(z).

The function impz provides the samples of the time-domain sequence, which is assumed to be causal.
There are three versions of this function: [g,t] = impz(num,den), [g,t] impz(num,den, L), and [g,t] =
impz(num,den, L, FT), where num and den are row vectors containing the coefficients of the
numerator and denominator polynomials of G(z) in ascending powers of z−1, L is the desired number
of the samples of the inverse transform, g is the vector containing the samples of the inverse transform
starting with the sample at n = 0, t is the length of g, and FT is the specified sampling frequency in
Hz with default value of unity.
A closed-form expression for the inverse of a rational z-transform can be obtained by first performing
a partial-fraction expansion using the function residuez and then determining the inverse of each term
in the expansion by looking up a table of z-transforms. The function residuez can also be used to
convert a z-transform given in the form of a partial-fraction expansion to a ratio of polynomials in
z−1.

Exercise 4: Write a MATLAB program to compute the first L samples of the inverse of a rational z-
transform where the value of L is provided by the user through the command input. Using this
program compute and plot the first 50 samples of the inverse of G(z) of Eq. given. Use the command
stem for plotting the sequence generated by the inverse transform.
Exercise 5: Write a MATLAB program to determine the partial-fraction expansion of a rational z-
transform. Using this program determine the partial-fraction expansion of G(z) of Eq. given and then
its inverse z-transform g[n] in closed form. Assume g[n] to be a causal sequence.
5|Page Digital Signal Processing

Summary: This lab gives a tutorial about generating Z transform of discrete time signals in
MATLAB.

Instructions:
1. Do it yourself.
2. Attach Extra sheets for the problems which should include the code and its results screen shots.
3. Submit it before leaving until been specified by teacher
4. After marking, these will be deposited with teacher for record.

Name of Student, Student ID, Class and Section: ___________________________________


Feed Back by Student: (Please do not complain about less time)

Marks Obtained & Observation by Lab Engineer: ________________________________________

Dept. EE Military College of Signals, NUST

You might also like