MATH 267 Due: March 28, 2012, in the class ASSIGNMENT # 9 You have FIVE problems to hand-in. Hand in written solutions for grading at the BEGINNING of the lecture on the due date. Illegible, disorganized or partial solutions will receive no credit. *Staple your HW. You will get F IV E marks OFF if you do not staple your HW! Note that the instructor will NOT provide stapler. Note: In the following, we do not distinguish between “length= N discrete-time signals” and “N -periodic discretetime signals”. 1. [Discrte Fourier transform for periodic signals] (a) Find the discrete Fourier transform of the following periodic signals with period N . i. x[n] = cos(2πn). N = 4 ii. y[n] = cos(πn/3) + sin(πn/2). N = 12 (Hint: Express sin and cos using complex exponentials and try to use ‘orthogonality’ to compute the summation. ) (b) Suppose x[n] is a periodic discrete-time signal with period = N . Let x b[k] be its discrete Fourier PN −1 2 transform. Assume x[0] = N and k=0 |b x[k]| = N . Find x[n] and x b[k] for all 0 ≤ n, k ≤ N − 1. (Hint: Use Parseval’s relation. This is similar to one of the class examples.) (c) Let a[n] be a periodic signal with period N = 16 with 1 0 ≤ n ≤ 8, a[n] = 0 9 ≤ n ≤ 12, 1 13 ≤ n ≤ 15. Compute the discrete Fourier transform b a[k]. (This is similar to one of the class examples.) Solution (a): (i) Note cos(2πn) = 1. Thus, x = [1, 1, 1, 1]. And x b[k] = 3 1X x[n]e−i2πkn/4 4 n=0 3 1 X −i2πkn/4 e 4 n=0 ( 1 for k = 0 , = 0 for k = 1, 2, 3. = Thus, x b = [1, 0, 0, 0]. 1 (ii) cos(πn/3) + sin(πn/2) = 12 (eiπn/3 + e−iπn/3 ) + yb[k] = 1 iπn/2 2i (e − e−iπn/2 ). Thus, 11 i 1 X h 1 iπn/3 1 (e + e−iπn/3 ) + (eiπn/2 − e−iπn/2 ) e−i2πkn/12 12 n=0 2 2i = 11 11 1 X iπn/3 1 X iπn/2 (e (e + e−iπn/3 )e−i2πkn/12 + − e−iπn/2 )e−i2πkn/12 24 n=0 24i n=0 = 11 11 1 X iπn/3 −i2πkn/12 1 X −iπn/3 −i2πkn/12 e e + e e 24 n=0 24 n=0 + = 11 11 1 X −iπn/2 −i2πkn/12 1 X iπn/2 −i2πkn/12 e e − e e 24i n=0 24i n=0 11 11 1 X i2π2n/12 −i2πkn/12 1 X −i2π2n/12 −i2πkn/12 e e + e e 24 n=0 24 n=0 + 11 11 1 X i2π3n/12 −i2πkn/12 1 X −i2π3n/12 −i2πkn/12 e e − e e 24i n=0 24i n=0 11 11 1 X i2π(2−k)n/12 1 X i2π(−2−k)n/12 e + e = 24 n=0 24 n=0 + 11 11 1 X i2π(−3−k)n/12 1 X i2π(3−k)n/12 e − e 24i n=0 24i n=0 12 24 + 0 + 0 − 0 12 0 + 24 + 0 − 0 12 = 0 + 0 + 24i −0 12 0 + 0 + 0 − 24i 0 k=2, k = 10 , k = 3, k = 9, k = 0, · · · , 11 but k 6= 2, 3, 9, 10. (using orthogonality) Therefore, yb[k] = 1 2 1 2 1 2i 1 − 2i 0 k=2, k = 10, k = 3, k = 9, k = 0, · · · , 11 but k 6= 2, 3, 9, 10. In other words, 1 1 1 1 yb = [0, 0, , , 0, 0, 0, 0, 0, − , , 0] 2 2i 2i 2 (b): Recall the Parseval’s relation: N −1 N −1 X 1 X |x[n]|2 = |b x[k]|2 N n=0 k=0 Notice that all the entries in the summation are all nonnegative. By the given condition, the right PN −1 2 2 hand side is N . Thus, we see n=0 |x[n]| = N . Now, since x[0] = N , the other entries in the last sum should all vanish, i.e. x[1] = x[2] = · · · = x[N − 1] = 0. Thus, x = [1, 0, 0, · · · , 0]. Now, PN −1 x b[k] = N1 n=0 x[n]e−2πikn/N = 1 + 0 + 0 + · · · + 0 = 1. Thus, x b = [1, 1, 1, · · · , 1]. (c) By time-shift we see that a[n] = b[n + 3] where b[n] is the 16-periodic signal with ( 1 0 ≤ n ≤ 11, b[n] = 0 12 ≤ n ≤ 15, 2 2π Therefore, b a[k] = ei 16 ×3kbb[k] and 15 X bb[k] = 1 b[n]e−i2πkn/16 16 n=0 = 11 1 X −i2πkn/16 e 16 n=0 = 11 1 X −i2πk/16 n [e ] 16 n=0 = 1 1 − e−i 16 ×12 × 16 1 − e−i2πk/16 2πk Therefore, 2πk 1 − e−i 16 ×12 1 b a[k] = e × 16 1 − e−i2πk/16 3πk 1 − e−i 2 ×3k 1 i 3π 8 =e × 16 1 − e−iπk/8 i 2π 16 ×3k 2. [NOT TO HAND IN] (This problem is similar to Example 1 in the online notes “Discrete-Time Fourier Series and Transforms ”.) Consider the “discrete square wave” function x[n] with one period given by 1, −N1 ≤ n ≤ N1 x[n] = 0, otherwise for some positive integer N1 < N , where N is the fundamental period of x[n]. (a) Show that ( x b[k] = 2N1 +1 , N 1 sin[2πk(N1 +1/2)/N ] , N sin(πkN ) k = 0, ±N, ±2N, . . . otherwise (b) Use part (a) and the time shift property to compute the discrete Fourier series coefficients of the function y[n] with one period given by: 0≤n≤8 1, 0, 9 ≤ n ≤ 12 y[n] = 1, 13 ≤ n ≤ 15 3. [Periodic convolution] Consider the folloing signals with period N = 4: a = [1, 0, 1, −1], b = [2, i, 1 + i, 3] (e.g. a[0] = 1, a[3] = −1, b[2] = 1 + i, etc. ) (a) Calculate the periodic convolution a ∗ b by directly calculating the convolution sum. (b) Calculate the Fourier coefficients b a[k] and bb[k]. Use this to compute the Fourier coefficients ad ∗ b[k] for a ∗ b by using the convolution property of the Fourier transform. (c) Find a signal x[n] of period N = 4, such that (a ∗ x)[n] = b[n]. (Hint: you may want to use the convolution property of the Fourier transform/inversion. Remember how we handle the circuit problem. This is similar.) 3 Solution (a) : (a ∗ b)[n] = 3 X a[m]b[n − m] m=0 Thus, (noting b[−1] = b[4 − 1] = b[3]; b[−2] = b[4 − 2] = b[2]; b[−3] = b[4 − 3] = b[1]), (a ∗ b)[0] = 3 X a[m]b[0 − m] = 1 × 2 + 0 × 3 + 1 × (1 + i) + (−1) × i = 3 m=0 (a ∗ b)[1] = 3 X a[m]b[1 − m] = 1 × i + 0 × 2 + 1 × 3 + (−1) × (1 + i) = 2 m=0 (a ∗ b)[2] = 3 X a[m]b[2 − m] = 1 × (1 + i) + 0 × i + 1 × 2 + (−1) × 3 = i m=0 (a ∗ b)[3] = 3 X a[m]b[3 − m] = 1 × 3 + 0 × (1 + i) + 1 × i + (−1) × 2 = 1 + i m=0 So, a ∗ b = [3, 2, i, 1 + i]. (b): Note that e−i2π/4 = eiπ/2 = −i. Thus, e−i2π/4kn = (−i)kn . So, 3 1 1X a[n]e−i2π/4kn = (1 × 1 + 0 × (−i)k + 1 × (−i)2k + (−1) × (−i)3k ) 4 n=0 4 b a[k] = 1 (1 + (−1)k − ik ) 4 = Thus, b a = [1/4, −i/4, 3/4, i/4]. On the other hand, 3 X 1 bb[k] = 1 b[n]e−i2π/4kn = (2 × 1 + i × (−i)k + (1 + i) × (−i)2k + 3 × (−i)3k ) 4 n=0 4 = 1 (2 + (−1)k ik+1 + (1 + i)(−1)k + 3ik ) 4 Thus, bb = [(6 + 2i)/4, (2 + 2i)/4, 0, −i]. Use convolution property for N = 4, to see ad ∗ b[k] = 4b a[k]bb[k] for k = 0, · · · , 3. So, ad ∗ b = [(6 + 2i)/4, (−2i + 2)/4, 0, 1] (c): Take Fourier transform: a[ ∗ x[k] = bb[k] By convolution property (for N = 4), a[ ∗ x[k] = 4b a[k]b x[k] 4 Thus, we see 4b a[k]b x[k] = bb[k] So, x b[1] = (2i − 2)/4, x b[0] = (6 + 2i)/4, x b[2] = 0, x b[3] = −1 i.e. x b = [(3 + i)/2, (−1 + i)/2, 0, −1]. To find x[n], apply the inverse discrete Fourier transform: x[n] = 3 X x b[k]ei2πkn/4 k=0 −1 + i k 3+i +( )i + 0 + (−1)i3k 2 2 3 + i −ik + ik+1 = + + 0 + (−1)k+1 ik 2 2 = Thus, x = [i, 1 + i, 3, 2] 4. [Convolution of non-periodic signals] (This problem is related to the topic and examples we covered in the class on Wed. March 21.) Recall for integers n ∈ Z, ( 1 if n ≥ 0 , u[n] = 0 otherwise. ( δ[n] = 1 if n = 0, 0 otherwise. ( δn0 [n] = 1 if n = n0 , 0 otherwise. Recall the class example (u ∗ u)[n] = (n + 1)u[n]. 100 times z }| { (a) Find (δ2 ∗ δ2 ∗ · · · ∗ δ2 )[n]. (b) Let f [n] = u[n − 2]. g[n] = u[n + 3]. i. Find (f ∗ u)[n]. ii. Find (f ∗ g)[n]. (c) Let ( 1 h[n] = 0 |n| ≤ 3 , otherwise. Find (h ∗ u)[n] i. first, by computing the convolution sum directly; ii. second, by using the algebraic properties of the convolution and using (u ∗ u)[n] = (n + 1)u[n]. Solution (a): Recall δa [n] = δ[n − a] for a ∈ Z. δa ∗ δb = δa+b . By associativity, δa ∗ δb ∗ δc = δa+b+c , and so on. 100 times z }| { Thus, (δ2 ∗ δ2 ∗ · · · ∗ δ2 )[n] = δ2×100 [n] = δ200 [n]. 5 (b); Note that we can write f [n] = (δ2 ∗ u)[n] and g[n] = (δ−3 ∗ u)[n]. Thus, (f ∗ u)[n] = (δ2 ∗ u ∗ u)[n] = (u ∗ u)[n − 2] = (n − 2 + 1)u[n − 2] = (n − 1)u[n − 2] (f ∗ g)[n] = (δ2 ∗ u ∗ δ−3 ∗ u)[n] = (δ2 ∗ δ−3 ∗ u ∗ u)[n] = (δ−1 ∗ u ∗ u)[n] = (n + 1 + 1)u[n + 1] = (n + 2)u[n + 1]. (c): (i): (h ∗ u)[n] = = ∞ X h[m]u[n − m] = m=−∞ n X n X h[m]u[n − m] (require n − m ≥ 0) m=−∞ h[m] m=−∞ for n < −3, 0 = n + 4 for −3 ≤ n ≤ 3, 7 for n > 3. (ii) Note that h[n] = u[n + 3] − u[n − 4] = (δ−3 ∗ u)[n] − (δ4 ∗ u)[n]. Therefore, (h ∗ u)[n] = (δ−3 ∗ u ∗ u)[n] − (δ4 ∗ u ∗ u)[n] = (n + 3 + 1)u[n + 3] − (n − 4 + 1)u[n − 4] = (n + 4)u[n + 3] − (n − 3)u[n − 4] Notice that 0 (n + 4)u[n + 3] − (n − 3)u[n − 4] = n + 4 (n + 4) − (n − 3) = 7 for n < −3, for −3 ≤ n ≤ 3, for n > 3. Thus, the answers in (i) and (ii) coincide. 5. [Discrete-time Fourier transform for non-periodic signals] (We will cover this topic on Monday, March 26.) (a) x[n] = δ2 [n] + δ−2 [n] n (b) y[n] = 51 u[n − 1] |n+1| (c) z[n] = 15 Solution (a) x b(ω) = δb2 (ω) + δb−2 (ω) = e−2iω + e+2iω = 2 cos(2ω) Here in the first equality, we used the linearity and in the second equality we used the time-shift property. (Of course, in this simple case, we can just apply the definition of Fourier transform and the Delta function.) n n−1 (b): y[n] = 51 u[n − 1] = 15 15 u[n − 1]. Thus, using time-shift (using F to denote the discrete-time Fourier transform), 1 1 n−1 1 1 n F[ u[n − 1]](ω) = e−iω F[ u[n]](ω) 5 5 5 5 1 1 = e−iω 1 −iω 5 1 − 5e yb(ω) = (c) Notice that since 1 = u[n] + u[−n − 1], one can write any x[n] as x[n] = x[n]u[n] + x[n]u[−n − 1] 6 z[n] = 1 |n+1| 5 = 1 |n+1| u[n] 5 + 1 |n+1| u[−n 5 z[n] = − 1] which then can be written as 1 n+1 1 −(n+1) u[n] + u[−(n + 1)] 5 5 Thus, zb(ω) = i h 1 i 1 h 1 n −(n+1) F u[n] (ω) + F u[−(n + 1)] (ω) 5 5 5 Note i h 1 1 n u[n] (ω) = 5 1 − 51 e−iω h 1 i h 1 i −(n+1) −n F u[−(n + 1)] (ω) = e+iω F u[−n] (ω) 5 5 i h 1 n u[n] (−ω) = e+iω F 5 1 = eiω 1 − 15 eiω F (time-shift) (time-reversal) Therefore, zb(ω) = 1 1 1 × + eiω 5 1 − 15 e−iω 1 − 15 eiω Remark: The time-reversal property is in the online notes page 12 in the table, and it can also be proved very easily: F[x[−n]](ω) = ∞ X ∞ X x[−n]e−inω = n=−∞ x[m]e−im(−ω) change of index m = −n m=−∞ = F[x[n]](−ω) 6. [Inverse discrete-time Fourier transform for non-periodic signals] (We will cover this topic on Monday, March 26.) Recall the discrete-time Fourier transforms of δn0 [n] and an u[n] (for |a| < 1) are e−iωn0 and respectively. 1 1−ae−iω , Use these to find discrete-time signals x[n], y[n], z[n], whose Fourier transforms are given below. (Here, each answer should be a signal defined on the set of integers: n ∈ Z.) (a) x b(ω) = cos2 ω + cos ω sin ω. (Hint: Can we express this as combination of complex exponentials?) (b) yb(ω) = 1 + ei2ω 1 + 31 e−iω (Hint; you may want to use time-shift property: see the table in page 12 in the online note ” Discrete-time Fourier series and Fourier Transforms”.) (c) zb(ω) = 1 . (1 + 12 e−iω )(1 + 13 e−iω ) (Hint: use partial fractions.) Solution 7 (a): Note that eiω + e−iω eiω − e−iω 2 2 2i 1 2iω 1 = (e + 2 + e−2iω ) + (e2iω − e−2iω ) 4 4i cos2 ω + cos ω sin ω = eiω + e−iω 2 + Thus, denoting the inverse discrete-time Fourier transform by F −1 , we see 1 1 −1 2iω (F [e ][n] + F −1 [2][n] + F −1 [e−2iω ][n]) + (F −1 [e2iω ][n] − F −1 [e−2iω ][n]) 4 4i 1 1 = (δ[n + 2] + 2δ[n] + δ[n − 2]) + (δ[n + 2] − δ[n − 2]) 4 4i 1 1 for n = 2 , 4 − 4i 1 + 1 for n = −2 , = 14 4i for n = 0 , 2 0 otherwise. x[n] = F −1 [b x(ω)][n] = (b) h i h y[n] = F −1 1 [n] + F −1 ei2ω i [n] 1 + 31 e−iω h i2ω i n+2 i2ω u[n + 2]](ω), therefore, F −1 1+e1 e−iω [n] = Note that by the time-shift property, 4 1+e1 e−iω = F[ − 13 3 3 n+2 u[n + 2]. Thurs, − 31 1 n+2 y[n] = δ[n] + − u[n + 2] 3 (c): Use partial fractions to see, 1 (1 + 12 e−iω )(1 + 13 e−iω ) A B = + (1 + 12 e−iω ) (1 + 13 e−iω ) zb(ω) = where 1=A+ A −iω B e + B + e−iω 3 2 Thus, A + B = 1 and A/3 + B/2 = 0, and A = 3, B = −2. Thus, z[n] = 3F −1 h 1 i 1 −iω 2e [n] − 2F −1 h 1 1 −iω 3e 1+ 1+ 1 n 1 n =3 − u[n] + 2 − u[n] 2 3 1 n 1 n = 3 − −2 − u[n] 2 3 ( n n 3 − 12 − 2 − 13 for n ≥ 0 , = 0 otherwise. Second method: Use the convolution property: for x b(ω) = z[n] = (x ∗ y)[n]. 8 1 , 1+ 12 e−iω i [n] yb(ω) = 1 , 1+ 13 e−iω we see Notice that x[n] = − 1 n u[n], 2 y[n] = − 1 n u[n]. 3 Therefore, z[n] = = ∞ X m=−∞ ∞ X m=−∞ x[m]y[n − m] − 1 n−m 1 m u[m] − u[n − m] 2 3 ∞ 1 n X 3 m u[m]u[n − m] (require m ≥ 0 and n − m ≥ 0 ) 3 m=−∞ 2 ( n Pn 3 m − 13 for n ≥ 0 , m=0 2 = 0 otherwise. n+1 3 1 n 1− 2 for n ≥ 0 , − 3 3 1− = 2 0 otherwise. ( 1 n 1 n for n ≥ 0 , −2 − 3 + 3 − 2 = 0 otherwise. = − Check that the two methods gave the same answer. *Staple your HW. You will get F IV E marks OFF if you do not staple your HW! Note that the instructor will NOT provide stapler. 9