Homework # 1 Ch.2 # 21, 23, 28, 30, 32, 33, 35, 38, 40 Dr. Ray Kwok SJSU Fall 2013 2.21 A discrete-time signal x[n] is shown here. Sketch and label carefully each of the following signals. (a) x[n-2] shift 2 to the right (b) x[4-n] flip about the 0-axis and shift 4 to the right (c) x[2n] shrink by a factor of 2 (d) x[n]u[2-n] cut off n>2 (e) x[n-1]δ[n-3] x[2] when n=3, x[n]=0 for all other n. Dr. Ray Kwok Homework # 1 2 2.23 For each of the following systems, determine whether the system is (1) stable, (2) causal, (3) linear, and (4) time invariant. (a) y[ n ]. ≡ T ( x[ n]) = cos(πn) ⋅ x[ n] Stable –x[n] is defined and cosine is finite. Causal – y[n] only depends on present value of n. Linear. y1[n] ≡ T ( x1[n]) = cos(πn) ⋅ x1[n] y2 [n] ≡ T ( x2 [n]) = cos(πn) ⋅ x2 [ n] ay1[ n] + by2 [ n] = cos(πn) ⋅ (ax1[ n] + bx2 [n]) = T ( ax1[n] + bx2 [n]) It’s NOT time invariant. cos(πn) = (− 1) n y[n] = T ( x[n]) = cos(πn) ⋅ x[n] = (− 1) x[n] n y[n − 1] = (− 1) n −1 Dr. Ray Kwok x[n − 1] ≠ (− 1) x[n − 1] n Homework # 1 3 2.23 (b) T ( x[n]) = x[n 2 ] Stable –x[n] is defined and so is x[n2]. It is NOT causal – y[n] only depends on future value of n2. Linear. y1[n] ≡ T ( x1[n]) = x1[n 2 ] y2 [n] ≡ T ( x2 [n]) = x2 [ n 2 ] ay1[n] + by2 [ n] = ax1[ n 2 ] + bx2 [n 2 ] = T (ax1[n] + bx2 [ n]) It’s NOT time invariant. y[n] = T ( x[n]) = x[n 2 ] y[n − no ] = x[(n − no ) ] ≠ x[n 2 − no ] 2 Dr. Ray Kwok Homework # 1 4 2.23 ∞ (c) T ( x[ n]) = x[n]∑ δ [n − k ] k =0 Stable –x[n] is defined and so is the delta function. Causal – y[n] only depends on present value of n. Linear. ∞ y1[n] ≡ T ( x1[ n]) = x1[n]∑ δ [ n − k ] k =0 ∞ y2 [n] ≡ T ( x2 [n]) = x2 [n]∑ δ [n − k ] k =0 ∞ ay1[ n] + by2 [n] = (ax1[n] + bx2 [ n])∑ δ [n − k ] = T ( ax1[n] + bx2 [ n]) k =0 It’s NOT time invariant. ∞ y[n] = T ( x[n]) = x[n]∑ δ [n − k ] k =0 ∞ ∞ k =0 k =0 y[n − no ] = x[n − no ]∑ δ [n − no − k ] ≠ x[n − no ]∑ δ [ n − k ] Dr. Ray Kwok Homework # 1 5 2.23 (d) T ( x[n]) = ∞ ∑ x[k ] k = n −1 NOT stable – the infinite sum can diverge easily. NOT Causal – it sums all future k > n. Linear. ∞ ∑ x [k ] y1[n] ≡ T ( x1[ n]) = 1 k = n −1 ∞ ∑ x [k ] y2 [n] ≡ T ( x2 [n]) = 2 k = n −1 ay1[ n] + by2 [ n] = ∞ ∑ (ax [k ] + bx [k ]) = T (ax [n] + bx [n]) 1 2 1 2 k = n −1 It’s time invariant. y[n] = T ( x[n]) = ∞ ∑ x[k ] k = n −1 y[n − no ] = Dr. Ray Kwok ∞ ∞ k = n − no −1 k = n −1 ∞ ∑ x[k ] = ∑ x[k − n ] = ∑ x[q] o q = n −1− no Homework # 1 6 2.28 Four input-output pairs of a particular system S are specified in Fig. Can system S be time-invariant? Explain. (a) No. x4 = δ [ n ] y4 = δ [n] + δ [n − 1] x3 = δ [n − 1] + ⋅ ⋅ ⋅ y3 = δ [n − 1] + ⋅ ⋅ ⋅ But it doesn’t. or x4 = δ [ n ] y4 = δ [n] + δ [n − 1] x2 = δ [ n ] + ⋅ ⋅ ⋅ y2 = δ [n] + ⋅ ⋅ ⋅ Dr. Ray Kwok But it doesn’t. Homework # 1 7 2.28 (b) Can system S be linear? Explain. No, it’s not linear. See for example, x1 + x2 = 2( x3 + x4 ) but Dr. Ray Kwok y1 + y2 ≠ 2( y3 + y4 ) Homework # 1 8 2.28 (c) Suppose (2) & (3) are input-output pairs of a particular system S2, and the system is known to be LTI. What is h[n], the impulse response of the system? One can construct a δ[n] by x3 [n + 1] − x3 [n] + x2 [n] = δ [ n] 2 The output h[n] would then be Dr. Ray Kwok y3[n + 1] − y3[n] + y2 [n] 2 (δ [n − 1] − δ [n − 5]) + y2 [n] h[n] = 2 2δ [n − 1] + 2δ [n − 3] h[n] = 2 h[n] = δ [n − 1] + δ [n − 3] h[n] = Homework # 1 9 2.28 (d) Suppose (1) is the input-output pair of an LTI system S3. What is the output of this system for the input in the Figure? The input x[n] can be construct by x[n] = x1[n] + x1[n − 2] So the output should be y[n] = y1[n] + y1[n − 2] y[n] = δ [n] + δ [n − 2] + δ [n − 3] + δ [n − 4] + δ [n − 5] + δ [n − 6] y[n] = δ [n] + u[n − 2] − u[n − 6] Dr. Ray Kwok Homework # 1 10 2.30 Consider the cascade connection of two LTI systems in the figure (a) Determine and sketch w[n] if x[n]=(-1)nu[n]. Also determine the overall output y[n]. y[n] = w[n] ∗ h2 [n] = ∞ ∑ w[n − k ]h [k ] 2 k = −∞ w[n] = x[n] ∗ h1[n] = y[n < −3] = 0 y[−3] = 1 y[−2] = 1 y[−1] = 2 y[0] = 2 y[1] = 1 y[2] = 1 y[n > 2] = 0 ∞ ∑ x[k ]h [n − k ] 1 k = −∞ w[n < 0] = 0 w[0] = 1 w[1] = 0 w[2] = 1 w[n ≥ 3] = 0 Dr. Ray Kwok Homework # 1 11 2.30 (b) Determine and sketch the overall impulse response of the cascade system. i.e., plot the output y[n] = h[n] (when x[n] = δ[n]). h[ n] = h1[n] ∗ h2 [n] = ∞ ∑ h [n − k ]h [k ] 1 2 k = −∞ h[n < −3] = 0 h[−3] = 1 h[−2] = 2 h[−1] = 3 h[0] = 4 h[1] = 3 h[2] = 2 h[3] = 1 h[n > 3] = 0 Dr. Ray Kwok Homework # 1 12 2.30 (c) Now consider the input x[n] = 2δ[n] + 4δ[n-4] – 2δ[n-12]. Sketch w[n]. w[n] = x[n] ∗ h1[n] = ∞ ∑ x[k ]h [n − k ] 1 k = −∞ w[n] = ∞ ∑ (2δ [k ] + 4δ [k − 4] − 2δ [k − 12])h [n − k ] 1 k = −∞ w[n] = 2h1[n] + 4h1[n − 4] − 2h1[n − 12] Dr. Ray Kwok Homework # 1 13 2.30 (d) For the input in part (c), write an expression for the output y[n] in terms of the overall impulse response h[n] as defined in part (b). Make a carefully labeled sketch of your answer. y[ n] = x[n] ∗ h[n] = ∞ ∑ x[k ]h[n − k ] k = −∞ y[ n] = 2h[n] + 4h[n − 4] − 2h[n − 12] Dr. Ray Kwok Homework # 1 14 2.32 For (a) ( ) X e jω = (This is the Example 2.21 in the textbook.) 1 1 − ae − jω 1 1 1 1 . + Re X e jω = X e jω + X * e jω = 2 2 1 − a (cos ω − j sin ω ) 1 − a(cos ω + j sin ω ) [ ( )] [ ( ) [ ( )] Re X e jω = (b) ( )] 1 − a cos ω 1 − a cos ω = 2 (1 − a cos ω ) + a 2 sin 2 ω 1 − 2a cos ω + a 2 1 1 1 1 − Im. X e jω = X e jω − X * e jω = 2j 2 j 1 − a (cos ω − j sin ω ) 1 − a (cos ω + j sin ω ) [ ( )] [ ( )] Im X e jω = (c) with -1 < a < 0, determine and sketch the following as a function of ω: [ ( ) ( )] − a sin ω 1 − 2a cos ω + a 2 1 1 X. e jω = X e jω X * e jω = 1 − a(cos ω − j sin ω ) 1 − a(cos ω + j sin ω ) 1 X e jω = 1 − 2a cos ω + a 2 ( ) ( ) ( ) ( ) (d) ( ) ∠.X e Dr. Ray Kwok jω [ ( )] = tan [ ( )] Im X e jω = tan jω Re X e −1 −1 − a sin ω 1 − a cos ω Homework # 1 15 2.33 Consider an LTI system defined by the difference equation (a) Determine the impulse response of this system. y[n] = -2x[n] + 4x[n-1] – 2x[n-2] h[n] = −2δ [n] + 4δ [n − 1] − 2δ [n − 2] (b) Determine the frequency response of this system. Express your answer in the form of H (e jω ) = A(e jω )e − jωnd where A(ejω) is a real function of ω. Explicity specify A(ejω) and the delay of nd of this system. h[n] = −2δ [n] + 4δ [n − 1] − 2δ [n − 2] H (e jω ) = −2 + 4e − jω − 2e − j 2ω H (e jω ) = −2e − jω (e jω − 2 + e − jω ) = −2e − jω (2 cos ω − 2) = 4e − jω (1 − cos ω ) = 4e − jω (2 sin 2 (ω / 2)) H (e jω ) = 8e − jω sin 2 (ω / 2) Delay nd = 1 Dr. Ray Kwok Homework # 1 16 2.33 (c) Sketch a plot of the magnitude |H(ejω)| and a plot of the phase H (e jω ) = 8e − jω sin 2 (ω / 2) H (e jω ) = 8 sin 2 (ω / 2) ∠H (e jω ) = −ω Dr. Ray Kwok Homework # 1 17 2.33 (d) j 0.5πn Suppose that the input to the system is x1[n] = 1 + e Use the frequency response function to determine the corresponding output y1[n]. See section 2.9.6 in the textbook. If x[n] = e jωn y[ n] = H (e jω )e jωn Here x1[ n] = 1 + e j 0.5πn = e j 0 n + e j 0.5πn y1[n] = H (e j 0 )e j 0 n + H (e j 0.5π )e j 0.5πn with H (e jω ) = 8e − jω sin 2 (ω / 2) y1[n] = 0 + 8e − jπ / 2 sin 2 (π / 4)e − jnπ / 2 y1[n] = 4e − j ( n −1)π / 2 Dr. Ray Kwok Homework # 1 18 2.33 ( j 0.5πn ) u[n] Now suppose that the input to the system is x2 [n] = 1 + e Use the defining difference equation or discrete convolution to determine the corresponding output y2[n]. Compare y1[n] and y2[n]. They should be equal for certain values of n. Over what range of values of n are they equal? (d) y 2 [ n] = ∞ ∞ ∑ h[k ]x [n − k ] = ∑ h[k ](1 + e j ( n − k )π / 2 2 k = −∞ k = −∞ )u[n − k ] = ∑ h[k ](1 + e n j ( n − k )π / 2 ) k = −∞ ( n y2 [n] = ∑ h[k ] 1 + e j ( n − k )π / 2 For a causal system, h[n]=0 if n<0. So, n >=0 and ) k =0 y2 [n] = −2 + 4 − 2 − 2∑ e − jkπ / 2 + 4∑ e − jkπ / 2e jπ / 2 − 2∑ e − jkπ / 2 e jπ n y 2 [ n] = 4 j ∑ e k =0 ∞ ( k =0 ∞ ∞ y2 [n] = ∑ h[k ] + ∑ h[k ]e k =0 ∞ ) ∑ h[k ](1 + e y2 [n] = ∑ h[k ] 1 + e j ( n − k )π / 2 − j ( n − k )π / 2 − jkπ / 2 e jnπ / 2 ) − ∞ ∑ h[k ](1 + e j ( n − k )π / 2 ) k = n +1 y2 [n] = H (e j 0 ) + H (e jπ / 2 )e jnπ / 2 − ∞ ∑ h[k ](1 + e j ( n − k )π / 2 ) k = n +1 y2 [n] = y1[n] − ∑ h[k ](1 + e 1 − e − jnπ / 2 = 4 j − jπ / 2 1 − e k = n +1 k =0 ∞ − jkπ / 2 j ( n − k )π / 2 h[n] = −2δ [n] + 4δ [n − 1] − 2δ [n − 2] h[n > 2] = 0 ∴ y2 [ n] = y1[n] ) for n>2 k = n +1 Dr. Ray Kwok Homework # 1 19 2.35 An LTI system has the input and impulse response given by the following plots: (a) Use discrete convolution to determine the output of the system y[n] = x[n]*h[n] for the above input. Give your answer as a carefully labeled sketch of y[n] over a range sufficient to define it completely. y[n] = x[n] ∗ h[ n] = ∞ ∑ x[k ]h[n − k ] k = −∞ y[n<0]=0 y[0] = 1 y[1] = 0 y[2] = 1 y[3] = 0 y[4] = 5 y[5] = 0 y[6] = 1 y[7] = 0 y[8] = 1 y[n>8] = 0 Dr. Ray Kwok Homework # 1 20 2.35 b) The deterministic autocorrelation of a signal x[n] is defined in Eq.(2.188) as cxx[n] = x[n]*x[-n]. The system defined by figures above is a matched filter for the input shown. Noting that h[n] = x[-(n-4)], express the output in part (a) in terms of cxx[n]. chh [l] ≡ ∞ ∑ h[k ]h[l + k ] k = −∞ h[n] = x[−(n − 4)] y[n] = x[n] ∗ h[n] = y[n] = ∞ ∞ k = −∞ k = −∞ ∑ x[k ]h[n − k ] = ∑ x[k ]x[−((n − k ) − 4)] ∞ ∑ x[k ]x[(4 − n) + k ] = c xx [ 4 − n] k = −∞ Dr. Ray Kwok Homework # 1 21 2.35 c) Determine the output of the system whose impulse response is h[n] when the input is x[n] = u[n+2]. Sketch your answer. y[n] = x[ n] ∗ h[n] = ∞ ∞ k = −∞ k = −∞ ∑ x[k ]h[n − k ] = ∑ u[k + 2]h[n − k ] ⋅⋅⋅ Dr. Ray Kwok Homework # 1 y[n<-2]=0 y[-2] = 1 y[-1] = 2 y[0] = 3 y[1] = 2 y[2] = 3 y[n>2] = 3 22 2.38 Consider the cascade of two LTI systems in the figure The impulse responses of the two systems are: h1[n] = u[n − 5] 1, 0 ≤ n ≤ 4 h2 [n] = 0, otherwise (a) Make a sketch showing both h2[k] and h1[n-k] (for some arbitrary n<0) as function of k. Dr. Ray Kwok Homework # 1 23 2.38 b) Determine h[n] = h1[k]*h2[n] , the impulse response of the overall system. Give your answer as an equation (or set of equations) that define h[n] for − ∞ < n < ∞ or as a carefully labeled plot of h[n] over a range sufficient to define it completely. h[n] = h1[n] ∗ h2 [n] = ∞ ∑ h [k ]h [n − k ] 1 2 k = −∞ y[n<5]=0 y[5] = 1 y[6] = 2 y[7] = 3 y[8] = 4 y[9] = 5 y[n>9] = 5 Dr. Ray Kwok Homework # 1 24 2.40 Determine which of the following signals is periodic. If a signal is periodic, determine its period. x[n] = e j (2πn / 5 ) Periodic. (b) x[n] = sin(πn / 19) Periodic. (c) x[n] = ne jπn Not periodic because of the “n” in front of the exponential. (c) x[n] = e jn Not periodic. (a) x[n + N ] = e j 2π ( n + N ) / 5 = x[n] 2πN = 2π 5 N =5 π x[n + N ] = sin (n + N ) = x[n] 19 πN = 2π 19 N = 38 x[n + N ] = e j ( n + N ) = x[ n] N = 2π Dr. Ray Kwok Homework # 1 which is not an integer. 25