Lecture 04: Discrete Frequency Domain Analysis (z-transform)pds/Lect04.pdfLecture 04: Discrete...

36
Lecture 04: Discrete Frequency Domain Analysis (z-transform) John Chiverton School of Information Technology Mae Fah Luang University 1st Semester 2009/ 2552

Transcript of Lecture 04: Discrete Frequency Domain Analysis (z-transform)pds/Lect04.pdfLecture 04: Discrete...

Lecture 04: Discrete Frequency Domain Analysis(z-transform)

John Chiverton

School of Information TechnologyMae Fah Luang University

1st Semester 2009/ 2552

Outline

OverviewLecture Contents

Introduction

z-TransformTime Delays in z-Transform Representations

The Inverse z-Transform

StabilityBIBO Stability

Lecture Contents

OverviewLecture Contents

Introduction

z-TransformTime Delays in z-Transform Representations

The Inverse z-Transform

StabilityBIBO Stability

Outline

OverviewLecture Contents

Introduction

z-TransformTime Delays in z-Transform Representations

The Inverse z-Transform

StabilityBIBO Stability

Introduction to the z-transform

The z-transform

I Transforms a digital signal to a frequency respresentation

I Used for stability analysis using the poles and zeros

I Also used for frequency analysis

Outline

OverviewLecture Contents

Introduction

z-TransformTime Delays in z-Transform Representations

The Inverse z-Transform

StabilityBIBO Stability

z-Transform

Two z-transforms are common in digital signal processing. Theone-sided or unilateral z-transform:

X(z) =∞∑n=0

x[n]z−n

and the bilateral z-transform:

X(z) =∞∑

n=−∞x[n]z−n.

The one-sided transform is considered here only.

z-Transform Example

Q. Find the z-Transform of a step function:

x[n] =

1 for n ≥ 00 elsewhere

A.

X(z) =∞X

n=0

x[n]z−n =∞X

n=0

z−n

=(z0 + z−1 + z−2 + z−3 + z−4 + ...)

=

„1 +

1

z+

1

z2+

1

z3+

1

z4+ ...

«This is a geometric series of the form:

s =∞X

k=0

ark =a

1− r

where a = 1 and r = z−1 so that

X(z) =1

1− z−1=

z

z − 1.

z-Transform Example

Q. Find the z-Transform of a square pulse:

x[n] =

0.2 for 0 ≤ n < 50 elsewhere

A.

X(z) =∞X

n=0

x[n]z−n = 0.24X

n=0

z−n

=0.2(z0 + z−1 + z−2 + z−3 + z−4)

=0.2

„1 +

1

z+

1

z2+

1

z3+

1

z4

«This is a geometric series of the form:

s =

n−1Xk=0

ark = a1− rn

1− r

where a = 0.2, n = 5 and r = z−1 so that

X(z) = 0.21− z−5

1− z−1= 0.2

z5 − 1

z5 − z4= 0.2

z5 − 1

z4(z − 1).

Time delays in z-Transform Representations

Each z−1 in a z-Transform can be considered as a single time delay.Consider the time-shifted or delayed unit impulse:

x[n] = δ[n− τ ]

then the z-Transform is given by:

X(z) =∞∑n=0

δ[n− τ ]zn = z−τ

indicating a delay of τ samples.

The z-Transform and Time Delay Example

Q. Find the signal corresponding to the z-Transform:

X(z) =z

z − 0.5.

A. Remember the geometric series formula: s =∞P

k=0ark = a

1−r. Need to find the form

of X(z) to easily find r and a... Dividing the numerator and denominator by z gives

X(z) =1

1− 0.5z−1.

So that r = 0.5z−1 and a = 1 then

X(z) =∞X

k=0

