Z Transform When the transform is identical to DFT (11)

74
z Transform Xz xnz n n () () en the transform is identical to DF (11) Xz xnz Xe xne xne n ze n j j n n j kn N n j k k k () () ( ) () () / 2 z e j k

Transcript of Z Transform When the transform is identical to DFT (11)

Page 1: Z Transform When the transform is identical to DFT (11)

z Transformz Transform

X z x n z n

n

( ) ( )

When the transform is identical to DFT

(11)

X z x n z

X e x n e x n e

n

z en

j j n

n

j kn N

n

j k

k k

( ) ( )

( ) ( ) ( ) /

2

z e j k

Page 2: Z Transform When the transform is identical to DFT (11)

z Transformz Transform

(12)

X z x n z

X e x n e x n e

n

z en

j j n

n

Nj kn N

n

N

j k

k k

( ) ( )

( ) ( ) ( ) /

0

12

0

1

The sequence x(n) is non-zero within [0,N-1], hence

The transform is identical to DFT

Page 3: Z Transform When the transform is identical to DFT (11)

Some basic properties of z TransformSome basic properties of z Transform

H z h n z n

n1( ) ( )

1. Basic definition1. Basic definition

h n ah n bh n H z aH z bH z( ) ( ) ( ) ( ) ( ) ( ) 1 2 1 2

2. Linearity2. Linearity

x n k z X zk( ) ( )

3. Delay3. Delay

y n h n x n Y z H z X z( ) ( ) ( ) ( ) ( ) ( )

4. Convolution4. Convolution

Page 4: Z Transform When the transform is identical to DFT (11)

Essential properties of z TransformEssential properties of z Transform

x n z z X z x n z X z

x n z x n

( ) ( ) ( ) ( )

( ) ( )

1 1 1

1

1

1

and

5. Multiplication by ‘z-1’5. Multiplication by ‘z-1’

x n X z( ) ( )

6. Relation between X(z) and X(-z)6. Relation between X(z) and X(-z)

( ) ( ) ( ) 1 n x n X z

x n X z( ) ( )

7. Relation between X(z) and X(z-1)7. Relation between X(z) and X(z-1)

x n X z( ) ( ) 1

Page 5: Z Transform When the transform is identical to DFT (11)

Why z Transform?Why z Transform?

1. z transform can be used to calculate DFT.

2. Filter architecture can be deduced directly from the transfer function in the z domain.

Specify filter characteristics(LP, HP, BP...)

Determine transfer

function H(z)

Determine filter sturcture

Filter structure can be inferred from H(z)

Figure 21

Page 6: Z Transform When the transform is identical to DFT (11)

y (n) = ak y(n-k) +

k=1

Mbk x(n-k)

k= -NF

NF

(13)

Generalised finite order LTI system

Making use of the delay property, equation (4) can be rewritten as

x n z x n( ) ( ) 1 1

y (n) = ak z-k y(n) +

k=1

Mbk z-k

x(n)k= -NF

NF

(14)

Page 7: Z Transform When the transform is identical to DFT (11)

y (n) = ak z-k y(n) +

k=1

Mbk z-k

x(n)k= -NF

NF

(14)

z

b-NF

z-1

bNF

b0 + +

z-1

a1

z-1

aM

x(n) y(n)

Figure 22

Page 8: Z Transform When the transform is identical to DFT (11)

y (n) = ak z-k y(n) +

k=1

Mbk z-k

x(n)k= -NF

NF

(14)

z transform

Y (z) = ak z-k Y(z) +

k=1

Mbk z-k

X(z)k= -NF

NF

(15)

Note the similarity between the time and z domain

Page 9: Z Transform When the transform is identical to DFT (11)

Digital Filter DesignDigital Filter Design

Specify filter characteristics(LP, HP, BP...)

Determine transfer

function H(z)

Construct filter sturcture

Y (z) = ak z-k Y(z) +

k=1

Mbk z-k

X(z)k= -NF

NF

Rarrange H(z) to the form

Figure 21

Page 10: Z Transform When the transform is identical to DFT (11)

Example ( ) =

( )

( )

1- cos

cos

0

0

H zY z

X z

r z

r z r z

1

1 2 21 2

