Homework 3 11. Suppose S pp s we have h two t four-point f p int sequences s n s x[n] and nd h[n] as follows: „
x[n] = cos(Ď€n / 2), ) h[n] = 2 n ,
n = 0,1,2,3
n = 0,1,2,3
(a) Calculate the four-point DFT X[k]. (b) Calculate the four-point four point DFT H[k]. H[k] (c) Calculate y[n] = x[n] 4 y[n] by doing the circular convolution directly. directly (d) Calculate y[n] in part (c) by multiplying the DFTs of x[n] and h[n] and performing an inverse DFT. DFT
Homework 3 •
Solution: 3 − j ( 2π / 4 ) kn The formula of four-point DFT X [k ] = ∑ x[n]e . n =0 (a) Substitute x[n] to the formula formula, then X[0] = 1+0+(-1)+0 = 0, X[1] [ ] = 1+(-j)+1+j ( j) j = 2,, X[2] = 1+0+(-1)+0 = 0, X[3] = 1+0+1+0 = 2. (b) Substitute h[n] to the formula, then H[0] = 1+2+4+8 = 15, H[1] = 1+( 1+(-2j)+(-4)+8j 2j)+( 4)+8j = -3+6j, 3+6j H[2] = 1+(-2)+4+(-8) = -5, H[3] [ ] = 1+2j+(-4)+(-8j) j ( ) ( j) = -3-6j. j
Homework 3 •
Solution (cont.): 3 (c) y[n] = x[n] 4 h[n] = ∑ x[m]h[((n − m)) 4 ] . m=0 y[0] = 1·1+0·8+( 1·1+0·8+(-1) 1) ·4+0·2 = -3. 3 y[1] = 1·2+0·1+(-1)·8+0·4 = -6. y[2]] = 1·4+0·2+(-1)·1+0·8 y[ ( ) = 3. y[3] = 1·8+0·4+(-1)·2+0·1 = 6. (d) Y[k] = X[k]·H[k]. Y[0] = 0, Y[1] = -6+12j, Y[2] = 0, Y[3] = -6-12j. 1 3 The formula of of four-point IDFT y[n] = ∑ Y [k ]e j ( 2π / 4) kn. N k =0 y[0] = ¼ (0+( (0+(-6+12j)+0+(-6-12j)) 6+12j)+0+( 6 12j)) = -3. 3 y[1] = ¼ (0+(-6j-12)+0+(6j-12)) = -6. y[2]] = ¼ (0+(6-12j)+0+(6+12j)) y[ ( ( j) ( j)) = 3. y[3] = ¼ (0+(6j+12)+0+(-6j+12)) = 6.
Homework 3 2. Suppose 2 S pp s that th t a computer mp t program p m is available il bl f for computing the DFT
N −1
X [k ] = ∑ x[n]e − j ( 2π / N ) kn ,
k = 0,1,..., N − 1
n =0
i.e., the input to the program is the sequence x[n] and the output is the DFT X[k]. X[k] Show how the input and/or output sequences may be rearranged such that the program p g can also be used to compute p the inverse DFT
1 x[n] = N
N −1
j ( 2π / N ) kn X [ k ] e , ∑ k =0
n = 0,1,..., N − 1
Homework 3 •
Solution: S l ti Given a X[k], k = 0,1,…,N-1. We then obtain a Y[k] as the rearrange of X[k] as follows: Y[0] = X[0], Y[k] = X[N-k], k = 1,2,…,N-1. Taking Y[k] as input of the program, we then obtain N −1
y[n] = ∑ Y [k ]e
− j ( 2π / N ) nk
k =0
N −1
= X [0] + ∑ X [m]e
N −1
= X [0] + ∑ X [ N − k ]e − j ( 2π / N ) nk k =1
− j ( 2π / N ) n ( N − m )
m =1
N −1
= X [0] + ∑ X [m]e j ( 2π / N ) nm e − j 2πn m =1
N −1
= ∑ X [m]e j ( 2π / N ) nm . m =0
Therefore, The IDFT of X[k] can be obtained x[n] =
1 y[n] . N
Homework 3 3. Consider 3 C nsid th the ssystems st ms sh shown n in th the f following ll in fi figure. Suppose that H1(ejw) is fixed and known. Find H2(ejw), the frequency response of an LTI system system, such that y2[n] = y1[n] if the inputs to the systems are the same.
x[n]
↑2
x[n] [ ]
H1(ejw)
↓2
H2(e ( jw)
y2[n] [ ]
y1[n]
Homework 3 •
Solution: S l ti We can analyze the system in the frequency domain:
X(ejw)
↑2
2j ) X(e ( 2jw
H1(ejw)
2j ) H (e j ) jw X(e ( 2jw 1(
↓2
Y1(ejw) is X(e2jw) H1(ejw) downsampled by 2: Y1(ejw) = ½ {X(e2jw/2)H1(ejw/2)+X(e2j(w-2π)/2)H1(ej(w-2π)/2)} j(w 2π))H (e j(w/2 π))} j(w/2-π) = ½ {X( {X(ejw)H1(e ( jw/2)+X(e )+X( j(w-2π) 1( = ½ {H1(ejw/2)+H1(ej(w/2-π))}X(ejw) = H2(ejw)X(ejw) Therefore, H2(ejw) = ½ {H1(ejw/2)+H1(ej(w/2-π))}.
Y1(ejw)