Sie sind auf Seite 1von 39

1

IV Discrete Time Fourier transform DTFT. A. Basic Definitions The discrete-time Fourier transform (DTFT) of x(n) is X(ejw) = x(n) e-jwn where w is in radians. X(ejw) is periodic with period 2, since a function of a periodic function is periodic, and has the same period. Since the forward transform is a Fourier series, the inverse transform, x(n) = 1/2 X(ejw) ejwn dw is the formula for the Fourier series coefficient. The frequency response H(ejw) is the DTFT of the impulse response h(n). As with the continuous-time

Fourier transform, the DTFT is used because of the existence of a convolution theorem. Amplitude and Phase of DTFT. X(ejw) = Re { X(ejw) } + j Im { X(ejw) } = | X(ejw) | ej(w) | X(ejw) | = Re2 {X(ejw)} + Im2 {X(ejw)} (w) = arg(X(ejw)) Im(X(ejw)) = tan-1 Re(X(ejw)) + u (-Re(X(ejw)) )

N(ejw) X(ejw) = D(ejw)

then, | N(ejw) | | X(ejw) | = | D(ejw) | If 1 X(ejw) = D(ejw) Then, 1 | X(ejw) | = | D(ejw) |

(w) = arg (N(ejw)) arg ( D(ejw)) B. Simple Examples of Forward and Inverse Transforms Example x(n) = (n) X(ejw) = x(n) e-jwn = (n) e-jwn = 1 = X(ejw) Now Find x(n) x(n)=1/2 1ejwn dw = ejwn/2jn | = 1 for n = 0 for n0

(ejn e- jn) = 2nj sin(n) = n = 1 = (n) Example Find Transfer function or frequency response for a filter h(n) = 1 , 0 n N-1 0 elsewhere. 1-(e-jw )N H(ejw) = 1 (e-jw )n = 1- e-jw for n = 0 for n 0.

for (e-jw ) 1 or w 2k = N for w = 2k Find Amplitude and Phase 1-e-jwN H(ejw) = 1-e-jw

1- cos(wN) + j sin(wN) = 1- cos(w) + j sin(w)

[1- cos(wN)]2+ sin2(wN) | H(ejw) | = [1- cos(w)]2+ sin2(w)

1+ cos2 + sin2 2cos(wN) = 1+ cos2 + sin2 2 cos(w) 2(1- cos(wN)) = 2(1- cos(w))

(w) = tan-1