(z) cos ( ) - cos0 0Y r Y z z r Y z z X z r X z z 2 1 2 2 1 ( ) ( ) ( )

(z) ( ) - 1Y a Y z z a Y z z b X z b X z z 1

12

20

1( ) ( ) ( )

z-1

b1

b0 + +

z-1

a1

z-1

a2

x(n) y(n)

Figure 23

Page 11: Z Transform When the transform is identical to DFT (11)

Poles and Zeros of Transfer FunctionPoles and Zeros of Transfer Function

(z)H

b z

a z

kk N

Nk

kk

Mk

F

P

11

Az

c z

d z

Nk

k

N N

kk

MF

P F

1

1

1

1

1

1

= (16)

Poles and zeros are values of ‘z’ which results in H(z) = infinity and zero, respectively

H(z) can be divided into 3 groups for NF > 0 :

Az N F 1 1

1

c zkk

N NP F 1 1

1

d zkk

M

1. 2. 3.

Page 12: Z Transform When the transform is identical to DFT (11)

Poles and Zeros of Transfer FunctionPoles and Zeros of Transfer Function

Gourp 1 Az N F NF poles at z = and NF zeros at z = 0

Gourp 2 a zero at z = ck and a pole at z = 0 for each term from k=1 to NP+NF

1 1

1

c zkk

N NP F

Gourp 3 a zero at z = 0 and a pole at z = dk for each term from k=1 to M

1 1

1

d zkk

M

Page 13: Z Transform When the transform is identical to DFT (11)

Example ( ) =H z z z1

311

( ) =H z Az c z c z1 111

21

The transfer function can be expressed as

= 1

3 and A c

jc

j, ,1 2

1 3

2

1 3

2

Term Group Pole Zero

z 1 0 2 0 c1

1 11 c z

2 0 c2 1 21 c z

Page 14: Z Transform When the transform is identical to DFT (11)

Is a filter useful?Is a filter useful?

A filter transfer function H(z) is only useful if :

1. It is stable

2. It is finite

Page 15: Z Transform When the transform is identical to DFT (11)

Stability of Transfer FunctionStability of Transfer Function

Given a system with unit-sample response

h(n) = [h(0), h(1), ....., h(N-1)] with z transform given by

H(z).

The system is stable if ( )k=-

h k

Finite sequence is generally stable as the absolute sum of finite sample values is always finite

(17)

Page 16: Z Transform When the transform is identical to DFT (11)

Example ( ) = 1

0

h n

for n

otherwise

0

( )k=-

h kk

10

The system is unstable

Page 17: Z Transform When the transform is identical to DFT (11)

Stability of Transfer FunctionStability of Transfer Function

H z

b z

a z

kk

k N

N

kk

k

MF

P

11

Generalized LTI transfer function

b zkk

k N

N

F

P

The numerator is < for finite NP and NF

1

11

a zk

k

k

MThe denominator can lead to unstability

Page 18: Z Transform When the transform is identical to DFT (11)

Stability of Transfer FunctionStability of Transfer Function

Stability of a digital system depends on the pole locations that are contained in

k

kk

M

d z1 11

M

k

kk za

zH

1

1

1

after partial fraction decomposition

M

k

nkk

M

