Final Exam Signals & Systems February 9th, 2011 (151-0575-01) Prof. R. D’Andrea Solutions Exam Duration: 150 minutes Number of Problems: 10 Permitted aids: One double-sided A4 sheet. Questions can be answered in English or German. Use only the prepared sheets for your solutions. Additional paper is available from the supervisors. Final Exam – Signals & Systems Problem 1 5 points A linear, time invariant system with input x[n] and output y[n] has the transfer function 10 − 2z −1 Y (z) = H(z) = X(z) a2 + 2az −1 + z −2 a) For what real values of a is the system causal and stable? (3 points) b) Write down a causal difference equation of the above system (2 points) of the following form: ! M N X X 1 y[n] = bk x[n − k] − ak y[n − k] a0 k=0 k=1 Solution 1 a) The poles of the system are at 0 = a2 + 2az −1 + z −2 = (a + z −1 )2 z −1 = −a 1 z=− a For the system to be causal and stable, the poles must lie within the unit circle. It follows that |a| > 1 must hold. b) Y (z) 10 − 2z −1 = X(z) a2 + 2az −1 + z −2 Y (z)(a2 + 2az −1 + z −2 ) = X(z)(10 − 2z −1 ) a2 y[n] + 2ay[n − 1] + y[n − 2] = 10x[n] − 2x[n − 1] 1 y[n] = 2 (10x[n] − 2x[n − 1] − 2ay[n − 1] − y[n − 2]) a Final Exam – Signals & Systems Problem 2 5 points A system is governed by the difference equation π , y[n] = x[n]x[n − 1] + cos 3πn − 3 where x[n] is the input and y[n] is the output. Is the system a) b) c) d) e) linear? time invariant? bounded input bounded output (BIBO) stable? memoryless? causal? Yes Yes Yes Yes Yes No No No No No Please circle either ‘Yes’ or ‘No’. If you change your mind, please cross out both ‘Yes’ and ‘No’ and write either ‘Yes’ or ‘No’ alongside, or leave it blank. It is not necessary to justify choices. You can get a maximum of 5 points and a minimum of 0 points for this problem. For each subproblem you get: +1 for a correct answer, -1 for an incorrect answer and 0 for no answer. Solution 2 a) b) c) d) e) No No Yes No Yes Final Exam – Signals & Systems Problem 3 5 points The output of a system T is y[n] = T{x[n]}. T is a causal, linear, time invariant system. Given the input and output below, calculate the impulse response h[n] of the system T for all n. n <0 0 1 2 3 4 5 >5 x[n] 0 1 −1 −2 0 0 0 0 y[n] 0 3 −2 −2 −5 −12 −4 0 Solution 3 Because the system is given to be causal, h[n] = 0 for all n < 0. One can see from the input output behavior that the system has a finite impulse response (the output goes to zero a finite number of steps after the input goes to zero). The input is zero for n > 2, and the output is zero for n > 5; therefore the impulse response must be zero for n > 3. n = 0: y[0] = h[0]x[0] y[0] h[0] = x[0] =3 n = 1: y[1] = h[0]x[1] + h[1]x[0] y[1] − h[0]x[1] h[1] = x[0] =1 n = 2: y[2] = h[0]x[2] + h[1]x[1] + h[2]x[0] y[2] − h[0]x[2] − h[1]x[1] h[2] = x[0] =5 Final Exam – Signals & Systems n = 3: y[3] = h[0]x[3] + h[1]x[2] + h[2]x[1] + h[3]x[0] y[3] − h[0]x[3] − h[1]x[2] − h[2]x[1] h[3] = x[0] =2 Final Exam – Signals & Systems Problem 4 5 points The transfer function of a filter is b0 Y (z) = . X(z) 1 + a1 z −1 H(z) = Calculate the coefficients b0 and a1 such that the filter is stable and causal, and such that the frequency response H(Ω) of the filter fulfills the two criteria H(Ω = 0) = 1, and π 1 H Ω= =√ . 2 2 Solution 4 The first criterion yields 1= b0 b0 , = −j0 1 + a1 e 1 + a1 1 + a1 = b0 . From the second criterion, we obtain b0 1 √ = 1 − ja1 2 |b0 | =p . 1 + a21 Combining the two criteria, we obtain It follows that |1 + a1 | 1 √ =p . 2 1 + a21 (1 + a1 )2 1 − . 0= 1 + a21 2 = a21 + 4a1 + 1. Final Exam – Signals & Systems Solving the quadratic equation for a1 , we obtain the two solutions √ a1 = −2 ± 3. Since the filter needs to be stable, causal, and has a pole at z = −a1 , the only possible solution is √ a1 = −2 + 3, from which follows b0 = −1 + √ 3. Final Exam – Signals & Systems Problem 5 5 points Associate the following impulse responses ((a) to (e)) and frequency responses ((1) to (5)) with the corresponding difference equation by filling out the following table. It is not necessary to justify choices. Difference equation Impulse Response Frequency Response (a) to (e) (1) to (5) y[n] = 31 (x[n] + x[n − 1] + x[n − 2]) y[n] = 21 (x[n] − x[n − 1]) y[n] = 0.8x[n] + 0.2y[n − 1] y[n] = 31 (x[n + 1] + x[n] + x[n − 1]) 0.5 0 −0.5 −2 2 4 0 Time index n 6 Impulse response h[n] Impulse response h[n] y[n] = 0.2x[n] + 0.8y[n − 1] 0.5 0 −0.5 −2 0.5 0 −0.5 −2 0 2 4 Time index n 6 Impulse response h[n] (c) 0 −0.5 0 2 4 Time index n (e) 0.5 0 −0.5 −2 0 2 4 Time index n (d) 0.5 −2 6 (b) Impulse response h[n] Impulse response h[n] (a) 2 4 0 Time index n 6 6 1 Amplitude Amplitude Final Exam – Signals & Systems 0.5 0 1 2 90 0 −90 0 1 2 Frequency Ω 0.5 0 3 Phase (◦ ) Phase (◦ ) 0 1 0 1 0 1 2 Frequency Ω 3 Amplitude Amplitude 0.5 0 1 2 Frequency Ω 3 Phase (◦ ) Amplitude (3) 0.5 0 0 1 2 0 1 2 Frequency Ω 0.5 0 0 1 2 0 1 2 Frequency Ω 3 90 0 −90 3 3 90 0 −90 (4) 1 (5) 1 3 Phase (◦ ) Phase (◦ ) 2 90 0 −90 0 3 (2) 1 1 3 90 0 −90 (1) 0 2 3 Final Exam – Signals & Systems Solution 5 Difference equation Impulse Response Frequency Response (a) to (e) (1) to (5) y[n] = 31 (x[n] + x[n − 1] + x[n − 2]) d 1 y[n] = 21 (x[n] − x[n − 1]) c 5 y[n] = 0.8x[n] + 0.2y[n − 1] e 4 y[n] = 31 (x[n + 1] + x[n] + x[n − 1]) b 3 a 2 y[n] = 0.2x[n] + 0.8y[n − 1] Final Exam – Signals & Systems Problem 6 5 points For a zero mean signal x[n], Rxx [0] = σx2 , where Rxx is the autocorrelation function and σx2 is the variance of the signal x[n]. The autocorrelation function is defined as Rxx [k] := E (x[n]x[n − k]) , where E(·) is the expected value operator. Let x[n] be white noise with variance σx2 = 2. The signal x[n] is applied to a linear time invariant system T to generate the output y[n] = T {x[n]} . The frequency response H (Ω) of T can be approximated by 1 −jΩ e , 0 ≤ |Ω| ≤ Ωc H (Ω) = 2 . 0, Ωc < |Ω| ≤ π Calculate the frequency Ωc such that the variance of the output signal y[n] is σy2 = 0.4. Solution 6 The power spectral density function of y[n] is 1 2 1 σ = , 0 ≤ |Ω| ≤ Ωc . Syy (Ω) = |H (Ω)|2 Sxx (Ω) = 4 x 2 0, Ωc < |Ω| ≤ π The system T is linear, therefore the zero mean input x[n] results in a zero mean output y[n]. We calculate the variance of y[n] using the inverse Fourier transform Z π 1 σy2 = Ryy [k = 0] = Syy (Ω) ejΩ·0 dΩ 2π −π Z Ωc 1 1 Ωc = dΩ = . π 0 2 2π Solving for Ωc with σy2 = 0.4, we obtain Ωc = 4π . 5 Final Exam – Signals & Systems Problem 7 5 points Consider the continuous time signal π x(t) = 4 cos 6πt + + 2 cos (8πt + π) − 2. 3 a) Determine the largest possible sampling time Ts in seconds (1 point) to sample the signal without aliasing effects. b) Sample the given continuous time signal with the sampling (1 point) time you obtained in a), starting at t = 0: x[0] = x(0), x[1] = x(Ts ), ..., x[n] = x(nTs ). Determine the fundamental period N0 of the discrete time signal x[n]. c) State the Fourier series coefficients ck given by (3 points) j2πk N0 −1 n − 1 X N 0 ck = , x[n]e N0 n=0 k = 0, 1, ..., N0 − 1. Solution 7 a) The largest possible sampling time is Ts = 1/8 s. b) The sampled signal is 3 π x[n] = 4 cos + 2 cos (πn + π) − 2. πn + 4 3 The fundamental period of the signal is N0 = 8. c) The coefficients are k ck 0 1 2 3 π j -2 0 0 2e 3 4 5 π −j -2 2e 3 6 7 . 0 0 For a detailed solution, please refer to the solution of problem 4 of the 2009 final exam or the recitation notes posted on Nov. 5 on the class website. Final Exam – Signals & Systems Problem 8 5 points A continuous time, linear, time invariant system with input x(t) and output y(t) is given by the state space description q̇(t) = Aq(t) + Bx(t) y(t) = Cq(t) + Dx(t), where the state vector has two matrices are 0 A = 0 C = 1 elements q(t) = {q1 (t), q2 (t)}T and the 1 0 B = 0 1 0 D = [0.5] Assume the input x(t) is piece-wise constant x(t) = x[k] kTs ≤ t < (k + 1)Ts with sampling time Ts . Compute Ad , Bd , Cd , Dd of a discrete time state space description of the system q[k + 1] = Ad q[k] + Bd x[k] y[k] = Cd q[k] + Dd x[k], when the output y[k] is defined as y[k] := y(t = kTs ). Solution 8 We solve this problem using the matrix exponential (see lecture notes for derivation). We define: 0 1 0 A B M := = 0 0 1 . 0 0 0 0 0 The discrete time matrices Ad , Bd are then obtained by calculating Ad Bd = e M Ts . 0 1 Final Exam – Signals & Systems Since the matrix M is nilpotent, i.e. M 3 = 0, it is straightforward to calculate the matrix exponential: 1 Ad Bd = I + M Ts + M 2 Ts2 , 0 1 2 where I is the identity matrix. The matrices are therefore 1 2 1 Ts T Bd = 2 s Ad = 0 1 . Ts Cd = C Dd = D Final Exam – Signals & Systems Problem 9 5 points You are given the state space description of a system: 2 2 − 41 q[n] + x[n] q[n + 1] = 25 −3 −1 y[n] = −1 1 q[n] + 4 x[n] a) Is the system bounded input bounded output stable? b) Is the system controllable? c) Calculate the step response of the system for n = 0, 1, 2. d) Consider the second system 1 −1 −4 2 q[n] + x[n] q[n + 1] = −3 25 2 y[n] = 1 −1 q[n] + 3 x[n] (2 points) (1 point) (1 point) (1 point) is the input output behavior of this system identical to the first one? Solution 9 a) The eigenvalues of the matrix A are λ1 = λ2 = − 21 . The system is therefore stable. 2 17 4 . The matrix has full b) The controllability matrix is [B AB] = −1 53 row rank and the system is therefore controllable. c) n = 0: 2 − 14 0 2 q[1] = + 1 25 −3 0 −1 2 = −1 0 + 4 1 y[0] = −1 1 0 =4 Final Exam – Signals & Systems n = 1: 2 2 2 − 14 + 1 q[2] = 25 −3 −1 −1 25 = 4 52 2 y[1] = −1 1 + 4 1 −1 =1 n = 2: y[2] = −1 1 = 199 4 25 4 52 + 4 1 d) No. An easy way to see this isthe first value of the step response: 0 The state of both systems is q[0] = . The output of the first system is 0 therefore y[0] = 4, while the output of the second system is y[0] = 3. Final Exam – Signals & Systems Problem 10 5 points Assume that you are identifying a linear time invariant system T with input x[n] and output y[n]: y[n] = T{x[n]} Input signal x[n] You applied the input x[n] and measured the output y[n] for 101 samples, i.e. 0 ≤ n ≤ 100, as shown below: 1 0.5 0 Output signal y[n] −0.5 −1 0 10 20 30 40 60 70 80 90 100 0 10 20 30 40 60 50 Time Index n 70 80 90 100 50 1 0.5 0 −0.5 −1 You want to use this data to identify a model of the form b0 + b1 z −1 + b2 z −2 + · · · + bM z −M b H(z) = 1 + a1 z −1 + a2 z −2 + · · · + aN z −N in the frequency domain. a) Let Y (Ω) be the Discrete Fourier Transform of the mea- (1 point) sured output y[n]. How many frequency points will the Transform have in the range 0 ≤ Ω ≤ π? Now assume that you have calculated the system transfer function H(Ωk ) = Y (Ωk ) X(Ωk ) at each frequency point Ωk . b) When fitting a model to the system transfer function, what (2 points) are the highest possible model orders N and M that you can identify using only the given measurement data? Final Exam – Signals & Systems c) A colleague has identified a model from the given measure- (2 points) ment data. A plot of the frequency response of his estib mated model H(z) is shown below. Is this result plausible, and why? Amplitude 3 2 1 Phase (◦ ) 0 0 0.5 1 0 0.5 1 1.5 2 2.5 3 2 2.5 3 90 0 −90 1.5 Frequency Ω Solution 10 a) There will be 51 points. The Discrete Fourier Transform will result in 101 frequency domain points in a 2π interval. This means that the spacing between frequency points will be 2π . ∆Ω = 101 There will be one point at Ω = 0. There will be 50 more points in the interval, because 50∆Ω < π and 51∆Ω > π. b) There are 101 pieces of information (the point at Ω = 0 is real, and all points at Ω 6= 0 are complex.). Therefore, N + M + 1 ≤ 101 N + M ≤ 100. c) No. The system has a phase of 90◦ at Ω = 0, which means that the system has a complex gain. This is clearly not the case, as the inputoutput data is real.