`0.5z−1

´k= 1 + 0.5z−1 + (0.5z−1)2 + (0.5z−1)3 + (0.5z−1)4 + ...

=1 + 0.5z−1 + 0.25z−2 + 0.125z−1 + 0.0625z−4 + ...

Remembering that each z−1 is a delay of 1 time instance, the signal x[n] is then given

by the coefficients for each time instance, i.e. x[0] = 1, x[1] = 0.5, x[2] = 0.25,

x[3] = 0.125, x[4] = 0.0625 etc.

The z-Transform and Time Delay Example 2

Q. Find the signal corresponding to the z-Transform:

X(z) =z2 − 0.2

z(z − 0.2)

A. Remember the geometric series formula: s =n−1Pk=0

ark = a 1−rn

1−r. Need to find the

form of X(z) to easily find r, a and n... Dividing through by z2 gives

X(z) =1− 0.2z−2

1− 0.2z−1.

So that r = 0.2z−1, a = 1 and n = 2 resulting in:

X(z) =

n−1Xk=0

ark =1X

k=0

(0.2z−1)k = 1 + 0.2z−1.

Therefore the original signal, x[n] is given by x[0] = 1 and x[1] = 0.2.

Outline

OverviewLecture Contents

Introduction

z-TransformTime Delays in z-Transform Representations

The Inverse z-Transform

StabilityBIBO Stability

The Inverse z-Transform

The inverse z-Transform Z−1(X(z)) is given by

x[n] = Z−1(X(z)) =1

2πj

∫X(z)zn−1dz

I The inverse z-Transform is not usually computed directly.

I Instead the z-Transform is split into parts using partialfractions

I And then the inverse z-Transform of the parts are found usinga table of z-Transform pairs.

Table of (unilateral) z-Transform Pairs

Lynn and Fuerst give the following table of z-Transform pairs:

Signal x[n] z-Transform X(z)

δ[n] 1

u[n] =

1 for n ≥ 00 elsewhere

zz−1

r[n] =

n for n ≥ 00 elsewhere

z(z−1)2

anu[n] zz−a

(1− an)u[n] z(1−a)(z−a)(z−1)

cos(nΩ0)u[n] z(z−cos(Ω0)

z2−2z cos(Ω0)+1

sin(nΩ0)u[n] z sin(Ω0)

z2−2z cos(Ω0)+1

an sin(nΩ0)u[n] az sin(Ω0)

z2−2az cos(Ω0)+a2

The z-Transform representation has therefore to be separated using partial

fractions into parts, each of the form of the expressions on the right hand side

of the above table.

Method of Partial Fractions Example

Q. Decompose the following function into partial fractions:

1

(z + 3)(z − 2).

A. Let1

(z + 3)(z − 2)=

A

z + 3+

B

z − 2.

ThenA(z − 2) +B(z + 3) = 1.

So thatAz − 2A+Bz + 3B = 1

z(A+B)− 2A+ 3B = 1

Therefore z(A+B) = 0 ⇒ A = −B and −2A+ 3B = 1 so that −2A− 3A = 1giving A = − 1

5and B = 1

5.

Check:

A

z + 3+

B

z − 2=− 1

5

z + 3+

15

z − 2=

15

(5)

(z + 3)(z + 2)=

1

(z + 3)(z + 2)

Method of Partial Fractions: Cover up method Example

Q. Decompose the following function into partial fractions:

z

(z + 3)(z − 2).

A. Let z(z+3)(z−2)

= Az+3

+ Bz−2

. To find A ⇒ z + 3 = 0⇒ z = −3.

A =z

(z + 3)(z − 2)

˛z=−3

=−3

−3− 2=

3

5.

To find B ⇒ z − 2 = 0⇒ z = 2.

B =z

(z + 3)(z − 2)

˛z=2

=2

2 + 3=

2

5.

Hencez

(z + 3)(z − 2)=

35

z + 3+

25

z − 2.

Check:

35

z + 3+

25

z − 2=

35

(z − 2) + 25

(z + 3)

(z + 3)(z − 2)=

35z − 6

5+ 2

5z + 6

5

(z + 3)(z − 2)=

z

(z + 3)(z − 2).

Inverse z-Transform Example

Q. Find the inverse z-Transform of:

X(z) =1

(z + 3)(z − 2)=

1

5

„1

z − 2−

1

z + 3

«. (1)

A. Re-writing (1) to

X(z) =z−1

5

„z

z − 2−

z

z + 3

«. (2)

Enables us to find inverse z-Transforms for the two terms inside the brackets:

Z−1

„z

z − 2

«= 2nu[n]

and

Z−1

„−

z

z + 3

«= −((−3)n)u[n].

The two terms are multiplied by z−1 which is equivalent to a time delay hence thefinal signal is given by:

x[n] = Z−1(X(z)) =1

5

“2(n−1)u[n− 1]− ((−3)(n−1))u[n− 1]

”.

Inverse z-Transform Example

Q. Find the inverse z-Transform of:

X(z) =z

(z + 3)(z − 2).

A. From earlier the partial fraction expansion is given by: z(z+3)(z−2)

=35

z+3+

25

z−2.

(i) However it is more convenient if wedivide both sides by z first. Hence

X(z)

z=

1

(z + 3)(z − 2).

The Right Hand Side (RHS) has partialfractions (see earlier slide):

X(z)

z=− 1

5

z + 3+

15

z − 2.

Multiplying both sides by z then gives:

X(z) =1

5

„−zz + 3

+z

z − 2

«.

(ii) We saw earlier:

Z−1

„z

z − 2

«= 2nu[n]

and

Z−1

„−

z

z + 3

«= −((−3)n)u[n]

so that

x[n] =Z−1(X(z))

=1

5

“2(n)u[n]− ((−3)(n))u[n]

”.

Inverse z-Transform: Algebraic Long Division

The numerator and the denominator of the z-Transform can be divided using algebraiclong division to find coefficients that correspond to the original signal.ExampleQ. Given H(z) = z

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

z2+z−2, determine the coefficients.

A. Via algebraic or polynomial longdivision:

z−1 − z−2 + 3z−3 − 5z−4...

z2 + z − 2dz

z + 1 − 2z−1

− 1 + 2z−1

−1 − z−1 + 2z−2

3z−1 − 2z−2

3z−1 + 3z−2 − 5z−3

− 5z−2 + 5z−3

...

So the coefficients of the original signalare given by:x[0] = 0, x[1] = 1, x[2] = −1, x[3] = 3,x[4] = −5, etc.This can be checked by performing theinverse z-Transform on H(z).Expansion with partial fractions gives:

H(z) = 13

“z

z−1− z

z+2

”Inverse z-Transform: x[n] =Z−1(H(z)) = 1

3(u[n]− (−2)nu[n])

Then x[0] = 13

(1− 1) = 0,

x[1] = 13

(1 + 2) = 1,

x[2] = 13

(1− 4) = −1,

x[3] = 13

(1 + 8) = 3,

x[4] = 13

(1− 15) = −5, etc.This confirms the long division result.

Inverse z-Transform Example

Q. Find the inverse z-Transform of:

X(z) =0.5z

z2 − z + 0.5(3)

A. The table of z-Transform pairs has the following definition:

Z−1

„az sin(Ω0)

(z2 − 2az cos(Ω0) + a2)

«= an sin(nΩ0)u[n]. (4)

Therefore we can try to equate the terms inside (4) and (3).

In the numerator: a sin(Ω0) = 0.5, and in the denominator a2 = 0.5

⇒ a =√

0.5, then sin(Ω0) = 0.5/√

0.5,⇒ Ω0 = sin−1(0.5/√

0.5) =π

4.

We can therefore plug these values into the result of (4) to find the inversez-Transform of (3):

x[n] = Z−1

„0.5z

z2 − z + 0.5

«= (√

0.5)n sin(nπ/4)u[n].

Outline

OverviewLecture Contents

Introduction

z-TransformTime Delays in z-Transform Representations

The Inverse z-Transform

StabilityBIBO Stability

BIBO Stability

I A linear system is said to be stable if it has:

I A Bounded Output for A Bounded Input

I Bounded means the signal does not exceed a particular value.

I System stability is expressed using a function of the impulse response h[n]of the system:

∞X−∞

|h[n]| <∞ (5)

where |h[n]| is the absolute value of h[n]. i.e. | − h[n]| = |h[n]|.I Equation (5) states that the sum across all values of the impulse function

should be smaller than infinity (∞).

I This ensures that the system is bounded and will not be larger thaninfinity for some input

I If equation (5) is true then the system can be described as being BIBOstable.

I A system is not usually very useful if it goes to ±infinity.

z-Transform and Stability

I The z-Transform can be used to determine if a system is stable.

I The z-Transform results in a rational function consisting of a numeratorN(z) and a denominator D(z)

X(z) =N(z)

D(z)

I X(z) can be

I A system inputI A system outputI A system transfer function

I The stability of X(z) can be found by the roots of N(z) and D(z):

X(z) =N(z)

D(z)=K(z − z1)(z − z2)(z − z3)...

(z − p1)(z − p2)(z − p3)...

z-Transform and Stability

X(z) =N(z)

D(z)=K(z − z1)(z − z2)(z − z3)...

(z − p1)(z − p2)(z − p3)...

I The roots of the numerator are z1, z2, z3... known as zeros

I The roots of the denominator are p1, p2, p3... known as poles

I The zeros are values of z that make X(z)→ 0I e.g. if z = z1 then

X(z = z1) =N(z = z1)

D(z = z1)=K(z1 − z1)(z1 − z2)(z1 − z3)...

(z1 − p1)(z1 − p2)(z1 − p3)...

=K × 0× (z1 − z2)(z1 − z3)...

(z1 − p1)(z1 − p2)(z1 − p3)...= 0

I The poles are values of z that make X(z)→∞I e.g. if z = p1 then

X(z = p1) =N1

D1=K(p1 − z1)(p1 − z2)(p1 − z3)...

(p1 − p1)(p1 − p2)(p1 − p3)...

=K(p1 − z1)(p1 − z2)(p1 − z3)...

0× (p1 − p2)(p1 − p3)...=K...

0=∞

z-Transform and Stability: z-Plane

A z-Transform can be represented graphically with the z-Plane.

I The z-Plane is complex(a+ jb) where j =

√−1

I The vertical axis (↑) isimaginary (b)

I The horizontal axis (→) is real(a)

I The z-Plane is also known asan Argand diagram

z-Transform and Stability: z-Plane

X(z) =N(z)

D(z)=K(z − z1)(z − z2)(z − z3)...

(z − p1)(z − p2)(z − p3)...

I Each zero: z1, z2, z3, ... isrepresented by a circle: O

I Each pole: p1, p2, p3, ... isrepresented by a cross: X

I e.g. X(z) = z−1(z+0.5)(z−0.4)

then

I z1 = 1 + 0jI p1 = −0.5 + 0jI p2 = 0.4 + 0j

z-Transform and Stability: z-Plane

Stability is determined by the location of the poles in the z-plane.Example

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

=1

(z − a)

I From the table of z-Transform pairs:

I Z−1(

zz−a

)= anu[n]

I ∴ let H(z) = z−1(

zz−a

)I z−1 is a unit delay hence:

I x[n] = an−1u[n− 1]I So that x[0] = 0, x[1] = 1, x[2] = a, x[3] = a2, x[4] = a3 etc.

z-Transform and Stability: z-Plane

I x[n] = an−1u[n− 1]I x[0] = 0, x[1] = 1, x[2] = a, x[3] = a2, x[4] = a3 etc.

I If a = 0.99I Decreasing and tending to zero (x[n]→ 0) when a < 1

z-Transform and Stability: z-Plane

I x[n] = an−1u[n− 1]I x[0] = 0, x[1] = 1, x[2] = a, x[3] = a2, x[4] = a3 etc.

I If a = 1.01I Increasing and tending to infinity (x[n]→∞) when a > 1

z-Transform and Stability: z-Plane

x[n] = an−1u[n− 1]I Decreasing and tending to zero (x[n]→ 0) when a < 1I Increasing and tending to infinity (x[n]→∞) when a > 1

These observations are true more generally:

X(z) =N(z)

D(z)=K(z − z1)(z − z2)(z − z3)...

(z − p1)(z − p2)(z − p3)...

If the magnitude of any pole (pi) is greater than 1 then the system will tend to infinity.

I A unit circle is drawn on thez-plane.

I If any pole is outside of the unitcircle then the system is notstable.

z-Plane and Stability: Magnitude Example

If the magnitude of any pole (pi) is greater than 1 then the system will tend to infinity.Q. Determine whether the following system is stable:

H(z) =1

(z − 0.7 + 0.8j)(z − 0.7− 0.8j)

A. The system has two poles at:

p1 = 0.7− 0.8j and p2 = 0.7 + 0.8j.

The distance from the origin of thesepoles is given by the magnitude:

r =p

0.72 + 0.82 = 1.063 > 1.

These poles are beyond the unit circle,therefore this system is not stable.

z-Plane and Stability: Magnitude Example

Q. Determine whether the following system is stable:

H(z) =1

(z − 0.5− 0.5j)(z − 0.5 + 0.5j)

A. The system has two poles at:

p1 = 0.5 + 0.5j and p2 = 0.5− 0.5j

The distance from the origin of thesepoles is given by the magnitude:

r =p

0.52 + 0.52 = 0.707 < 1.

These poles are inside the unit circle,therefore this system is stable.

z-Plane and The Zeros

The z-Plane zeros:I Do not determine stability:

I They can be located anywhere in the z-Plane without directlyaffecting stability

I If a zero is located at the origin then there is a time advanceof a signal

I If there are more zeros than poles then the system startsbefore n = 0 and is therefore not causal

I It is usually desirable to have the same number of poles andzeros in a system to:

I Ensure minimum delay or time lagI Ensure the system is causal

z-Plane and The Zeros Example

The inverse z-Transform of:

H(z) =1

z − 0.4= z−1

(z

z − 0.4

)is given by (using the table of z-Transform pairs):

x[n] = 0.4n−1u[n− 1],

which has a delay of 1 time interval. If we provide H(z) with azero at the origin (i.e. z1 = 0) so that:

H(z) =z − z1

z − 0.4=

z

z − 0.4

then the inverse z-Transform is given by:

x[n] = 0.4nu[n],

which has no time delay.

Lecture Summary

Today’s lecture has covered:

I The z-Transform

I The inverse z-Transform

I Stability analysis using the z-plane

I Partial fractions

I The z-Transform and time delays