kk nudnh)n(h

11

It can be easily shown that

Page 19: Z Transform When the transform is identical to DFT (11)

Stability of Transfer FunctionStability of Transfer Function

M

k

nkk

M

kk nudnh)n(h

11

For a stable system,

h n d u nkn

k kn

n

0 0

k kn

n

d0

For finite summation result, |dk| < 1.

Page 20: Z Transform When the transform is identical to DFT (11)

Stability of Transfer FunctionStability of Transfer Function

For a stable system,

h n d u nkn

k kn

n

0 0

k kn

n

d0

For finite summation result, |dk| < 1.

dk are the poles of H’(z)

M

k

nkk

M

kk nudnh)n(h

11

Page 21: Z Transform When the transform is identical to DFT (11)

Stability of Transfer FunctionStability of Transfer Function

For a stable system,

h n d u nkn

k kn

n

0 0

k kn

n

d0

For finite summation result, |dk| < 1.

dk are the poles of H’(z)

|dk| < 1 means that the poles of a stable system must lies within the unit circle in the z plane.

M

k

nkk

M

kk nudnh)n(h

11

Page 22: Z Transform When the transform is identical to DFT (11)

Region of Convergence (ROC) of Transfer FunctionRegion of Convergence (ROC) of Transfer Function

A transfer function H(z) is only useful if it is finite, i.e.,

H z h n z n

n

Page 23: Z Transform When the transform is identical to DFT (11)

Two classes of digital filters

y (n) = ak y(n-k) +

k=1

Mbk x(n-k)

k= -NF

NF

(13)

The generalised finite order LTI system

1. Finite Impulse Response (FIR) Filter

2. Infinite Impulse Response (IIR) Filter

formulates an IIR filter

Page 24: Z Transform When the transform is identical to DFT (11)

Two classes of digital filters

y (n) = bk x(n-k)k= 0

N-1(18)

When ak = 0 for all values of k,

formulates an FIR filter

h(n) = [h(0), h(1), ....., h(N-1)] = [b0, b1, .......bN-1]

As N is finite, according to eqn. (17), FIR filter is inherently stable

Page 25: Z Transform When the transform is identical to DFT (11)

FIR filters

z-1 z-1 z-1

h(N-1)

x(n)

y(n)

Figure 24

h(2)h(1)h(0)

H z h k z

h z h z h N

z

k

Nk

N N

N

0

1

1 2

1

0 1 1..... (19)

Page 26: Z Transform When the transform is identical to DFT (11)

FIR filters

Finite Impulse Response (FIR) Filter can guarantee linear phase

With linear phase, all input sinsuoidal components are delayed by the same amount. Consider

x n X z x n k X z z k

x n k X e ej j k In the frequency domain,

Phase delay for frequency = k

Page 27: Z Transform When the transform is identical to DFT (11)

Phase Distortion - example

x n cos n cos n1 0 02( ) Given:

Y e H e X e X e ej j j j jk

According to previous analysis,

y n cos n k cos n k( ) ( ) ( ) 0 02

y n x n h n( ) ( ) ( ) 1

and

H e ej j( )

x n k X e ej j k

(a linear phase X-function)

(Same signal as before, only delay added to each sample)

Page 28: Z Transform When the transform is identical to DFT (11)

Phase Distortion - example

x n cos n cos n1 0 02( ) Given:

y n cos n cos n( )

0 04

2

y n x n h n( ) ( ) ( ) 1

and

H efor

forj( )

/

/

4

0 3 2

3 20

0

y(n) is not the same as x1(n)

(a non-linear phase X-function)

Page 29: Z Transform When the transform is identical to DFT (11)

Analogue Transfer Function H(s)

Inverse Fourier Transform h(t)

Sample Impulse Response h[n]

Corresponding Transfer Function H(z)

H(z) = H(s)?

Page 30: Z Transform When the transform is identical to DFT (11)

h(t)

t

Analogue filter: y(t) = x(t) * h(t)

Y(s) = X(s)H(s)

Page 31: Z Transform When the transform is identical to DFT (11)

Analogue filter: y(t) = x(t) * h(t)

Y(s) = X(s)H(s)

as

sH

1

Given

Applying inverse Laplace Transform

ateth

h(t)

t

1 unit

Page 32: Z Transform When the transform is identical to DFT (11)

Digital filter: Sampled and Digitized x(t) and h(t)

x(t) -> x(n) , h(t) -> h(n)

y(n) = x(n) * h(n)

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

h(t)

t

1 unit

Page 33: Z Transform When the transform is identical to DFT (11)

H z h n z n

( )0

If h(t) is sampled at unit interval, we have

h(t)

t

1 unit

H e h n ej jn

( )0

e ean jn

0

1

1 e ea j

h(t) = e-an for t > 0

Page 34: Z Transform When the transform is identical to DFT (11)

However, h(t) is sampled at interval of TS instead of the following,

h(t)

t

1 unit

0

0

)(

)(

m

njj

n

n

enheH

znhzH

Does sampling rate affects the above transfer function?

Page 35: Z Transform When the transform is identical to DFT (11)

If h(t) is sampled at interval of TS,

h(t)

t

TS unit

1. h(n) will be replace with h(nTS) 2. Frequency will be scaled by 1/TS

Answer this question by computing the transfer function again based on the new sampling rate

Page 36: Z Transform When the transform is identical to DFT (11)

If h(t) is sampled at interval of TS,

h(t)

t

TS unit

1. h(n) will be replace with h(nTS) 2. Frequency will be scaled by 1/TS

0

// )(n

TjnS

Tj SS enTheH

Page 37: Z Transform When the transform is identical to DFT (11)

If h(t) is sampled at interval of TS,

h(t)

t

TS unit

1. h(n) will be replace with h(nTS) 2. Frequency will be scaled by 1/TS

0

// )(n

TjnS

Tj SS enTheH

0

''

)(n

jnS

j enTheH

Page 38: Z Transform When the transform is identical to DFT (11)

If h(t) is sampled at interval of TS,

h(t)

tTS unit

1. h(n) will be replace with h(nTS) 2. Frequency will be scaled by 1/TS

0

// )(n

TjnS

Tj SS enTheH

0

''

)(n

jnS

j enTheH

0

'

)(n

nS znThzH

The transfer function has similar form as before, may not need to re-compute the transfer function again.

Page 39: Z Transform When the transform is identical to DFT (11)

Given (sampling period of 1 unit)

0n

nz)n(hzH

If sampling period changes to TS , then

0

'

)(n

nS znThzH

Page 40: Z Transform When the transform is identical to DFT (11)

Suppose dtethjH tjAA

0

0

'

)(n

nS znThzH

If the analogue unit response is sampled by a period TS ,

Represents the analogue transfer function.

Is the digital response similar to the analogue response?

Page 41: Z Transform When the transform is identical to DFT (11)

Suppose dtethjH tjAA

0

If the analogue unit response is sampled by a period TS ,

Represents the analogue transfer function.

Digital and Analogue responses are equal if the maximum frequency of the signal is restricted to

k

SSATj TkjTjHeH S )/2/(/

ST

M

(otherwise the images start to overlap each other)

(a single spectrum becomes an infinite string of replicas)

Page 42: Z Transform When the transform is identical to DFT (11)

Given

1

1 e eaTjTS S

STjeH /

'

'

1

1

jaT

j

eeeH

S

11

1

ze

zHSaT

jaj

eeeH

1

1 11

1

ze

zHa

Page 43: Z Transform When the transform is identical to DFT (11)

Given a desire response HD(), find hD(n)

h n H e e dD Dj j n( ) ( )

1

2

Applying inverse Fourier Transform, we have,

(20)

Noted that: n is extended to These kind of filter is not available in practice

Page 44: Z Transform When the transform is identical to DFT (11)

with n being infinite and assuming Impulse Invariant, the digital transfer function will be identical to the Analogue ones.

In practice, the FIR structure in figure 24 cannot be infinite, hence n is restricted by a window function wR(n)

2/1-Nn1)/2-N-