sin(wN) 1- (cos(wN) + u (- (1- (cos(wN) )) sin(w)

tan-1 1-(cos(w) + u(-(1-(cos(w)))

Find better amplitude and phase response expressions, starting from : 1-e-jwN H(ejw) = 1-e-jw

Example Find the DTFT of x(n) = .5n u(n) X(ejw) = .5n (e-jw )n = (.5 e-jw )n

1 = 1 - .5 e-jw 1 = [1 - .5 cos(w)]2 + [ .5 sin(w)]2

.5 sin(w) exp -j tan-1 1- .5 cos(w) )

10

Example Find the forward and inverse transforms of x(n) = (n) + (n-1) X(ejw) = 1 + e-jw x(n) = 1 / 2 (1+e-jw) ejwn dw = 1 / 2 ejwn dw + 1 /2 ejw(n-1) dw ejwn = 2jn sin(n) = n + (n-1) + ejw(n-1) 2j(n-1) sin( (n-1) |

= sinc(n) + sinc(n-1) = (n) + (n-1)

11

Frequency Response From Difference Equation Shift Theorem: F{x(nno) } = e-jwnX(ejw) Proof: x(nno) e-jwn|n n + no = Given the difference equation, ak y(n-k) = bk x(n-k) find the frequency response H(ejw) Taking the DTFT of both sides, F{ ak y(n-k)} = F{ bk x(n-k)}, ak F{y(n-k)} = bk F{x(n-k)}, Using the shift theorem, Y(ejw) ak e-jwk = X(ejw) bk e-jwk H(ejw) = Y(ejw)/ X(ejw)

12

bk e-jwk = ak e-jw Properties of the DTFT (1) X(ejw) is a periodic function of w, with period 2 (2) If x(n) is a real sequence, then Re (X(ejw)) is an even function of w and Im (X(ejw)) is odd Proof: Re { x(n) e-jwn } = x(n)Re{e-jwn} = x(n) cos(wn) = x(n) cos(-wn) = Re (X (ej(-w))) = Re (X (ejw))

13

Im {X (ejw)} = Im {x(n)[ cos(wn)-j sin(wn)] } = - Im {x(n)[ cos(wn)+ j sin(wn)] } = - Im X(e-jw )

(3) if x(n) is a real sequence, then |X (ej(w))| is an even function of w and arg {X (ejw)} is an odd function of w. Proof: Prove it for |X (ej(w))|2 | X (ejw)|2 = X (ejw) X (ejw)* but X(ejw)* = X (e-jw) so

14

| X (ejw)|2 = X (ejw) X (e-jw) | X (e-jw)|2 = X (e-jw) X (ejw) - arg (X (e-jw)) -x(n)sin(-wn) = - tan-1 x(n)cos(wn) + u (- x(n) cos(wn) ) -x(n)sin(wn) = tan-1 x(n)(cos(wn) - u (- x(n) cos(wn) ) = arg (X (ejw)) arg (X (ejw)) is an odd function.

15

(4) let x(n) be a real, even sequence, x(n) = x(-n). Then X (ejw) is real and Im { X (ejw) } = 0. Proof: X (ejw) = x(n) e-jwn = x(0) + x(n) e-jwn + x(n) e-jwn | x(-n) ejwn x(0) + x(n) (e-jwn + ejwn) = x(0) + 2 x(n) cos(wn) which is real and even.

16

(5) let x(n) be odd and real, x(n) = -x(-n) x(0) = 0. Then X(ejw) is odd and imaginary, so Re{X (ejw)} = 0. Proof: X (ejw) = x(n) e-jwn = x(n) e-jwn + x(n) e-jwn x(n) e-jwn - x(n) ejwn = 2j x(n) (e-jwn - ejwn) / 2j = -2j x(n) sin(wn) which is odd and imaginary (6) F{ x(n-m)} = e-jwm X(ejw)

17

(7) x(n) = ejwn is an eigenfunction of the system, y(n) = h(n) x(n), the corresponding eigenvalue is H(ejw) y(n) = h(k) ejw(n-k) = ejwn h(k)e-jwk = ejwn H(ejw) Note: x(g(n)) e-jf(w)g(n) = X(ejf(w)) Convolution Theorems for the DTFT (8) If x(n), h(n) and y(n) have DTFTs X(ejw), H(ejw) and Y(ejw), and If y(n) = h(k) x(n-k), then Y(ejw) = H(ejw) X(ejw)

18

Proof: Take the Fourier Transforms of both sides as Y (ejw) = h(k) x(n-k) e-jwn e-jwk e-jw(n-k) = h(k) e-jwk x(n-k) e-jw(n-k) = h(k) e-jwk x(m) e-jwm

= H(ejw) X(ejw) (9) F{x(n)h(n)}=1/2 X(ej(w-u)) H(eju)du First Proof : Let X(ej(w-u)) = x(n) e-jn(w-u) and H(eju) = h(m) e-jum on the right

19

hand side above. This gives 1/ 2 x(n) h(m) e-jnw eju(n-m) du = 1/ 2 x(n) h(m) e-jnw eju(n-m) du = x(n) h(n) e-jnw

= F { x(n) h(n) } Second Proof for Property (9) Let x(n) = 1/ 2 X(ejv) ejnv dv and h(n) = 1/ 2 H(eju) ejnu du to get

20

F { x(n) h(n) } = x(n) h(n) e-jnw = 1/42 X(ejv) H(eju) ejn(u+v-w) du dv =1/42 X(ejv) H(eju)[ ejn(u+v-w)] du dv 2 (u+v-w-2n) since e-jnTw = 2/ T (w-2n / T) = 1/2 X(ejv) H(eju) [ (u + v - w) + (u+v-w-2) du dv u = w-v, u = w + 2 - v

21

= 1/2 X(ejv) H (ej(w-v)) dv Third Proof for property (9) Let y(n) = h(n) x(n) . Find Y(ejw) as a function of H(ejw) and X(ejw) h(n) = 1/2 H(ej) ejn d Y(ejw) = x(n) h(n) e-jnw = 1/ 2 H(ej) ejn d x(n) e-jnw = 1/ 2 H(ej) [ x(n) e-jn(w-)] d = 1/ 2 X(ej(w-)) H(ej) d

22

(10) Parsevals Equation


1 h ( n ) x *( n ) = 2 n = 1 x *(n) = 2 1 h n ( ) 2 n = 1 2

jw

H (e jw ) X *(e jw )dw )e jwn dw


jwn

X *(e

so LHS =

X *(e )e

jw

jw

1 dw = 2

X *(e ) h(n)e jwn dw


jw n =

X *(e

) H (e jw )dw = RHS

Ex. Let H(ejw) be a causal, stable allpass filter, i.e. |H(ejw) | = 1 for all w. Prove that h(n) is shift-orthogonal, i.e.
n =

h( n) h( n + m) = ( m)

From (10),

1 h( n) h * ( n + m) = 2 n = 1 = 2

jw 2 jwm | H ( e )| e dw

e jwm dw = (m)

23

Example IIR and FIR filters Ex. Zero Phase averaging filter, FIR, nonrecursive 1 y(n) = (1+2M) if |k| M x(n-k)

1 h(k) = (1+2M)

1 H(ejw) = (1+2M) e-jnw

24

(ejMw- e-jw(M+1) ) = (1-e-jw ) (ej(M+1/2)w-e-jw(M+1/2)) = (ejw/2-e-jw/2 )

1 (1+2M)

1 (1+2M)

1 = (1+2M)

sin((M+1/2)w) sin(w/2)

Example Find G(ejw) if g(n) = x(2n) g(n) = 1/ 2 X(ej) ej(2n) d

25

G(eiw) = g(n) e-jnw = 1/ 2 X(ej) ej2n d e-jnw = 1/ 2 X(ej) [ e-jn(w-2)] d Change of variable to simplify the exponent. u= w- 2, du = -2d d = -1/2 du.

u1 = w +2 = lower limit u2 = w - 2 = upper limit Switch limits and change signs. G(eiw) = 1/ 4 X(ej(w-u)/2) [ e-jnu] du But

26

2 e-jnTw = T so

(w-2n / T)

e-jnu = 2 (u - 2n) G(ejw) = X(ej(w-u)/2) (u-2n) du = 1/2 [ X(ejw/2) + X (ej(w/2-)) ]

= 1/2 [ X(ejw/2) + X ( - ej(w/2)) ] = G(ejw)

27

E. More Examples Example y(n) - a y(n-1) = x(n) b x(n-1) y(n) = x(n) b x(n-1) + a y(n-1) Given a, find b such that the system is allpass. Frequency response is (1-be-jw) H(ejw) = (1-ae-jw) | (1- be-jw) |2 | H(ejw) |2 = | (1- ae-jw) |2 (1+b2 - 2b cos(w)) = (1+a2 - 2a cos(w))

28

(1+ (1/b2) 2 (1/b) cos(w) ) = b2 (1+ a2 - 2a cos(w)) try b = 1/a 1 = a2 (1+ a2 - 2a cos(w)) (1+ a2 2 a cos(w))

Example Let X(ejw) = F{ x(n)} Find the sequence y(n) in terms of x(n) if Y(ejw) = X2(ejw)

29

X2(ejw) = ( x(n) e-jnw) ( x(m) e-jmw ) = y(k) e-jkw note difference indexes x(n) x(m) e-jw(n+m) = y(k) e-jkw e-jw(n+m) = e-jkw solve for n as n+m = k m = k-n m is fixed now, and sum over m disappears. y(k) = x(n) x(k-n)

30

y(n) = x(k) x(n-k) Alternately; use convolution theorem.

Example g(n) = x(n / 2), n even 0 , n odd. Find G(ejw) = g(n) e-jnw = x(n/2) e-jnw = x(n) e-jn(2w) so X (ej2w) = G(ejw) Hard Method g(n) = Same Definition. g(n) = x(n/2) = 1/ 2 X(ej) ej(n/2) d

31

G(eiw) = 1/ 2 X(ej) ej(n/2) d e-jnw = 1/ 2 X(ej) [ e-j(n/2)(-2w)] d e-jn(-2w) = 2 ( - 2w - 2n) use 2 e-jnTw = T = X(ej) ( - 2w - 2n) d (w - 2n / T)

Question; how many values of n will generate a non-zero ( - 2w - 2n),given constant w.

32

Answer; only one, use n = 0. use ( - 2w) and = 2w so = X(ej) ( - 2w) d = X(ej2w) Ex. Ideal LP Filter

ejwn h(n) = (1 / 2) ejwn dw = ej(wc)n e-j(wc)n = (2j) n | 2jn

33

sin(wcn) = n

Ex. Ideal BP Filter

sin(wc2n) - sin(wc1n) h(n) = n

34

How do we implement y(n) = h(n) * x(n) in pseudocode if

sin(wc2n) - sin(wc1n) h(n) = n

35

F. Advanced Topic Number 1

Problems: Applications, such as speech recognition and communications have a continuous stream of samples coming in, and spectral information is needed. Using past samples up to time n, we can calculate a Sliding DTFT of the data in several ways. Solution 1 With samples starting at time 0, and continuing up to time n, we get
Xn (e ) =
jw -jwm x(m)e m=0 n

If x(n) is real, the number of real multiplies is NM = 2(n+1). The problems here are that:

36

(1) NM quickly becomes too large to update in real time, (2) The time variable n causes overflow. Solution 2 We can solve the first problem by defining a spectrum over a fixed window of N samples, starting at time n-(N-1), as
Xn (e )=
jw

m=n-(N-1)

x(m)e-jwm

NM is 2N with N fixed, and n increases as new data comes in. Although the limits on the sum increase, this could be fixed by using a shift register that keeps only the most recent N samples. However, the exponent of e still grows without bound, leading to overflow.

37

Solution 3 We can solve the exponent problem by redefining the spectrum as


Xn (e ) =
jw

m=n-(N-1) n jwn

x(m)e-jw(m-n)

which can be re-written as


Xn (e )= e
jw

m=n-(N-1)

x(m)e-jwm
n1

Now, since
Xn-1 (e )= e
jw jw(n-1)

m=n-(N-1)-1

x(m)e-jwm

we can write
Xn (e jw )= e jw Xn-1 (e jw ) + x(n)-x(n-N)e jwN

Now the exponents are well-behaved, and we have NM = 6 real multiplies.

38

Ex: Suppose that a signal x(n) is being monitored, where x(n) = cos(wo(n)n + (n)) + n(n) and where n(n) represents noise. Here wo(n) denotes a frequency that is slowly changing with time. (a) Indicate a method for calculating and updating a relevant feature vector, over a moving window of N time samples (b) Give a method for estimating wo(n). Solution: Given the number of features NF, define evenly spaced frequencies as w(k) = (/(NF-1))(k-1) . (a) For k between 1 and NF , the kth complex feature X(k), in the feature vector X, is calculated and updated as X(k) = Xn(ejw(k)) on the previous page.

39

(b) At each time n, estimate wo as: Xmax = |X(1) |, wo = w(1) For 2 k NF If( |X(k) | > Xmax)Then Xmax = |X(k) | wo = w(k) Endif End

Das könnte Ihnen auch gefallen