2020_M_sol (2)

pdf

School

McMaster University *

*We aren’t endorsed by this school

Course

2CR3

Subject

Electrical Engineering

Date

Jan 9, 2024

Type

pdf

Pages

12

Uploaded by UltraBraveryGoat3

Report
MCMASTER UNIVERSITY Department of Electrical and Computer Engineering October 29, 2020 COMP ENG 4TL4 and ECE 6TL4 (Digital Signal Processing) Instructor: Dr. Ratnasingham Tharmarasa MIDTERM TEST Duration: 2 hours This is an opened book exam. This examination paper consists of 12 pages and 5 questions. The number in brackets at the start of each question is the number of points the question is worth. Answer all questions. Answer each question on a separate letter-size paper. All answers must be hand-written. Use the following naming convention for your files: StudentNumber QuestionNumber (e.g., 400654321 Q2). If you have answered on more than one page for a question, then the name of the second page should be StudentNumber QuestionNumber PageNumber (e.g., 400654321 Q2 p2). Write your name and student number on each page. Upload a scanned copy or clear photos of answer sheets to avenue by 8:30 pm on Oct 29, 2020. Academic integrity statement: By submitting this work, I certify that the work represents solely my own independent efforts. I confirm that I am expected to exhibit honesty and use ethical behaviour in all aspects of the learning process. I confirm that it is my responsibility to understand what constitutes academic dishonesty under the Academic Integrity Policy. Page 1 of 12
page 2 Numbers from Student Number Fill in the following table to use the values from this table whenever you see a number start with “#” in any of the questions. Example: If the student number is 400123456, D 1 = 6, D 2 = 5, D 3 = 4, D 4 = 3, D 5 = 2, D 6 = 1. Digits D9 D8 D7 D6 D5 D4 D3 D2 D1 Your student number
page 3 1. (a) [5] The sequence x [ n ] = cos(( π/ 8) n ) was obtained by sampling the continuous- time signal x c ( t ) = cos(2 πf 0 t ) at a sampling rate of 2000 samples/s. What are the possible values of f 0 that should have resulted in the sequence x [ n ] if we know that 2000 f 0 4000? Show your work . Answer: 2 πf 0 n/ 2000 = (2 πk + π/ 8) n, k = . . . , - 1 , 0 , 1 , 2 , . . . (1) f 0 = 2000( k + 1 / 8) k = . . . , - 1 , 0 , 1 , 2 , . . . (2) Also, 2 πf 0 n/ 2000 = (2 πk - π/ 8) n, k = . . . , - 1 , 0 , 1 , 2 , . . . (3) f 0 = 2000( k - 1 / 8) k = . . . , - 1 , 0 , 1 , 2 , . . . (4) Possible values between 2000 and 4000 are 2125 and 3875. (b) [15] In Lab #1 you wrote a MATLAB function to implement a 3-bit uniform rounding quantizer. Figure 1 shows the histogram of the signal that was quan- tized. The quantization levels used by three students are given in Table 1. Stu- dents 2 and 3 used the same quantization levels. For example, the value 0.1 will be quantized as 0 by students 2 and 3 and as 0.125 by student 1. Error histograms reported by student 1, 2 and 3 are reported in Figures 2, 3 and 4, respectively. i. Is it possible to have the error histogram reported in Figure 2 for the quan- tization levels used by student 1? Give your justification. Answer: Yes, this histogram is possible. Most of the values are close to zero, and they will be rounded to either 0.125 or -0.125. So, we will have more values with errors 0.125 or -0.125. ii. Students 2 and 3 used the same quantization levels, hence only one of the histograms reported by students 2 and 3 is correct. Which one of the error histograms is correct, and why? Answer: Student 2 is correct. If the input signal is uniformly distributed, the the error histogram of student 3 is correct. When most of the values are close to zero, they will be rounded to zero, and the error is zero for those signals. This is case with the given input, so the error histogram should be the one reported by student 2. Note: There is a typo in the range of x-axis of Figure 3. If someone says “the range of errors is wrong”, then that answer is also correct. In that case, both figures are wrong.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
page 4 Figure 1 . Signal histogram Student Levels Student 1 -0.875 -0.625 -0.375 -0.125 0.125 0.375 0.625 0.875 Student 2 -1.000 -0.750 -0.500 -0.250 0 0.250 0.500 0.750 Student 3 -1.000 -0.750 -0.500 -0.250 0 0.250 0.500 0.750 Table 1 . Quantized levels 2. (a) [6] Find the output at n = 10 + # D 2 + # D 3 for input x 1 [ n ] = a n u [ n ] to a Linear Time-Invariant (LTI) system with impulse response h 1 [ n ] = 10 δ [ n ] + 5 δ [ n - 2] + 2 δ [ n - # D 1]. Show your work . h 1 [ n ] x 1 [ n ] y 1 [ n = 10 + # D 2 + # D 3]=? Answer: #D1 = 1, #D2 = 1, #D3 = 2, hence n = 13 y [ n ] = x [ n ] * h [ n ] (5) = summationdisplay k = -∞ x [ k ] h [ n - k ] (6) = 10 x [ n ] + 5 x [ n - 2] + 2 x [ n - 1] (7) y [13] = 10 a 13 + 5 a 11 + 2 a 12 (8) (b) [4] Find an input x 2 [ n ] that produces the same output as the one you obtained in part (a) for a different LTI system with impulse response h 2 [ n ] = 2 a n u [ n ]. Show your work .
page 5 Figure 2 . Error histogram of student 1 Figure 3 . Error histogram of student 2 Figure 4 . Error histogram of student 3
page 6 h 2 [ n ] x 2 [ n ] =? y 2 [ n = 10 + # D 2 + # D 3] = y 1 [ n ] Answer: h 2 [ n ] = 2 x 1 [ n ] (9) We will get the same output even if switch x [ n ] and h [ n ], hence x 2 [ n ] = 0 . 5 h 1 [ n ] (10) = 0 . 5(10 δ [ n ] + 5 δ [ n - 2] + 2 δ [ n - 1]) (11) (c) [10] Consider the following difference equation: y [ n ] - y [ n - 1] = x [ n ] + x [ n + 1] (12) i. Find y [ - 2] for input x [ n ] = 2 u [ n ] with y [0] = 1. Show your work . ii. Is this system causal and stable? Show your work . Answer: y [0] - y [ - 1] = x [0] + x [1] (13) 1 - y [ - 1] = 4 (14) y [ - 1] = - 3 (15) y [ - 1] - y [ - 2] = x [ - 1] + x [0] (16) - 3 - y [ - 2] = 2 (17) y [ - 2] = - 5 (18) The system is not causal. It is seen from the difference equation that the current value of the output y [ n ] depends (explicitly) on future value of input x [ n + 1] Consider the value of y [ n ] for large n when the input is u [ n ] y [1] = y [0] + x [0] + x [1] = 1 + 1 + 1 = 3 (19) y [ n ] = y [ n - 1] + x [ n ] + x [ n + 1] where all the terms in the sum are positive (20) The output becomes unbounded for bounded input. Hence the system is not stable.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
page 7 3. (a) [10] Given signal x [ n ] = e j π 8 n + 2 e - j π 8 n + 2 e j π 4 n + e - j π 4 n and the system transfer function (DTFT of the impulse response) H ( ω ) = braceleftbigg (2 + # D 4) e j 2 ω , | ω |≤ π/ 6 0 , π/ 6 < | ω | < π , (21) find the response y [ n ]. Show your work . Answer: #D4 = 5 The cut-off frequency of the low pass filter is π/ 6. Hence, the last two terms of the x [ n ] will be filtered out. y [ n ] of input e jωn is H ( ω ) e jωn . y [ n ] = 7 e j 2( π/ 8) e j π 8 n + 14 e - j 2( π/ 8) e - j π 8 n (22) (b) [5] Find the DTFT at ω = 0 (i.e., X (0)) of the signal x [ n ] = parenleftBig sin( ω 1 n ) πn parenrightBigparenleftBig sin( ω 2 n ) πn parenrightBig (23) with ω 1 < ω 2 . Show your work . Note that sin( ω c n ) πn DT F T ←--→ braceleftbigg 1 , | ω | < ω c 0 , ω c < | ω | < π (24) Answer: Consider the signal x [ n ] = x 1 [ n ] x 2 [ n ] with DTFT X 1 ( ω ) , X 2 ( ω ) respectively, where x 1 [ n ] = sin( ω c 1 n ) πn x 2 [ n ] sin( ω c 2 n ) πn (25) Using the convolution property of DTFT x [ n ] ←→ 1 2 π integraldisplay π - π X 1 ( τ ) X 2 ( ω - τ ) (26) Setting ω = 0 and noting that X 1 ( ω ) and X 2 ( ω ) are even symmetric, X (0) = 1 2 π integraldisplay π - π X 1 ( τ ) X 2 ( - τ ) (27) = 1 2 π integraldisplay π - π X 1 ( τ ) X 2 ( τ ) (28) = 1 2 π integraldisplay ω c 1 - ω c 1 1 = ω c 1 π (29)
page 8 (c) [5] DTFT of a continuous time signal sampled at the sampling rate f s , which is higher than the Nyquist rate, is X ( ω ) = braceleftbigg 1 + # D 1 , | ω | < 3 π/ 4 0 , 3 π/ 4 < | ω | < π (30) Sketch the DTFT obtained when the signal is sampled at half of the original rate (i.e., f s / 2). Show your work . Answer: #D1 = 1 When the sample rate is halved, we will get (before considering the aliasing) X ( ω ) = braceleftbigg 2 / 2 , | ω | < 2 × 3 π/ 4 0 , | ω | > 2 × 3 π/ 4 (31) However, with the aliasing we will have X ( ω ) = braceleftbigg 1 , | ω | < π/ 2 2 , π/ 2 < | ω | < π (32)
page 9 4. (a) [10] Find the z-transform X ( z ) of x [ n ] = 2 δ [ n ]+4 δ [ n +1+# D 3]+2 n u [ n - 2 - # D 4]. Show your work . Answer: #D3 = 2, #D = 4 x [ n ] = 2 δ [ n ] + 4 δ [ n + 3] + 2 n u [ n - 6] (33) = 2 δ [ n ] + 4 δ [ n + 3] + 2 6 2 n - 6 u [ n - 6] (34) X [ z ] = 2 + 4 z 3 + 64 z - 6 1 - 2 z - 1 (35) (b) [5] Write a signal y [ n ] that can have z-transform ROC r > 0 . 5 excluding infinity, y [8 + # D 2] = 0. Show your work . Answer: #D2 = 1 Since infinity is excluded, we must at least one non-zero value on the left side. Several answers are possible. x [ n ] = δ [ n + 1] + 0 . 5 n u [ n ] - 0 . 5 9 δ [ n - 9] (36) or x [ n ] = δ [ n + 1] + 0 . 5 n - 10 u [ n - 10] (37) (c) [5] Find the impulse response h [ n ] of a system that produces y [ n ] = 2 δ [ n - 1] + 3 δ [ n + 5 + # D 1] for x [ n ] = δ [ n ] + δ [ n - 1] using z-transform. Show your work . Answer: #D1 = 1 Y ( z ) = 2 z - 1 + 3 z 6 (38) X ( z ) = 1 + z - 1 (39) H ( z ) = Y ( z ) X ( z ) (40) = 2 z - 1 + 3 z 6 1 + z - 1 (41) = 2 z - 1 1 + z - 1 + 3 z 6 1 + z - 1 (42) (43)
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
page 10 h [ n ] = 2( - 1) ( n - 1) u [ n - 1] + 3( - 1) ( n +6) u [ n + 6] (44) (d) [5] Find the output at n = 1 (i.e., y [1]) of a system with transfer function H ( z ) = 1 + 2 z - 2 (45) for input x [ n ] = ( - 1) n . Show your work . Hint: you may need to find the difference equation first. Answer: H ( z ) = Y ( z ) X ( z ) = 1 + 2 z - 2 (46) Y ( z ) = (1 + 2 z - 2 ) X ( z ) (47) y [ n ] = x [ n ] + 2 x [ n - 2] (48) y [1] = x [1] + 2 x [ - 1] (49) = ( - 1) 1 + 2( - 1) - 1 (50) = - 3 (51)
page 11 5. (a) [10] Consider the finite length sequence x [ n ] = (2 + # D 4) cos parenleftBig π 4 n parenrightBig 0 n 7 (52) i. Find the 8-point Discrete Fourier Transform (DFT) of x [ n ]. Show your work . Answer: #D4 = 3 x [ n ] = 5 2 ( e j 2 π 8 n + e - j 2 π 8 n ) 0 n 7 (53) = 1 8 (20 e j 2 π 8 n + 20 e - j 2 π 8 n ) 0 n 7 (54) = 1 8 (20 e j 2 π 8 n + 20 e j 2 π 8 7 n ) 0 n 7 (55) (56) So, by matching coefficent: Xk = { 0 , 20 , 0 , 0 , 0 , 0 , 0 , 20 } . ii. Find the value at k = 2 (i.e., X [2]) of 16-point DFT with zero-padding. Show your work . Answer: When we double the points by padding zeros, we double the points on the frequency domain. When the k is even, its value will be same as ¯ X ( k/ 2), hence X [2] = 20. (b) [5] Find the DTFT value at ω = π/ 4 of a finite length sequence that produces 4-point DFT X [ k ] = 2 δ [ k ] + 2 δ [ k - 3]. You do not need to simplify the answer. Show your work . Answer: x [ n ] = 1 4 3 summationdisplay k =0 X [ k ] e j 2 π 4 kn (57) = 1 4 (2 + 2 e j 2 π 4 3 n ) (58) = 1 2 (1 + 1 e j 2 π 4 3 n ) (59) X ( ω ) is X ( ω ) = 3 summationdisplay n =0 x [ n ] e - jωn (60)
page 12 Hence, X ( π/ 4) = 3 summationdisplay n =0 x [ n ] e - j π 4 n (61) = (1 / 2) 3 summationdisplay n =0 1 e - j π 4 n + (1 / 2) 3 summationdisplay n =0 e j 2 π 4 3 n e - j π 4 n (62) End of examination Total pages: 12 Total marks: 100
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help