for

nhnwnh DRN (21)

jR

jD

jN eWeHeH (22)

circular convolution

Page 45: Z Transform When the transform is identical to DFT (11)

Rectangular Window

Hanning Window

Hamming Window

Blackman Window

1

2cos5.05.0

N

nnw

otherwise

Nnnw

0

2/11

1

2cos46.054.0

N

nnw

1

4cos08.0

1

2cos5.042.0

N

n

N

nnw

Page 46: Z Transform When the transform is identical to DFT (11)

Analogue Transfer Function H(s)

Inverse Fourier Transform h(t)

Sample Impulse Response h[n]

Apply window function w[n]h[n]

Modified Transfer Function H’(z)

Assume Impulse Invariant

Page 47: Z Transform When the transform is identical to DFT (11)

Consider a low pass response H(s)

|H ()|

c-c 0 -

Without window

c-c 0 -

|H ()|

With window

Side lobes

Page 48: Z Transform When the transform is identical to DFT (11)

1. Side lobes decreases stop band attenuation A

c-c 0 -

|H ()|

A

Window A (dB)

Rectangular 21

Hanning 44

Hamming 55

Blackman 75

2. Window determines the length of the FIR filter

Page 49: Z Transform When the transform is identical to DFT (11)

Consider a Low Pass Frequency Response

P0

|H ()|

S

Desired Pass Band Edge Frequency

Stop Band Edge Frequency

Transition Width (TW)

Actual Pass Band Edge Frequency

Page 50: Z Transform When the transform is identical to DFT (11)

