Islamic University of Gaza Faculty of Engineering Electrical Engineering Department ENG.MOHAMMED ELASMER Spring-2012 ______________________________________________________________________________ DSP Laboratory (EELE 4110) Lab#4 Z-transform OBJECTIVES: Our aim is to become familiar with: Z-transform and its properties Inverse of Z-transform Using Z-transform in solving difference equations. THE BILATERAL Z-TRANSFORM The z-transform is useful for the manipulation of discrete data sequences and has acquired a new significance in the formulation and analysis of discrete-time systems. It is used extensively today in the areas of applied mathematics, digital signal processing, control theory, population science, economics. These discrete models are solved with difference equations in a manner that is analogous to solving continuous models with differential equations. The role played by the z-transform in the solution of difference equations corresponds to that played by the Laplace transforms in the solution of differential equations. The z-transform of a sequence x (n) is given by: = = ()− ∞ =−∞ Where z is a complex variable. The set of z values for which X (z) exists is called the region of convergence (ROC) . The inverse z-transform of a complex function X(z) is given by: = −1 []= 1 2−1 Where C is a counterclockwise contour encircling the origin and lying in the ROC. Notes: 1) The complex variable z is called the complex frequency given by =||where |z| is the attenuation and is the real frequency.
14
Embed
DSP Laboratory (EELE 4110) Lab#4 Z-transformsite.iugaza.edu.ps/sqalaja/files/2016/09/Lab4_dsp_2011.pdf · Using the conv_m function developed in Lab 3, we can also multiply two z-domain
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Islamic University of Gaza
Faculty of Engineering Electrical Engineering Department
يعني لو كان ROC القديم هو z>2 مثلا يصبح بعد عملية scaling كالتالي z>2a
matrix
Highlight
matrix
Highlight
matrix
Highlight
matrix
Sticky Note
الرجاء قراءة المعلومات الموجودة في help على امر conv هنا امر conv يستعمل لضرب اقترانيين في z عندما تكون seq تبداء من الصفر و لكن يمكن استعمال conv_m عندما تكون seq لا تبداء من الصفر
Using the conv_m function developed in Lab 3, we can also multiply two z-domain
polynomials corresponding to non-causal sequences.
الان هنا نريد ان نقسم اقترانيين في z لذلك نستخدم امر deconv المعرف في الماتلاب هنا x3=x2*x1
matrix
Highlight
matrix
Highlight
matrix
Highlight
matrix
Sticky Note
هنا نعكس conv_m و ذلك واضح في تحديد نقطة البداية ونقطة النهاية لاحظ التشابه الكبير بين conv_m و deconv_m
The second important use of the convolution property is in system output
computations as we shall see in a later section. This interpretation is particularly
useful for verifying the z-transform expression X (z) using MATLAB. Note that since
MATLAB is a numerical processor (unless the Symbolic toolbox is used), it cannot be
used for direct z-transform calculations. We will now elaborate on this. Let x (n) be a
sequence with a rational transform
Where B (z) and A (z) are polynomials in z-1
. If we use the coefficients of B(z) and
A(z) as the b and a arrays in the filter routine and excite this filter by the impulse
sequence (n),the output of the filter will be x(n). (This is a numerical approach of
computing the inverse z-transform; we will discuss the analytical approach in the next
section.) We can compare this output with the given x(n) to verify that X(z) is indeed
the transform of x(n). This is illustrated in Example 4.6.
SOME COMMON Z-TRANSFORM PAIRS:
Using the definition of z-transform and its properties, one can determine z-transforms
of common sequences. A list of some of these sequences is given in Table 6.1.
Table 4.1
( )( )
( )
B zX z
A z
matrix
Highlight
EXAMPLE 4.6
Using z-transform properties and the z-transform table, determine the z-transform of
𝑥 𝑛 = 𝑛 − 2 0.5 𝑛−2 𝑐𝑜𝑠 𝜋
3 𝑛 − 2 𝑢(𝑛 − 2)
Solution:
Applying the sample-shift property,
𝑍 𝑐𝑜𝑠 𝜋
3𝑛 𝑢(𝑛) =
1 −12 𝑧
−1
1 − 𝑧−1 + 𝑧−2 , 𝑧 > 1
Frequency shifting: 𝑍 𝑎𝑛𝑥 𝑛 = 𝑋 𝑧
𝑎 ;𝑅𝑂𝐶:𝑅𝑂𝐶𝑥 𝑠𝑐𝑎𝑙𝑒𝑑 𝑏𝑦 |𝑎|
𝑍 0.5 𝑛𝑐𝑜𝑠 𝜋
3𝑛 𝑢(𝑛) =
1 −12
𝑧0.5
−1
1 − 𝑧
0.5 −1
+ 𝑧
0.5 −2 =
1 −14 𝑧
−1
1 −12 𝑧
−1 +14 𝑧
−2 , 𝑧 >
1
2
Differentiation in the z-domain: 𝑍 𝑛𝑥 𝑛 = −𝑧𝑑𝑋 (𝑧)
𝑑𝑧 ;𝑅𝑂𝐶:𝑅𝑂𝐶𝑥
𝑍 𝑛 0.5 𝑛𝑐𝑜𝑠 𝜋
3𝑛 𝑢(𝑛) = −𝑧
𝑑
𝑑𝑧
1 −14 𝑧
−1
1 −12 𝑧
−1 +14 𝑧
−2 , 𝑧 >
1
2
Sample shifting:𝑍 𝑥 𝑛 − 𝑛𝑜 = 𝑧−𝑛𝑜𝑋 𝑧 ; 𝑅𝑂𝐶: 𝑅𝑂𝐶𝑥
𝑍 𝑛 − 2 0.5 𝑛−2 𝑐𝑜𝑠 𝜋
3 𝑛 − 2 𝑢(𝑛 − 2) = 𝑧−2 −𝑧
𝑑
𝑑𝑧
1 −14 𝑧
−1
1 −12𝑧−1 +
14𝑧−2
𝑋 𝑧 =0.25𝑧−3 − 0.5𝑧−4 + 0.0625𝑧−5
1 − 𝑧−1 + 0.75𝑧−2 − 0.25𝑧−3 + 0.0625𝑧−4
Hence
MATLAB verification:
To check that the above X (z) is indeed the correct expression, let us compute the first
8 samples of the sequence x (n) corresponding to X(z) as discussed before.
>> b = [0,0,0,0.25,-0.5,0.0625]; a=[1,-1,0.75,-0.25,0.0625,0];
>> [delta,n]=impseq(0,0,7)
>> x= filter(b,a,delta) %check sequence
x = 0 0 0 0.25 -0.25 -0.375 -0.125 0.0781
matrix
Highlight
matrix
Sticky Note
مثال هام جدا يجمع اكثر من خاصية في نفس الوقت و تاثيرها على ROC
matrix
Highlight
matrix
Sticky Note
الان الفكرة هنا تتلخص في ان: 1-امر filter يستخدم لحل المعادلة diffrance 2- معاملات البسط في T.F هي عبارة عن معاملات input في diffrance equ معاملات المقام هي معاملات output في diffrance equ 3- الان لو استخدمنا امر الفلتر لتاكد من الحل من خلال فرض ان x(z) هي عبارة عن T.F و جعلنا input عبارة عن impulse سيكون output عبارة عن x(z)
This approach can be used to verify the z-transform computations.
INVERSION OF THE Z-TRANSFORM
The inverse z-transform computation requires an evaluation of a complex contour
integral that, in general, is a complicated procedure. The most practical approach is to
use the partial fraction expansion method. It makes use of the z-transform Table 4.1
(or similar tables available in many textbooks.) The z-transform, however, must be a
rational function. This requirement is generally satisfied in digital signal processing.
EXAMPLE 4.7
Find the inverse z-transform of x (z)
𝑋 𝑧 =𝑧
3 𝑧2 −43𝑧 +
13
𝑋 𝑧
𝑧=
1
3 𝑧2 −43 𝑧 +
13
=
12
𝑧 − 1−
32
3𝑧 − 1
𝑋 𝑧 =
12 𝑧
𝑧 − 1−
32 𝑧
3𝑧 − 1=
12
1 − 𝑧−1−
12
1 −13 𝑧
−1
𝑋 𝑧 =1
2
1
1 − 𝑧−1 −
1
2
1
1 −13 𝑧
−1
Now, X (z) has two poles: z1 = 1 and z2 = 1/3 and since the ROC is not specified,
there are three possible ROCs as shown in Figure 4.4.
Figure 4.4 The ROC in Example 4.7
ROC1 1 < 𝑧 < ∞
𝑥 𝑛 = 1
2−
1
2
1
3 𝑛
𝑢(𝑛) right-sided sequence
ROC2 0 < 𝑧 <
1
3 𝑥 𝑛 = −
1
2𝑢 −𝑛 − 1 +
1
2
1
3 𝑛
𝑢(−𝑛 − 1) left-sided
sequence
ROC3 1
3< 𝑧 < 1 𝑥 𝑛 = −
1
2𝑢 −𝑛 − 1 −
1
2
1
3 𝑛
𝑢(𝑛) two-sided
sequence
matrix
Highlight
matrix
Highlight
matrix
Highlight
matrix
Sticky Note
اول خطوة هي دائما القسمة على z
matrix
Highlight
matrix
Highlight
MATLAB IMPLEMENTATION:
A MATLAB function residuez is available to compute the residue part and the
direct (or polynomial) terms of a rational function in z‟. Let
𝑋 𝑧 =𝑏𝑜 + 𝑏1𝑧
−1 + ⋯+ 𝑏𝑀𝑧−𝑀
𝑎𝑜 + 𝑎1𝑧−1 + ⋯+ 𝑎𝑀𝑧−𝑁=𝐵(𝑧)
𝐴(𝑧)
be a rational function in which the numerator and the denominator polynomials are in
ascending powers of z-1
. Then [R,p,C] =residuez (b , a) finds the residues,
poles, and direct terms of X (z) in which two polynomials B (z) and A (z) are given in
two vectors b and a, respectively. The returned column vector R contains the residues,
column vector p contains the pole locations, and row vector C contains the direct
terms.
Similarly, [b , a] =residuez (R, p , C), with three input arguments and two
output arguments, converts the partial fraction expansion back to polynomials with
coefficients in row vectors b and a.
EXAMPLE 4.8
To check our residue functions, let us consider the rational function:
𝑋 𝑧 =𝑧
3𝑧2 − 4𝑧 + 1
Given in Example 4.7.
First rearrange X (z) so that it is a function in ascending powers of z-1
.
𝑋 𝑧 =𝑧−1
3 − 4𝑧−1 + 𝑧−2 =
0 + 𝑧−1
3 − 4𝑧−1 + 𝑧−2
Now using MATLAB, >> b= [0,1,0]; a= [3,-4,1];
>>[R,p,C] = residuez(b,a)
R =
0.5000
-0.5000
p =
1.0000
0.3333
C =
[]
we obtain
𝑋 𝑧 =
12
1 − 𝑧−1−
12
1 −13 𝑧
−1
as before. Similarly, to convert back to the rational function form, >> R= [0.5,-0.5]; P= [1,1/3]; C=[];
>> [b,a] = residuez(R,p,C)
b = -0.0000 0.3333
a = 1.0000 -1.3333 0.3333
matrix
Highlight
matrix
Sticky Note
يمكن استخدامه لايجاد partial fraction expansion
matrix
Highlight
matrix
Highlight
matrix
Sticky Note
هنا b تمثل معاملات البسط او معاملات input هنا a تمثل معاملات المقام او معاملات output هناp تمثل poles هنا r تمثل قيمة البسط في كل حد من حدوو partial fraction
matrix
Sticky Note
هناك فرق كبير بين residuez و residue و ذلك ان الاول يقسم TF على z ثم يوجد partial fraction اما الثاني فلا لذلك تختلف قيمة معاملات input او b من امر لاخر
matrix
Sticky Note
انتبه في امر residuez يجب ان تكون a و b نفس الطول
matrix
Highlight
matrix
Sticky Note
يمكن استخدام امر residuez بالعكس اي ايجاد T.F من partial fraction
So that:
𝑋 𝑧 =0 +
13 𝑧
−1
1 −43 𝑧
−1 +13 𝑧
−2 =
𝑧
3𝑧2 − 4𝑧 + 1
EXAMPLE 4.9
Compute the inverse z-transform of
𝑋 𝑧 =1
1 − 0.9𝑧−1 2 1 + 0.9𝑧−1 , 𝑧 > 0.9
We can evaluate the denominator polynomial as well as the residues using MATLAB. >> b=[1 0 0 0]; a= poly([0.9,0.9,-0.9])
>> [R,p,C] = residuez(b,a)
a =
1.0000 -0.9000 -0.8100 0.7290
R =
0.2500
0.2500
0.5000
p =
-0.9000
0.9000
0.9000
C =
0
Note that the denominator polynomial is computed using MATLAB‟s polynomial
function poly, which computes the polynomial coefficients, given its roots. We could
have used the conv function, but the use of the poly function is more convenient for
this purpose. From the residue calculations and using the order of residues given in
(4.16), we have
𝑋 𝑧 =0.25
1 − 0.9𝑧−1+
0.5
1 − 0.9𝑧−1 2+
0.25
1 + 0.9𝑧−1 , 𝑧 > 0.9
𝑋 𝑧 =0.25
1 − 0.9𝑧−1+
0.5
0.9𝑧
0.9𝑧−1
1 − 0.9𝑧−1 2+
0.25
1 + 0.9𝑧−1 , 𝑧 > 0.9
Hence from Table 4.1 and using the z-transform property of time-shift,