0% found this document useful (0 votes)
20 views43 pages

Math3 - Ch08 - Z-Transform

math

Uploaded by

narendramodipm62
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)
20 views43 pages

Math3 - Ch08 - Z-Transform

math

Uploaded by

narendramodipm62
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/ 43

Complex Variable, Laplace and Z-Transformation

Lecture Note-8
The Z-Transformation

INTRODUCTION

A sequence is a list of numbers, sequences can be finite, like (1, 2, 3, 4) or infinite, like (1, 2, 3,
4, 5 . . .). We are interested in infinite sequences. These all have the general forms with the x k 's
standing for the numbers in the sequence. We use the short hand:

( x k )k =0 =( x 0 , x 1 , x 2 , …) .
The Z-transform is a transform for sequences. Just like the Laplace transform takes a function of
t and replaces it with another function of an auxiliary variable s, well, the Z-transform takes a
sequence and replaces it with a function of an auxiliary variable, z. The reason for doing this is
that it makes difference equations easier to solve, again, this is very like what happens with the
Laplace transform, where taking the Laplace transform makes it easier to solve differential
equations.

The subject of solving recurrence relations (difference equations) arise in many areas such as
combinatory, probability theory, discrete time control theory, economics etc. There are
several powerful methods available to solve these equations such as, summing factors,
generating functions, Z transformations, Operator methods etc. It has only been in the last few
decades that interest in the Z transform has evolved, mostly due to the rapid development of
integrated circuit technology and microprocessor architecture. Z-transform techniques have
now become a major tool in electrical, computer, and communication engineering.

In mathematics and signal processing, the Z-transform converts a discrete-time signal, which is a
sequence of real or complex numbers, into a complex frequency domain representation.

Z-TRANSFORM

The z-transform of a sequence x [n] is defined as



X ( z)= ∑ x [ n ] z−n .(1)
n=−∞

This equation is, in general, an infinite sum or infinite power series, with z being a complex
variable. Sometimes it is useful to consider Eq.(1) as an operator that transforms a sequence into
a function, and we will refer to the z-transform operator Z {}, defined as

Z { x [ n ] }= ∑ x [ n ] z−n=X ( z ) .(2)
n=−∞

With this interpretation, the z-transform operator is seen to transform the sequence x [n] into the
function X ( z), where z is a continuous complex variable. The correspondence between a
sequence and its z-transform is indicated by the notation

Page 1 of 43
Complex Variable, Laplace and Z-Transformation

x [ n ] z X ( z). (3)

The z-transform, as we have defined it in Eq.(1), is often referred to as the two-sided or


bilateral z-transform, in contrast to the one-sided or unilateral z-transform, which is defined as

X ( z )=∑ x [ n ] z −n .(4)
n=0

Clearly, the bilateral and unilateral transform are equivalent only if x [ n ] =0 for n<0.

For any given sequence, the set of values of z for which the z-transform converges is
called the region of convergence (ROC). The z-transform is most useful when the infinite sum
can be expressed in closed form, i.e., when it can be summed and expressed as a simple
mathematical formula. Among the most important and useful z-transforms are those for which
X ( z ) is a rational function inside the ROC, i.e.,

P( z)
X ( z )= ,(5)
Q(z)

Where P(z ) and Q(z ) are polynomials in z . The values of z for which X ( z )=0 are called the
zeros of X ( z), and the values of z for which X ( z ) is infinite are referred to as the poles of X ( z).
The poles of X ( z) for finite values of z are the roots of the denominator polynomial.

Discrete-Time Unit Step function

The definition and the wave form of the Discrete-Time Unit Step function u[n] are shown as:

{
u[n]= 0 , n<0
1, n ≥ 0

wheren is an integer.

Properties and Theorems of z-Transform

Page 2 of 43
Complex Variable, Laplace and Z-Transformation

In the following discussion, X ( z) denotes the z-transform of x [ n ], and the ROC of X ( z) is


denoted by R x; i.e.,

x [ n ] z X ( z ) , ROC =R x ,

Linearity property

a x 1 [ n ] +bx 2 [ n ] z aX 1 ( z ) +bX 2 ( z ) , ROC=R x ∩ R x , 1 2


where a, b are arbitrary real or complex constants.

Shift of x [ n ] in the Discrete-Time domain (Two-sided)


−m
x [ n−m ] z z X (z),

ROC=R x (except for the possible addition∨deletionof z=0∨z=∞)

The quantity m is an integer. If m is positive, the original sequence x [n] is shifted right, and if m
is negative, x [n] is shifted left.

The derivation of this property follows directly from the z-transform expression in Eq.(1). If
y [ n ] =x [n−m], the corresponding z-transform is
∞ ∞
Y ( z )= ∑ x [ n−m ] z = −n
∑ x [ k ] z−(m+k) (k=n−m)
n=−∞ k=−∞


Y ( z )=z −m
∑ x [ k ] z −k =z−m X ( z )
k=−∞

Left Shift of x [ n ] in the Discrete-Time domain (One-sided),

[ ]
m−1
x [ n+ m ] z z m X ( z )− ∑ x [ k ] z−k ,
↔ k=0

Proof:
∞ ∞
z { x [ n+m ] }=∑ x [ n+m ] z −n= ∑ x [ k ] z −(k−m) , assuming n+ m=k
n =0 k=m

[ ]
∞ m−1
¿ zm ∑ x [ k ] z−k −∑ x [ k ] z−k .
k=0 k=0

Page 3 of 43
Complex Variable, Laplace and Z-Transformation

[
So, Z { x [ n+1 ] }=z [ X ( z ) −x [ 0 ] ] , Z { x [ n+2 ] }=z X ( z )−x [ 0 ] −
2
z ]
x [1 ]
and so on.

Right Shift of x [ n ] in the Discrete-Time domain(one-sided)

This property is a generalization of the previous property, and allows use of non-zero values for
n< 0.
m
x [ n−m ] z z −m X ( z ) + ∑ x [−k ] z k ,
↔ k=1

Proof:
∞ ∞
z { x [ n−m ] } =∑ x [ n−m ] z−n = ∑ x [ k ] z −(m+k ) ,assuming n−m=k
n=0 k=−m

[∑ ] [ ]
−1 ∞ m
¿ z−m x [ k ] z−k ¿ ¿+ ∑ x [ k ] z−k = z−m X ( z ) + ∑ x [−k ] z k .
k=−m k=0 k=1

So, Z { x [ n−1 ] }=z −1 [ X ( z ) + x [ −1 ] z ] , Z { x [ n−2 ] }= z−2 [ X ( z ) + x [−1 ] z+ x [ −2 ] z 2 ] and so on.

Multiplication by a n in the Discrete-Time domain

an x [ n] z X

( az ) , ROC=|a|R , x

() ( az ) .
∞ ∞ −n
z
Z { an x [ n ] }= ∑ a n x [n] z−n= ∑ x [n]
a
=X
n=−∞ n=−∞

Multiplication by e−naT in the Discrete-Time domain

e−naT x [ n ] z X ( e aT z ) , ROC=|e−aT| R x .

Multiplication by n and n2 in the Discrete-Time domain

dX (z)
nx [ n ] z −z , ROC=R x .
↔ dz
2
d 2 d
n x[n] z z
2
X ( z)+ z 2
X (z ), ROC=R x .
↔ dz dz

Page 4 of 43
Complex Variable, Laplace and Z-Transformation

By definition,

X ( z)= ∑ x [ n ] z−n .
n=−∞

∞ ∞
d
X ( z )= ∑ (−n ) x [ n ] z−n−1=−z−1 ∑ nx [ n ] z −n=−z−1 Z {nx [ n ] }
dz n=−∞ n=−∞


d
Z { nx [ n ] }= ∑ nx [ n ] z−n =−z
dz
X (z).
n =−∞

Differentiating one more time, we obtain the second pair.

Convolution in the Discrete-Time domain.

According to the convolution property,

x 1 [ n ]∗x2 [ n ] z X 1 ( z ) X 2 ( z ) , ROC contains R x ∩ R x 1 2


The z-Transform of simple Discrete-Time sequence

Example 1 The transform of the geometric sequence (Right-sided exponential sequence).

Consider the signal x [ n ] =an u[n]. The geometric sequence is defined as

x [n ]=
{a0 n=−1
n
,−2 ,−3 … .
n=0 ,1 , 2 ,… … … .

Because it is nonzero only for n ≥ 0, this is an example of right-sided sequence. From Eq.(1),
∞ ∞

∑ a u [ n ] z =∑ ( az−1 ) (6)
n −n n
X ( z)=
n=−∞ n=0

The ROC is the range of values of z for which |a z −1|< 1, or equivalently, |z|>|a|. Inside the
ROC, the infinite series converges to

1 z
X ( z )=∑ ( a z ) =
−1 n
−1
= ,| z|>|a|(7)
n=0 1−a z z−a

For a=1 , x [n] is the unit step sequence with z-transform

1
X ( z )= −1
,|z|>1.(8)
1−z

Page 5 of 43
Complex Variable, Laplace and Z-Transformation

The pole-zero plot and the ROC for Example-1 are shown in Fig.1, where a “o” denotes the zero
and an “x” the pole.

Fig. 1

Example 2 Left-Sided Exponential sequence

Consider the signal x [ n ] =−a n u[−n−1]. Because it is nonzero only for n ≤−1, this is a left-sided
sequence. Then
∞ −1 ∞ ∞

∑ ∑ an z−n=−∑ a−n z n=1−∑ ( a−1 z ) (9)¿


n
X ( z )=− a n u [ −n−1 ] z−n=¿−
n=−∞ n=−∞ n=1 n=0

If |a−1 z|< 1, or equivalently, |z|<|a|, the sum in Eq.(9) converges, and

1 z
X ( z)=1− = ,|z|<|a| (10)
1−a z z−a
−1

Comparing Eq.(7) and Eq.(10), we see that the infinite sums are different, but the algebraic
expressions for X ( z ) are identical. The z-transforms differ only in the ROC.

The pole-zero plot and the ROC for Example 2 are shown in Fig2.

Fig. 2

Example 3 Sum of Two Exponential sequences

Page 6 of 43
Complex Variable, Laplace and Z-Transformation

Consider a signal that is the sum of two real exponentials:

() ( )
n n
1 −1
x [n ]= u [ n]+ u [ n] . (11)
2 3

The pole-zero plot and the ROC for Example 3 are shown in Fig.3.

Fig.3

The z-transform is then

{( ) ( ) }
n

() ( )
∞ ∞ ∞
1 n −1 n 1 −1 n
X ( z )= ∑ 2
u [n ]+
3
u [ n ] z−n= ∑
2
u [ n ] z−n + ∑
3
u [ n ] z −n
n=−∞ n=−∞ n=−∞

(
2 z z− ) (12)
1

( ) ( )
∞ n ∞ n
1 −1 −1 −1 1 1 12
¿∑ z +∑ z = + =
n=0 2 n=0 3 1 −1
1− z
2
1 −1
1+ z
3 ( )( z+ 13 )
z−
1
2

For convergence of X ( z), both sums in Eq. (12) must converge, which requires both |12 z |<1
−1

and (| −13 ) z |
−1
<1 or, equivalently |z|>
1
2
1
and |z|> . Thus, the region of convergence is the
3
1
region of overlap, |z|> .
2

Example 4 Two-Sided Exponential sequence

Consider the sequence

( ) ()
n n
−1 1
x [n ]= u [ n ]− u [ −n−1 ] .(13)
3 2

Page 7 of 43
Complex Variable, Laplace and Z-Transformation

Note that this sequence grows exponentially as n →−∞. Using the general result, we obtain

( )
n
−1 1 1
u [ n] z ,|z|>
3 ↔ 1 −1 3
1+ z
3

And

()
n
1 1 1
− u [ −n−1 ] z ,|z|< .
2 ↔ 1 −1 2
1− z
2

Thus by the linearity of the z-transform,

1 1 1 1
X ( z )= + <| z| ,|z|< ,
1 1 3 2
1+ z−1 1− z−1
3 2

¿
(
2 1−
1 −1
12
z ) =
(
2 z z−
1
12 ) .(14 )
(1+ 13 z )(1− 12 z
−1 −1
) ( z+ 13 )( z− 12 )
1 1
In this case, the ROC is the annular region <| z|< . Note that the rational function in this
3 2
example is identical to the rational function in Example 3 and 4, but the ROC is different in two
cases.

The pole-zero plot and the ROC for Example 4 are shown in Fig.4.

Fig.4

( )
n
−1
Example 5: Using the property of z-transform find Z { nx [ n ] }, where x [ n ] = u [ n ].
3

Also find Z { n2 x [ n ] }.

Page 8 of 43
Complex Variable, Laplace and Z-Transformation

Solution: From the previous example we have

1 z 1
X ( z )= = , ROC =|z|> .
1 −1 1 3
1+ z z+
3 3

d −1 z 1
Z { nx [ n ] }=−z X ( z )= , ROC=|z|> .
( )
Therefore dz 3 1
2
3
z+
3

1
2 z (z− ) 2
d d 1 z 2 z −1 3
Z { n2 x [ n ] }=z X ( z ) + z 2 2 X ( z )= − = 3 .

( ) ( ) ( )
dz dz 3 1
2
3 1
3
3 1
z+ z+ z+
3 3 3

Example 6 Finite-Length Sequence

Consider the signal

{
n
x [ n ] = a , 0≤ n ≤ N−1
0 , otherwise .

Then
−1 N
1−( a z )
N−1 N −1
1 z N −aN
X ( z )= ∑ a z = ∑ ( a z ) =
n −n −1 n
= (15)
n=0 n=0 1−a z
−1
z
N −1
z−a

The ROC is determined by the set of values of z for which


N−1
n
∑ |a z−1| < ∞ .
n =0

Since there are only finite number of nonzero terms, the sum will be finite as long as a z−1 is
finite, which in turn requires only that |a| is finite, the ROC includes the entire z-plane, with the
exception of the origin (z=0).

Example 7 The Transform of the Discrete-Time Exponential Sequence


The discrete-time exponential sequence is defined as
−naT
x [ n ] =e u [n ] .
Then
∞ ∞ ∞
−n 1 z
X ( z )= ∑ e−naT
u [ n ] z =∑ e
−n −naT
z =∑ ( e aT z ) =
−n

1−e −aT
z −1
=
z−e− aT
( 16 ) .
n=−∞ n=0 n=0

ROC: |e −aT
z |<1 or, |z|>|e |
−1 −aT

Page 9 of 43
Complex Variable, Laplace and Z-Transformation

Example 8 The Transform of the Discrete-Time Cosine and Sine functions


Let
x [ n ] =cos ⁡(ω 0 n) u [ n ] .

First, x [ n ] is expressed as

1 iω n 1 −i ω n
x [n ]= (e ) u [ n ]+ (e ) u [ n ] .
0 0

2 2

Then using Eq.(16) and the exponential multiplication property, we see that

1
1 iω n 2
( e ) u [n] z
0
,|z|>1
2 ↔ 1−e
i ω −1
z 0

1
1 −i ω n 2
( e ) u[n] z
0
,| z|> 1
2 ↔ 1−e
−i ω −1
z 0

From the linearity property, it follows that

1 1
2 2
X ( z )= i ω −1
+ −i ω −1
| z|> 1
1−e z 1−e z
0 0

−1
1−cos ω0 z
¿ −1 −2
|z|>1
1−2 cos ω 0 z + z
2
z −z cos ω 0
X ( z )= 2
(17)
z −2 z cos ω 0 +1

Example 9 Similarly we can find z-transform for the function x [ n ] =sin ⁡(ω0 n)u [ n ] .

Kronecker delta function or δ function: The Kronecker delta function, or δ function, is a


generalized function, or distribution, on the real number line that is zero everywhere except at
zero.

That is, δ [ n ] ={1 , n=0


0 , n≠ 0

Page 10 of 43
Complex Variable, Laplace and Z-Transformation

Example 10(a) Delta function

Find Z { δ [n] } .

X ( z )= ∑ δ [ n ] z−n=( 1 ) z 0=1
n=−∞

Example 10(b) Delta function

Find Z { δ [n+k ] }.

X ( z )= ∑ δ [ n+ k ] z −n =( 1 ) z k = z k (18)
n=−∞

Table-1 SOME COMMON z-TRANSFORM PAIRS

Sequence Transform ROC

1. δ [n] 1 All z

2. u[n] 1 |z|>1
−1
1−z

3. −u[−n−1] 1 |z|<1
−1
1−z

4. δ [n−m] z
−m
All z except 0 (if
m>0) or ∞ (if
m<0)

5. a n u [n ] 1 |z|>|a|
−1
1−az

6. −a n u [−n−1] 1 |z|<|a|
−1
1−az

7. n a n u [n ] az
−1
|z|>|a|
−1 2
( 1−az )
8. −na n u [−n−1] az
−1
|z|<|a|
−1 2
( 1−az )
9. ¿ 1−¿ ¿ |z|>1

Page 11 of 43
Complex Variable, Laplace and Z-Transformation

10. ¿ ¿¿ |z|>1

11. r n ¿ 1−¿ ¿ |z|>r

12. r n ¿ ¿¿ |z|>r

{ |z|>0
n N −N
1−a z
13. a , 0 ≤ n≤ N−1 , −1
0 , otherwise 1−a z

Exercise- Prove all the z-transform of the sequences given in the table using definition.

PROPERTIES OF THE REGION OF CONVERGENCE FOR THE z-TRANSFORM

Property 1: The ROC is a ring or disk in the z-plane centered at the origin; i.e., 0 ≤ r R <|z|<r L ≤ ∞.

Property 2: The Fourier transform of x [ n ] converges absolutely if and only if the ROC of the z-
transform of x [ n ] includes the unit circle.

Property 3: The ROC cannot contain any poles.

Property 4: If x [ n ] is a finite-duration sequence, i.e., a sequence that is zero except in a finite


interval −∞ < N 1 ≤ n≤ N 2 <∞ , then the ROC is the entire z-plane, except possibly z=0 or z=∞ .

Property 5: If x [ n ] is a right-sided sequence, i.e., a sequence that is zero for n< N 1< ∞ , the ROC
extends outward from the outermost (i.e. largest magnitude) finite pole in X ( z )to z=∞ .

Property 6: If x [ n ] is a left-sided sequence, i.e., a sequence that is zero for n> N 2>−∞ the ROC
extends inward from the innermost (smallest magnitude) nonzero pole in X ( z )to z=0.

Property 7: A two-sided sequence is an infinite-duration sequence that is neither right sided nor
left sided. If x [ n ] is a two-sided sequence, the ROC will consist of a ring in the z-plane, bounded
on the interior and exterior by a pole and, consistent with property 3, not containing any poles.

Stability, Causality, and the ROC

Consider a system with impulse response h [ n ] for which the z-transform H (z ) has the pole-zero
plot shown in Fig.5. There are three possible ROC’s consistent with properties 1-7 that can be
associated with this pole-zero plot. However, if we state in addition that the system is stable (or
equivalently, that h [ n ] is absolutely summable and therefore has a Fourier transform), then the
ROC must include the unit circle. Thus, stability of the system and properties 1-7 imply that the

Page 12 of 43
Complex Variable, Laplace and Z-Transformation

1
ROC is the region <|z|< 2. Note that as a consequence, h [ n ] is two sided, and therefore, the
2
system is not causal.

If we state instead that the system is causal, and therefore that h [ n ] is right-sided, then property 5
would require that the ROC be the region |z|>2. Under this condition, the system would not be
stable, i.e., for this specific pole-zero plot(Fig.5), there is no ROC that imply that the system is
both stable and causal.

Fig. 5

THE INVERSE z-TRANSFORM

One of the important roles of the z-transform is in the analysis of discrete-time linear systems.
Often, this analysis involves finding the z-transform of sequences and, after some manipulation
of the algebraic expressions, finding the inverse z-transform. There are a number of formal and
informal ways of determining the inverse z-transform from a given algebraic expression and
associated ROC.

The inverse z-transform enables us to extract x [ n ] from X ( z ). It can be found by any of the
following methods:

I. Partial Fraction Expansion


II. The Inversion Integral
III. Long Division of polynomials

Inspection method (using Table)

Let us consider the sequence of the form x [ n ] =an u[n], which is used quite frequently. We know

1
a u [ n] z
n
−1
,|z|>|a|
↔ 1−a z

The inverse z-transform of

Page 13 of 43
Complex Variable, Laplace and Z-Transformation

()
n
1 1 1
X ( z )= , ROC=|z|> is x [ n ] = u [ n ] .(19)
1 −1 2 2
1− z
2

1
If the ROC associated with X ( z ) in Eq. (19) had been |z|< , we can write
2

()
n
1
x [ n ] =− u [ −n−1 ] .
2

I. Partial fraction expansion

To see how to obtain a partial fraction expansion, let us assume that X ( z ) is expressed as a ratio
of polynomials in z−1, i.e.,
M

∑ b k z −k
X ( z )= k=0
N (20)
∑ ak z −k

k=0

Such z-transforms arise frequently in the study of linear time-invariant systems. To obtain the
partial fraction expansion of X ( z ), it is most convenient to note that X ( z ) could be expressed in
the form
M

b
∏ (1−c k z−1)
X ( z )= 0 N
k=1
a0

k=1
(¿ 1−d k z −1)¿

Where the c k ’s are the nonzero zeros of X ( z ) and the d k ’s are the nonzero poles of X ( z ). If M < N
and the poles are all first order, then X ( z ) can be expressed as
N
Ak
X ( z )=∑ −1
where A k =( 1−d k z −1) X ( z )|z=d k (21)
k=1 1−d k z

Example 11

Consider the sequence x [n] with z-transform

Page 14 of 43
Complex Variable, Laplace and Z-Transformation

1 1
X ( z )= ,|z|>
(1− 14 z )(1− 12 z )
−1 −1 2

Fig.6

The pole-zero plot and the ROC for Example 11 are shown in Fig.6.

From the ROC, we see that x [n] is a right-sided sequence. Since the poles are both first order,
X ( z ) can be expressed as

A1 A2
X ( z )= +
(1− 14 z ) (1− 12 z )
−1 −1

( 1 −1
A1= 1− z X ( z ) ¿.
4 )
Therefore,
−1 2
X ( z )= +
1− z
4(
1 −1 1 −1
1− z
2 )( )
Since x [n] is right sided, the ROC for each term extends outward from the outermost pole. From
Table and the linearity of the z-transform, it then follows that

() ()
n n
1 1
x [ n ] =2 u [n ]− u [ n] .
2 4

If M ≥ N in Eq.(20), the complete partial fraction expansion would have the form
M −N N
Ak
X ( z )= ∑ B r z +¿ ∑−r
(22)¿
r =0 k=1 1−d k z−1

Example 12 Consider the sequence x [n] with z-transform

Page 15 of 43
Complex Variable, Laplace and Z-Transformation

−1 −2
1+2 z + z
X ( z )=
3 −1 1 −2
1− z + z
2 2
2
( 1+ z−1 )
¿ ,|z|>1.
( 1 −1
)
1− z ( 1−z )
2
−1

Fig.7

The pole-zero plot and the ROC for Example 8 are shown in Fig7.

From the ROC, it is clear that x [ n ] is a right-sided sequence. Since M=N=2 and the poles are all
first order, X ( z) can be represented as

A1 A2
X ( z )=B0 + + (23)
( 1 −1
1− z
2 ) ( 1−z−1 )

The constant B0 can be found by long division:

1 −2 3 −1 2
z − z +1 ¿
2 2 −2 −1
z + 2 z +1
−2 −1
z −3 z +2
⌊ −1
¿
5 z −1

Thus X ( z) can be expressed as


−1
−1+5 z
X ( z )=2+ (24)
( 1 −1
)
1− z ( 1−z )
2
−1

Now using Eq. (24), we obtain

[( (
]
) ( z= 12 )=−9∧¿
−1+5 z−1 1
A1= 1− z−1
1
1− z−1 ( 1−z−1 )
2 ) 2

Page 16 of 43
Complex Variable, Laplace and Z-Transformation

[( ]
−1+5 z−1
A 2= ( 1−z−1) ( z =1 )=8.
1
)
1− z−1 ( 1−z−1 )
2

Therefore,

9 8
X ( z )=2− + (25)
( 1 −1 ( 1−z−1 )
1− z
2 )
From Table, we see that since the ROC is |z|>1 ,

2 z 2 δ [ n] ,

()
n
1 1
z u [ n] ,
1 −1 ↔ 2
1− z
2
1
−1
z u [ n] .
1−z ↔

Thus, from the linearity of the z-transform,

()
n
1
x [ n ] =2 δ [ n ] −9 u [ n ] +8 u [ n ] .
2

Example 13 Finite-Length Sequence

Suppose X ( z ) is given in the form

(
1
)
X ( z )=z 2 1− z −1 ( 1+ z −1) ( 1−z−1 ) (26)
2

Partial fraction is not appropriate. However, by multiplying the factors, we can express X ( z ) as

2 1 1 −1
X ( z )=z − z−1+ z
2 2

Therefore, by inspection,

1 1
x [ n ] =δ [ n+2 ]− δ [ n+1 ] −δ [ n ] + δ [ n−1 ] .
2 2

Equivalently,

Page 17 of 43
Complex Variable, Laplace and Z-Transformation

{
1 , n=−2
−1
,n=−1
2
x [ n ] = −1 , n=0
1
,n=1
2
0 , otherwise .

II. The Inversion Integral

The inversion integral states that



1
x [n ]= ∮ X ( z ) z n−1 dz ,
2 πi C

Where C is the closed curve that encloses all poles of the integrant, and by Cauchy’s residue
theorem, this integral can be expressed as

x [ n ] =∑ Res( z= p k ) [ X ( z ) z ]❑ ,
n−1

Where pk represents a pole of [ X ( z ) z n−1 ] and Res [X ( z ) z n −1 ] represents a residue at z= pk .

Example- Use the inversion integral method to find the Inverse z-transform of
−1 −3
1+2 z + z
X ( z )= .
( 1−z −1 ) (1−0.75 z−1)
Solution:

Multiplication of the numerator and denominator by z 3 yields

z 3+2 z 2 +1
X ( z )= .
z ( z−1 )( z−0.75)

[ ]
3 2
z +2 z +1
Now, x [ n ] =∑ Res
n−1
z
k z ( z−1 ) (z−0.75) z= pk

We are interested in the values of x [ 0 ] , x [ 1 ] , x [ 2 ] , … ., that is , values of n=0 , 1, 2 , …

For n=0, we get

[ ]
❑ 3 2
z +2 z +1
x [ 0 ] =∑ Res( z= p k ) 2
k z ( z−1 ) ( z−0.75 ) ❑

Page 18 of 43
Complex Variable, Laplace and Z-Transformation

[ ]
3 2
z +2 z + 1
¿ Res ( z=0 ) 2
+¿
z ( z−1 ) ( z−0.75 ) ❑

+ Res (z=1)
[ z3 +2 z 2+ 1
z 2 ( z−1 ) ( z−0.75 ) ]

+ Res(z =0.75)
[ z 3 +2 z 2+1
z 2 ( z−1 )( z−0.75) ]❑

x [0 ]=
[ {
d z 3+ 2 z 2 +1
dz ( z−1 ) ( z−0.75 ) }] [
❑ z =0
+
z 3 +2 z 2+1
2
z (z−0.75) ] [ z=1
+
z 3 +2 z 2+1
2
z ( z−1 ) ] z=0.75

28 163
x [0 ]= +16− =1.
9 9

For n=1, we get

[ ]

z3 +2 z 2+ 1
x [ 1 ]=∑ Res (z= pk )
k z ( z−1 ) ( z −0.75 ) ❑

[ ] [ ] [ ]
3 2 3 2 3 2
z +2 z +1 z +2 z +1 z +2 z + 1
¿ Res ( z=0 ) + Res ( z=1 ) + Res ( z=0.75)
( )( )
z z−1 z−0.75 ❑ ( ) ( )
z z−1 z−0.75 ¿ z z−1 ) (z−0.75)
( ❑

[ ] [ ] [ ]
3 2 3 2 3 2
z + 2 z +1 z + 2 z +1 z + 2 z +1
x [ 1 ]= + +
( z−1 )( z−0.75 ) z=0 z ( z−0.75 ) z=1 z ( z −1 ) z =0.75

4 163 15
¿ +16− = .
3 4 4

For n ≥ 2, there are no poles at z=0 , that is, the only poles are at z=1 and z=0.75 . Therefore

x [ n ] =∑ Res( z= p k )¿ ¿
k

¿ Res(z =1)¿ ¿

163
x [ n ] =16− ( 0.75 )n for n ≥ 2.
9

Now we can express x [ n ] for all n ≥ 0 as

28 4 163
x [n ]= δ [ n ] + δ [ n−1 ] + 16− ( 0.75 )n .
9 3 9

Page 19 of 43
Complex Variable, Laplace and Z-Transformation

Example- Consider the z-transform

1 1
X ( z )= ,|z|> .
1 4
z−
4

From the ROC, we identify this as corresponding to a right-sided sequence. We can rewrite X ( z )
in the form
−1
z |z|> 1 .
X ( z )=
1 −1 4
1− z
4

4 1
X ( z )=−4+ |z|>
1 4
1− z−1
4

Now x [n] can be expressed as

()
n
1
x [ n ] =−4 δ [ n ] +4 u [ n ] .(27)
4

Alternatively, this problem can be solved by using the inversion integral method.

Example- Determine the inverse z-transform of

1
X ( z )= −1 −2
1−1.5 z +0.5 z

If

(a) ROC :| z|>1


(b) ROC :| z|<0.5
(c) ROC : 0.5<|z|<1.

Solution: Using partial fraction,

2 1
X ( z )= −1
− −1
1−z 1−0.5 z

(a) In the case when ROC is|z|>1, the signal x [ n ] is causal and both terms are causal terms.
Taking inverse z-transform, we get
x [ n ] =2 (1 ) u [ n ] −( 0.5 ) u [ n ] =( 2−0.5n ) u [n].
n n

Page 20 of 43
Complex Variable, Laplace and Z-Transformation

(b) When the ROC is|z|< 0.5, the signal x [ n ] is anticausal. Thus both the terms result in
anticausal components. Taking inverse z-transform, we get

x [ n ] =[−2+ ( 0.5 ) ]u [−n−1].


n

(c) In the case when ROC 0.5<|z|<1 is a ring, which implies that the signal x [ n ] is two-sided.
Thus one of the terms corresponds to a causal signal and the other to an anticausal signal.
Obviously, the given ROC is the overlapping of the regions |z|>0.5 and |z|<1. Hence the
pole p2=0.5 provides the causal part and the pole p1=1 the anticausal. Thus

x [ n ] =−2 (1 ) u [ −n−1 ] −( 0.5 ) u [ n ] .


n n

The convolution property plays a particularly important role in the analysis of LTI (Linear
Time-Invariant) systems. Specifically, as a consequence of this property, the z-transform of the
output (i .e .Y ( z ) ¿ of an LTI system is the product of the z-transform of the input (i.e. X ( z )) and
the z-transform of the system impulse response (i.e. H ( z )). The z-transform of the impulse
response of an LTI system is typically referred to as the system function.

Thus we can write

Y ( z )=H ( z ) X ( z ) .

We can find the discrete impulse response h [ n ] by taking inverse z-transform of the discrete
transfer function / system function H ( z ) , that is,

h [ n ] =Z
−1
{H ( z )}.

Table 2 SOME z-TRANSFORM PROPERTIES

Sequence Transform ROC

Page 21 of 43
Complex Variable, Laplace and Z-Transformation

x [n ] X ( z) Rx

x1 [ n ] X1 ( z ) Rx 1

x2 [ n ] X2 ( z ) Rx 2

ax 1 [ n ] + b x2 [ n ] aX 1 ( z )+ b X 2 ( z ) Rx ∩ Rx
1 2

x [ n−n 0 ] z
−n0
X (z) R x, except for the possible
addition or deletion of the origin
or ∞ .

z0 x [ n]
n
X ( z /z 0 ) |z 0| R x
nx [ n ] dX (z) R x, except for the possible
−z
dz addition or deletion of the origin
or ∞ .

x 1 [ n ]∗x2 [ n ] X1 ( z ) X2( z ) Rx ∩ Rx
1 2

Exercise Set on Z-transform-8.1


1. Prove the following z-transform pairs (using definition):

az
(c) n a u [ n ] ↔
n
(a) δ [ n ] ↔ 1 (b) δ [ n−m ] ↔ z−m
( z−a )2
2
az (z+ a) z
(d) n a u [ n ] ↔
2 n
(e) (n+1)u [ n ] ↔ .
( z−a )3 ( z−1 )2

2. Determine the sequence x [ n ] with z-transform and hence sketch x [ n ]

X ( z )=( 1+2 z ) ( 1+3 z−1 ) ( 1−z −1 ) .

3. Determine the inverse z-transform for the following.

1 1
X ( z )= ,|z|> .
(a) 1 −1 4 .
1+ z
4

Page 22 of 43
Complex Variable, Laplace and Z-Transformation

1 −1 1 −1
1− z 1+ z
2 1 3 1
(b) X ( z )= ,|z|> . (c) X ( z )= ,|z|> .
2 3 2 1
−2
3
1+ z−1− z−2 1− z
5 5 9
−1
1−a z | | | |
(d) X ( z )= −1
, z > 1/a .
z −a

4. Use partial fraction expansion and the inversion integral method to find x [ n ]
−2
10 z 1
(a) X ( z )= ,|z|>1. (b) X ( z )= ,|z|>1.
( 1+ z−1 ) ( 1−z ) −1 2
( 1+0.5 z ) ( 1−0.50 z−1 ) (1−z−1)
−1

−1
z A
(c) X ( z )= ,|z|>1. (d) X ( z )= ,| z|> 1.
( 1+0.75 z ) ( 1−0.75 z )
−1 −1 2
( 1−0.75 z ) (1−0.5 z−1)
−1

1
(e) X ( z )= ,|z|>1.
( 1+ z ) (1−0.75 z −1)
−1

1
H ( z )=
5. If 1 and h [ n ] = A 1 α n1 u [ n ] + A 2 α n2 u [ n ], determine the values of
1− z−2
4
A1 , A 2 , α 1∧α 2 .

( )
n
−1
Answer: 2. x [ n ] =5 δ [ n ] +2 δ [ n+1 ] −4 δ [ n−1 ] −3 δ [ n−2 ] , 3(a). u [ n ], 3(b).
4

() a (a)
n n 2 n
15 ( )n 1 3 1 1−a 1
−1 u [ n ] + u[n] , 3(c)( ) u[n], 3(d). −aδ [ n ] − u [ n ] , 4(a).
16 16 5 3
5 5 1 1 4
(−1 )n u [ n ] − u [ n ] + 5 nu [n] , 4(b). (−0.5 )n u [ n ]− ( 0.5 )n u [ n ] + u [ n ] , 4(c).
2 2 6 2 3

() () ( )
n n n
1 3 1 3 1 −3
u [ n] + n u [ n ]− u [ n ] , , 4(d). A [3 ( 0.75 )n u [ n ] −2 ( 0.5 )n u [ n ] ] , 4( e).
3 4 2 4 3 4
4 3 1 1 1 −1
(−1) u [ n ] + ( 0.75 ) u[n], 5. A1= , A 2= , α 1= , α 2= .
n n
7 7 2 2 2 2

Page 23 of 43
Complex Variable, Laplace and Z-Transformation

Practice Problems Related to Z- Transformation


1. Find the z-transformation using formulas
a. y [n]=2n

( )
n
−1
b. y [n]=
2
c. y [n]=δ [n] ( 2 )
d. y [n]=δ [n] (−3 )
e. y [n]=u[n] ( 3 )
f. y [n]=u[n] ( 5 )
g. y [n]=n2

2. Find the z-transformation of each of the following-


a. y [n]=2+3 n.
b. y [n]=n3.
c. y [n]=3 y [n+3].

d. y [n]=n ⋅cos

2 ( )
.

3. Find the sequences whose z -transforms are-


2
2 z −3 z
a. Y ( z )=2 .
z −3 z−4
2
( ) 3 z −4 z
b. U z = 2 .
z −3 z +2
2
c. V ( z )= 2 z + z .
¿¿
2
d. V ( z )= +3 z .
z
¿¿
2
3 z +5
e. W ( z )= 4 .
z

Page 24 of 43
Complex Variable, Laplace and Z-Transformation

DIFFERENCE EQUATION

Difference equations are the discrete equivalent of differential equations. The terminology is
similar and the methods of solution have much in common with each other. Difference equations
arise whenever an independent variable can have only discrete values. They are growing
importance in engineering in view of their association with discrete time systems based on the
microprocessor.

Example - The difference equation describing the input-output relationship of a discrete-time


system with zero initial conditions, is

2 y [ n ] −3 y [ n−1 ] −2 y [ n−2 ] =x [ n ] + x [ n−1 ] (1)

Compute:

a. The transfer function H(z)


b. The discrete-time impulse response h [ n ] .
c. The response when the input is the discrete unit step function u [ n ] .

Solution

a. Taking z-transform of both sides of Eq.(1), we obtain


−1 −2 −1
2 Y ( z ) −3 z Y ( z )−2 z Y ( z )=X ( z ) + z X ( z )

And thus
−1
Y (z ) 1+ z
2
z +z
H ( z )= = = (2)
X (z) 2−3 z−1−2 z−2 2 z 2−3 z−2

b. To obtain the discrete-time impulse response h [ n ] , we need to compute the inverse z-


transform of Eq.(2).

h [ n ] =∑ Res ( z= pk )¿ ¿
k

[ ( )] [ ]
( z+1 ) z n (z +1)z n
¿ + −1
1 2 ( z−2 ) z=
2 z+ 2
2 z=2

Page 25 of 43
Complex Variable, Laplace and Z-Transformation

( )
n
3 n 1 −1
h [ n ] = (2) − .
5 10 2

z
c. From Y ( z )=H ( z ) X (z), the transform u [ n ] z , and using the result of part(a) we
↔ z−1

obtain:
2
z2 + z z (z +1)z
Y ( z )= =
( )
2
2 z −3 z−2 z−1 1
2 z + ( z−2 ) (z−1)
2

[( ]

(z+1) z2 z n−1
y [ n ] =∑ Res( z=p k )
k 1
)
2 z + ( z −2 ) (z−1)
2 ❑

[ ] [( ] [( ]
( z +1 ) z n+1 ( z +1 ) z n+1 (z +1)z n+ 1
¿ + +
) )
−1
2 ( z −2 )( z−1 ) z= 1 1
2
2 z + ( z−1 ) 2 z + ( z−2 )
2 z=2 2 z=1

( )
n
−1 −1 6 n 2
y [ n]= + 2− .
30 2 5 3

Practice Problems
1. Solve the following first order initial value problems using z -transforms.
a. y [ n+1 ] −3 y [ n ] =4 n , y [0 ]=0 .
b. y [ n+1 ] + 4 y [ n ] =10 , y [0]=3.
c. y [ n+1 ] −5 y [ n ] =5n+ 1 , y [0]=0.
d. y [ n+1 ] −2 y [ n ] =3⋅ 2n , y [0]=3.
e. y [ n+1 ] + 3 y [ n ]=4 δ [n] ( 2 ) , y [0 ]=2.

2. Solve the following second order initial value problems using z -transforms:
a. y [ n+2 ] −5 y [ n+ 1 ] + 6 y [ n ]=0 , y [0 ]=1 , y [1]=0.
b. y [ n+2 ] − y [ n+1 ] −6 y [ n ] =0 , y [0]=5 , y [1]=−5.
c. y [ n+2 ] −8 y [ n+1 ] + 16 y [ n ] =0 , y [0 ]=0 , y [1]=4 .
d. y [ n+2 ] − y [ n ] =16 ⋅3n , y [0]=2, y [1]=6.
e. y [ n+2 ] −3 y [ n+1 ] + 2 y [ n ] =u [n ] ( 4 ) , y [0]=0 , y [1]=0.

Page 26 of 43
Complex Variable, Laplace and Z-Transformation

Application of the z-Transform to Connectivity

Example: If we have n nodes connected to each other, how many total links do we have?
Solution:

If a new node is added to the previous n nodes, exactly n new links are created. If we call the
number of initial links l(n) then the number of links between n+1 nodes will be
l ( n+1 )=l ( n ) +n .
This is a difference equation for l for which a closed form solution can be obtained with the
z-transform. Let us define Z { l [ n ] }=L(z ). Taking z-transform of the above equation, we get
z
zL(z )−zl ( 0 )=L ( z ) +
( z −1 )2
There are zero links for zero nodes, thus l ( 0 )=0 . Therefore we have
z
L ( z) =
( z−1 )3
which consists of a pole at z=1 of order 3. Taking inverse z-transform,

Page 27 of 43
Complex Variable, Laplace and Z-Transformation

[ ] [ ]
2 2
1 d 1 d n n(n−1)
l ( n )= 2
{ L ( z ) ( z−1 )3 z n−1 } = z = .
2! d z z =1
2 ! d z2 z =1
2

Application of the z-Transform to Mathematics

Example : The sequence 0, 1, 1, 2, 3, 5, 8, 13… , is said to form the Fibonacci numbers. Find
the difference equation satisfied by them. Find an explicit formula for the nth Fibonacci number.

Solution:

It can be observed that sum of two consecutive numbers is the third number. Hence it satisfies
the recurrence relation
x [ n ] =x [ n+2 ]−x [n+1] , n≥0

with the initial conditions x [ 0 ] =0 , x [ 1 ] =1.

So,

x [ n+ 2 ] −x [ n+1 ]−x [ n ] =0

Now taking Z-transforms, we have


Z {x [ n+2 ] −x [ n+1 ] −x [ n ] }=0

[
¿ , z 2 X ( z )− x [ 0 ] −
x [ 1]
z ]
−z [ X ( z ) −x [ 0 ] ] − X ( z )=0

2
¿ ,( z −z −1) X ( z )=z

z
Now, X ( z )= 2
z −z−1

[ ] [ ]
❑ n−1 ❑ n
z .z z
x [ n ] =∑ Res( z= p k ) =∑ Res(z= p k )
k ( z−z 1 )( z −z 2) ❑ k ( z−z 1) ( z−z 2 ) ❑

1+ √ 5 1−√ 5
Where z 1 and z 2 are the poles of X ( z ) and z 1= , z 2= .
2 2

( ) ( )
n n n n
z1 z2 1 1+ √ 5 1 1− √ 5
x [n ]= + = − .
z 1−z 2 z 2−z 1 √ 5 2 √5 2

Page 28 of 43
Complex Variable, Laplace and Z-Transformation

Example: Find a recurrence relation and initial conditions for the sequence

Solution:

Finding the recurrence relation would be easier if we had some context for the problem (like the
Tower of Hanoi, for example). But we have only the sequence. Remember, the recurrence
relation tells, how to get from previous terms to future terms. What is going on here? We could
look at the differences between terms: 4, 12, 36, 108, …. Notice that these are growing by a
factor of 3. Is the original sequence as well? 1⋅3=3, 5⋅3=15, 17⋅3=51 and so on. It appears that
we always end up with 2 less than the next term.

So is our recurrence relation and the initial condition is .

Ladder Network

It is required to find the current in the n-th loop i n for the ladder network shown in the Fig.
Assume all the resistances except the load R L have the same value R .

The equation for the loop with current i n+1 is

−R i n+ 3 R i n+ 1−R in +2=0

This equation is true for any n except −1 and k −1 (the beginning and the end loops). The
equation with end conditions is sufficient to describe the network.

Applying z-transformation and dividing by R , we obtain

2 2 z (z i 0 −3i 0 +i 1)
I ( z )−3 zI ( z )+ 3 zi 0 + z I ( z )−z i 0−z i1 =0 ,∨, I ( z )= 2
z −3 z +1

Let us write the equation for the first loop

Page 29 of 43
Complex Variable, Laplace and Z-Transformation

V
2 Ri 0 −Ri 1=V or, i 1=2 i 0−
R

1 3+√ 5 3−√ 5 V
i n=Ζ
−1
{ I ( z ) }=
z1 −z2
[ z 1 ( z 1− A ) i 0−z 2 ( z 2− A ) ] , where z 1=
n n
2
, z 2=
2
, A=1+
Ri 0

System of Difference Equations


Example: Solve, by z-transformation, the simultaneous difference equations,

u [ n ] =3 u [ n−1 ] +2 v [ n−1 ] , v [ n ] =u [ n−1 ] +2 v [ n−1 ] with u [ −1 ] =1 , v [−1]=2.

Solution: Taking z-transform of both the equations

( z−3 ) U ( z )−2 V ( z ) =7 z(1)

U ( z )+ ( 2−z ) V ( z )=−5 z (2)

Now using Cramer’s rule, we get

U ( z )=
|−5 z 2−z|
7 z −2
=
z (7 z−4 )
and V ( z )=
| 1−5 z |
z−3 7 z
=
z (5 z−8)

| 12−z |
z−3−2 ( z−4 ) (z −1)
|z−3−2
12−z | ( z−4 ) ( z−1)

Hence, taking inverse z-trans

u [ n ] =8 ( 4 ) −1 and v[ n ] =4 ( 4 ) +1.
n n

Practice Problems
1. Solve the following systems using z-transforms:
n
a. u[n+1]−2 v [n]=2. 4

n+1
−4 u[n]+ v [n+1]=4

u[0]=2 , v [0]=3

b. u[n+1]−v [n ]=0

Page 30 of 43
Complex Variable, Laplace and Z-Transformation

u[n]+ v [n+1]=0

u[0]=0 , v [0]=1

c. u[n+1]−v [n ]=2 n

−u[n]+ v [n+1]=2 n+2

u[0]=0 , v [0]=1

d. u[n+1]−v [n ]=−1

−u[n]+ v [n+1]=3

u[0]=0 , v [0]=2.

Exercise set on application of Z-transform-8.2

1. Consider an LTI system with input x [ n ] and output y [ n ] that satisfies the difference equation
with zero initial conditions
y [ n ] −2 y [ n−1 ] + y [ n−2 ] =x [ n ] −x [ n−1 ] .
Compute
(a) The transfer function H ( z ).
(b) The discrete-time impulse response h ( n ).
(c) The response when the input is the discrete unit step function u [ n ] .
z
Ans: (a) H (z )= , (b)h [ n ] =u [n] (c) y [ n ] =( n+1 ) u[n],
z−1

−1
1+ 5 z
2. Find the impulse response h [n ] of casual system having system function H ( z )= −1 .
1−2 z
−5 7 n
δ [ n ] + ( 2 ) u[n].
Ans: h ( n )=
2 2
3. A discrete-time system is described by the difference equation

y [ n ] + y [ n−1 ] =x [n]
Page 31 of 43
Complex Variable, Laplace and Z-Transformation

Where y [ n ] =0 for n< 0.

(a) Compute the transfer function H ( z ).


(b) Compute the impulse response h [ n ]
(c) Compute the response when the input is x [ n ] =10 for n ≥ 0.
4. Given the discrete function
z+2
H (z )= 2 .
8 z −2 z−3
Write the difference equation that relates the output y [ n ] to the input x [n].
5. Find the recurrence relation and initial condition for the following sequences:

a. Ans: .

b. Ans:

6. Use the one-sided z-transform to determine y [ n ] ,n ≥ 0 in the following cases:


1
(a) 6 y [ n ] −5 y [ n−1 ] + y [ n−2 ] = n , n ≥ 0 ; y [ −1 ] =0 , y [ −2 ] =0 .
4

() () ()
n n n
1 1 1 4 1
Ans: + − .
2 4 2 3 3

(b) y [ n ] = y [ n−1 ] + x [ n ] , x [ n ]=( ) u [ n ] , y [−1 ] =1.


n
1 1
4 5

Ans: ( ) −4 ( ) .
n n
21 1 1
4 4 5
1
(c) y [ n ] = y [ n−2 ] + x [ n ] , x [ n ]=u [ n ] , y [−1 ]=0 , y [ −2 ] =2.
4

Ans: .
(d) y [ n ] − y [ n−1 ]−2 y [ n−2 ]=0 , y [ −1 ] =2 , y [ −2 ]=7 .
Ans: 12 ( 2 )n+ 4 (−1 )n.
(e) y [ n+2 ] −4 y [ n+ 1 ] + 4 y [ n ] =0 , y [ 0 ] =0 , y [ 1 ] =6 .
Ans:3∗n∗2n.
(f) y [ n+2 ] −5 y [ n+ 1 ] + 4 y [ n ] =2n , y [ 0 ] =1 , y [ 1 ] =0.

Ans: .

6. Assume that the population of a country in 2010 is 140 million and is growing at the rate of
2.5% a year.
(a) Find a recurrence relation and initial condition for the population of the country n years
after 2010?

Page 32 of 43
Complex Variable, Laplace and Z-Transformation

(b) Find an explicit formula for the population of the country n years after 2010.
(c) Find the population of the country at the end of the year 2020.

7. Suppose that the number of bacteria in a colony doubles every hour.


(a) Find a recurrence for the number of bacteria after n hours have elapsed.
(b) If 100 bacteria are used to begin a new colony, how many bacteria will be in the colony
in 10 hours?
8. A deposit of Tk. 1,00,000 is made in an investment fund at the beginning of a year. On the
last day of each year two dividends are awarded. The first dividend is 20% of the amount in
the account during that year. The second dividend is 28% of the amount in the account in the
previous year.
(a) Find a recurrence relation for
{P } P
n , where n is the amount in the account after n years
if no money has been withdrawn?
(b) How much is in the account after n years if no money has been withdrawn?

Compute z-transform and inverse z-transform using MATLAB

Ex-1 Compute the z-transform of the function f =sin ⁡(n) using MATLAB

>> syms n x
>> f=sin(n);
>> ztrans(f, n, x)
ans =
(x*sin(1))/(x^2 - 2*cos(1)*x + 1)

Ex-2 Compute the z-transform of the function f =a n using MATLAB

>> syms a n x

>> f=a^n;

Page 33 of 43
Complex Variable, Laplace and Z-Transformation
>> ztrans(f, x)

ans =

-x/(a - x)

2z
Ex-3 Compute the inverse z-transform of the function f = using MATLAB
( z−2 )2

>> syms k x

>> F=2*x/(x-2)^2;

>> iztrans(F, x, k)

ans =

2^k + 2^k*(k - 1)

a
Ex-4 Compute the inverse z-transform of the function f =e z using MATLAB

>> syms z a n

>> F=exp(a/z);

>> iztrans(F)

ans =

a^n/factorial(n)

Page 34 of 43
Complex Variable, Laplace and Z-Transformation

The Z-Transformation (Additional Problem)


Bubble sort: Bubble sort is a simple sorting algorithm used to sort lists. It is generally one of
the first algorithms taught in computer science courses because it is a good algorithm to learn to
build intuition about sorting. While sorting is a simple concept, it is a basic principle used in
complex computer programs such as file search, data compression, and path finding.
The Bubble sort algorithm compares each pair of elements in an array and swaps them if they are
out of order until the entire array is sorted. For each element in the list, the algorithm compares
every pair of elements.

Page 35 of 43
Complex Variable, Laplace and Z-Transformation

Following chart shows the number of elements in an array and corresponding maximum number
of comparisons or swaps needed to sort an array:
No. of elements Maximum no. of swaps needed

1 0

2 1

3 3

4 6

Example: (i) For n=1,


Let A= [5], no swap is needed to sort.
(ii) For n=2,
Let A=[3,1], after one swap A=[1, 3] (sorted).
(iii) For n=3,
Let A=[c, b, a], then after 1st swap A=[b, c, a]
after 2nd swap A=[b, a, c]
after 3rd swap A=[a, b, c] (sorted).
If A=[b, c, a], then after 1st swap A=[b, a, c]
After 2nd swap A=[a, b, c] (sorted).
In the 1st case, three swaps are needed and 2 nd case two swaps are needed. So the number found
in recurrence relation is the maximum number of swaps to sort a list with n number of elements.

N.B. To sort an array or list, at least one element is needed in that array. So, for , .

Example 1: The number of comparisons needed to sort an array of n elements by the method
bubble sort (or by straight selection) can be expressed by the following recurrence relation
a [ n+1 ]=a [ n ] + n,n ≥ 1 with initial condition a [ 1 ] = 0. Solve it and check your answer by direct
substitution.

Page 36 of 43
Complex Variable, Laplace and Z-Transformation

Solution: Given ,a [ n+1 ]=a [ n ] + n


Taking Z-transform we have
Z { a [ n+ 1 ] }=Z { a [ n ] } + Z { n }
+z
→ z[ A ( z )−a [ 0 ] ] = A(z) 2
( z−1)
z
→ z A(z) –A(z) = 2 [since, for n ≤ 0, a [ n ]=0]
( z−1)
z
→ (z-1) A(z) ¿ 2
( z−1)
z
→ A(z) =
( z−1 )3
Now, By Cauchy residue Theorem (CRT), we have-

The inverse Z-Transform of A(z) is

Now, for n=1, we have a [ 1 ] =0 .


Tower of Hanoi puzzle: The Tower of Hanoi (also called the Tower of Brahma or Lucas'
Tower and sometimes pluralized) is a mathematical game or puzzle. It consists of three rods and
a number of disks of different sizes, which can slide onto any rod. The puzzle starts with the
disks in a neat stack in ascending order of size on one rod, the smallest at the top, thus making
a conical shape.

Page 37 of 43
Complex Variable, Laplace and Z-Transformation

The objective of the puzzle is to move the entire stack to another rod, obeying the following
simple rules:
1. Only one disk can be moved at a time.
2. Each move consists of taking the upper disk from one of the stacks and placing it on top
of another stack or on an empty rod.
3. No larger disk may be placed on top of a smaller disk.

A model for tower of Hanoi puzzle


Following table shows the number of disk and corresponding number of moves to solve
Hanoi puzzle:
No. of No. of moves needed
disks

1 1

2 3

3 7

4 15

N.B. To solve this puzzle, at least one disk is needed. So, for , .

Example:

Page 38 of 43
Complex Variable, Laplace and Z-Transformation

For n=2

For n=3

Total number of moves=

2+2+2+1=7

Page 39 of 43
Complex Variable, Laplace and Z-Transformation

Example-2 :The number of moves of disks, necessary to solve the Tower of Hanoi puzzle for n
disks can be expressed by the following recurrence relation a [ n+1 ]=2a [ n ] +1 ,n ≥ 1 with initial
condition a [ 1 ] =1. Solve it and check your answer by direct substitution.
Solution: Given, a [ n+1 ]=2a [ n ] +1
Taking Z-Transform we have-
→ Z { a [ n+ 1 ] }=Z { 2 a [ n ] } + Z {1 }
+z
→ z[ A ( z )−a [ 0 ] ] = 2 A(z)
( z−1)
z
→ ( z−2 ) A(z) ¿ [since, for n ≤ 0 , a [ n ] =0 ]
( z−1)
z
→ A(z) =
( z−1)(z−2)
Now by Cauchy Residue Theorem (CRT), we have-
The inverse Z-Transform of A(z) is-

= +

= +

= +

Now, for n=1 , we have a [ 1 ] =1.


Plane Divisions by Lines: The maximal number of regions into which n lines divide a plane are

Following diagrams shows the number of lines ( n ) and corresponding number of divided regions
a [ n ], in a plane:

Page 40 of 43
Complex Variable, Laplace and Z-Transformation

Example-3 :The maximum number of regions defined by n straight lines in the plane can be
expressed by the following recurrence relation a [ n+1 ]=a [ n ] + n+1, n ≥ 0with initial condition
a [ 0 ]=1 . Solve it and check your answer by direct substitution.
Solution: Given, a [ n+1 ]=a [ n ] + n+1
Taking Z-Transform we have,
→ Z { a [ n+ 1 ] }=Z { a [ n ] } + Z { n } +Z {1 }
+z z
→ z[ A ( z )−a [ 0 ] ] = A(z) 2 +
( Z−1) z−1
z z
→ (z-1) A(z) = + +z
( z−1) (z −1)
2

3 2
z −z + z
→ (z-1) A(z) = 2
(z−1)
3 2
z −z + z
→ A(z) = 3
(z−1)

Now Following by Example-1, we have, The inverse Z-Transform of A(z) is,


.

Now, for , .
Number of squares in a square grid: If we determine the number of squares on smaller boards
starting with one square we will readily discover a pattern that leads to a simple formula for a
board of any number of squares.

A square board obviously has only one square.

Page 41 of 43
Complex Variable, Laplace and Z-Transformation

A 2x2 square board has 5 squares, the 4 basic ones and the one large 2x2 one.
A 3x3 square board has 14 squares, the smaller 9 plus, four 2x2's plus, one large 3x3 one.
A 4x4 square board has 30 squares, the smaller 16 plus, nine 3x3's, plus four 2x2's plus, one
large 4x4 one.

N.B. If n is the number of grid and a [n] is the number of square then, for n ≤ 0, a [ n ]=0 and for

n≥1
, .
Example-4 :The number of all squares in a square grid of dimension n can be expressed by the
following recurrence relation a [ n+1 ]=a [ n ] +(n+1)2,n ≥ 1 with initial condition a [ 1 ] =1. Solve it
and check your answer by direct substation.
Solution: Given , a [n+1]=a [ n ] +(n+1)2
Taking Z-Transform we have
→ Z { a [ n+ 1 ] }=Z { a [ n ] } + Z {( n+1 )2 }
2
+ z+ z 2z z
→ z[ A ( z )−a [ 0 ] ] = A(z) 3 + 2 +
( Z−1) ( z−1 ) z−1
2
z+ z 2z z
→ ( z−1 ) A (z ) = 3 + 2 +
( Z−1) ( z−1 ) z−1
3 2
z +z
→ A (z ) = 4
( Z−1)
Now, By Cauchy-Residue Theorem (CRT) we have
The inverse Z-Transfor of A(z) is -

Page 42 of 43
Complex Variable, Laplace and Z-Transformation

Now, for n= 1 ,we have , a [ 1 ] =1.

[Reference: Title: The Recurrence Relations in Teaching Students of Informatics


Author : Valentin P.BAKOEV]
Exercise:
1. Find a closed formula for the generating function of the sequence:
i. a[n+1] = 3 a[n]+2 a[n+1] ; a[0] = 1; a[1] = 2.
ii. b[n+1] = 2 b[n] -3b[n+1] ; b[0] = 2; b[1]= 1.

Page 43 of 43

You might also like