Relations between the Window, Filter length and A

z-1 z-1 z-1

h(N-1)

x(n)

y(n)

h(2)h(1)h(0)

N

75Blackman

55Hamming

44Hanning

21Rectangular

A (dB)Window

TW

f s91.0

TW

f s32.3

TW

f s44.3

TW

f s98.5

fs is the sampling frequency

Page 51: Z Transform When the transform is identical to DFT (11)

|HD()|1

c-c 0 -

Figure 25

H efor

oDj c

1

0

therwise c

An ideal LPF

Page 52: Z Transform When the transform is identical to DFT (11)

h n e d e dDj n j n( )

1

21

1

2

n

nsin c

n -n

Figure 26

Page 53: Z Transform When the transform is identical to DFT (11)

Due to windowing, the pass band edge frequency will be shifted to higher frequency end.

Usually the revised pass band edge is taken to be the middle point of the Transition Region, i.e. 2

TWc

hD(n) will be revised as n

nsin

Next select the window that complies with the stop band attenuation A.

Determine the length of the filter N from fS and TW

Page 54: Z Transform When the transform is identical to DFT (11)

The Prolate Spheroidal Wave Sequence (Slepian 1978)

The Prolate sequence is a real sequence of lengh N+1 and unit energy.

Aims at mininizing ripple energy

2jeV

0

Optimal energy concentration at low frequency

Page 55: Z Transform When the transform is identical to DFT (11)

Assuming the sequence is casual and of length N+1, i.e.,

N

n

nznvzV0

deV j

S

2

Since the sequence is unit energy, we have

110

2

0

2 d

eVnv jN

Compute the energy contained in the sequence

Page 56: Z Transform When the transform is identical to DFT (11)

Define an objective function to denote the pass band energy as

deV j

2

0

Maximizing is equivalent to minimizing the stop band energy

i.e., Optimal energy concentration at low frequency

Page 57: Z Transform When the transform is identical to DFT (11)

jj eneV evT

veve !* jjjjj eeeVeVeV 2

Let TNvvvv .....v 210 TNzzzz .....e 211

vRv

ddeV j

0

T2

0

R is a (N+1)x(N+1) matrix with the (m,n) element equals to

nmjnme nmj sincos

Page 58: Z Transform When the transform is identical to DFT (11)

0T vQv

Splitting R() into real and imaginary parts as

QPR j

Nnmmn nm

nmdnmp

,

sincos 00

vPv T

Each entry in

vvvv

dP

dR

deV j

0

T

0

T2

0We have

is real, hence

and

dP0

Page 59: Z Transform When the transform is identical to DFT (11)

Maximization based on Rayleigh’s principle

1 kk vPv

econveniencfor dropping TT PvvvPv

The objective function is maximized if v is the eigenvector corresponding to the maximum eigenvalue of P.

This can be found by the “power method” which is an ilterative process starting with an arbitrary value for v0.

vvvvPvv TTT

maxmax

Search for v in a vast space!

Page 60: Z Transform When the transform is identical to DFT (11)

Step 1 0 kSet

Step 2 kvCompute P

Step 3 kk vves eigenvaluthe set ofFind P :

Step 4 kgenvaluemaximum eiFind :

Step 5 kkk PvvCompute /1

Step 6 2 1 StepGotokk ,

Method does not guarantee the best (optimal) solution and depends on the initial choice of vk

Page 61: Z Transform When the transform is identical to DFT (11)

Better optimization methods:

Simulated Annealing. Binary Genetic Algorithm. Real Coded Genetic Algorithm. Particle Swarm Optimization.

0v

kv

Stuck in comfort zone!

Drive to higher value, but not the other way round

maxvBest position, needs to leave the comfort zone first

x

Page 62: Z Transform When the transform is identical to DFT (11)

Optimal window does not imply optimal filter.

nN

n

znhzH

0

A LPF is optimized if the passband and stopband error are minimum. Consider a linear phase FIR filter. N is even and h(n)=h(N-n)

R

Mjj HeeH

cbcos/

TNM

nnR nbH

2

0

The amplitude response is:

and

Page 63: Z Transform When the transform is identical to DFT (11)

Pbbbccb TTTjS

ddeHE

ss

2

The stopband energy is

bcbc Tj

RHeH 22

dnmp

s

mn coscos

The m,n entry of P is

ES should be zero, otherwise it will become the “stopband error”.

Page 64: Z Transform When the transform is identical to DFT (11)

cbcbb 1TTT

The stopband error is

TTRH bcb 00

d

where

EP

T

TP

0

11 ccQ

Qb,b

The error energy at passband =

The pass band should be flat from DC onwards as

Page 65: Z Transform When the transform is identical to DFT (11)

RbbQbbbPb TTT 1

Which can be rewritten as

PS EE 1

QPR 1

Where

An objective function can now be defined as

The minimum value corresponding to the eigenvector of R with the minimum eigenvalue.

Page 66: Z Transform When the transform is identical to DFT (11)

However the transfer functions of FIR filters are restricted in certain form (as shown below). IIR filters are more flexible and have a counterpart in analog filters.

FIR filters are to design, optimize, and implement. It is also possible to select different window functions to adjust the stop band attenuation.

H z h k z

h z h z h N

z

k

Nk

N N

N

0

1

1 2

1

0 1 1.....

Page 67: Z Transform When the transform is identical to DFT (11)

Eqn. (19) shows that the transfer function of FIR filters are restricted in certain form. IIR filters are more flexible and have a counterpart in analog filters.

Time signal Filter Output

Analog Transfer Function

Digital Transfer Function

DigitalFilter Output

Figure 27

Page 68: Z Transform When the transform is identical to DFT (11)

Stability of filtersAssigning poles at s=-a to H(s) and s=a to H(-s) results in a stable system, i.e.,

H sa s

1

General form of Transfer Function

H s

s z s z s z s z

s p s p s p s p

i N

j N

1 2

1 2

.... ....

.... ....(25)

Page 69: Z Transform When the transform is identical to DFT (11)

Stability of filtersAssigning poles at s=-a to H(s) and s=a to H(-s) results in a stable system, i.e.,

H sa s

1

A pole at s = -pj results in a -20db per decade drop at f = pi

A zero at s = -zi results in a +20db per decade rise at f = zj

H s

s z s z s z s z

s p s p s p s p

i N

j N

1 2

1 2

.... ....

.... ....

General form of Transfer Function

(25)

Page 70: Z Transform When the transform is identical to DFT (11)

f

db p1 z1 z2 p2

Figure 28

Page 71: Z Transform When the transform is identical to DFT (11)

Img

Re

z plane

j

s plane

z=1z=-1

TS

TS

s=0

The problem is obvious: define on the unit circleis limited, extends to infinity!

Page 72: Z Transform When the transform is identical to DFT (11)

fs

20

fs

16

2fs

16

4fs

16

3fs

16

5fs

16

6fs

16

7fs

16

fs

160

2fs

16

3fs

16

7fs

16

6fs

16

5fs

16

4fs

16

- Digital Frequency - Analogue Frequency

For a digital N point sampling lattice, the maximum frequency it can represent is fs/2 (i.e. 1/2TS or rads/s)

The frequency resolution is 2/N

N=16

extends to infinity!

Page 73: Z Transform When the transform is identical to DFT (11)

fs

20

fs

16

2fs

16

4fs

16

3fs

16

5fs

16

6fs

16

7fs

16

fs

160

2fs

16

3fs

16

7fs

16

6fs

16

5fs

16

4fs

16

- Digital Frequency - Analogue Frequency

For a digital N point sampling lattice, the maximum frequency it can represent is fs/2 (i.e. 1/2TS or rads/s)

The frequency resolution is 2/N

N=16fs

16 2fs

16

3fs

16

4fs

16

fs

2= /TS

extends to infinity!

Page 74: Z Transform When the transform is identical to DFT (11)

fs

20

fs

16

2fs

16

4fs

16

3fs

16

5fs

16

6fs

16

7fs

16

fs

160

2fs

16

3fs

16

7fs

16

6fs

16

5fs

16

4fs

16

- Digital Frequency - Analogue Frequency

For a digital N point sampling lattice, the maximum frequency it can represent is fs/2 (i.e. 1/2TS or rads/s)

The frequency resolution is 2/N

N=16fs

16 2fs

16

3fs

16

4fs

16

fs

2

9fs

16

10fs

16?

extends to infinity!