2020_final_sol (1)

pdf

School

McMaster University *

*We aren’t endorsed by this school

Course

2CR3

Subject

Electrical Engineering

Date

Jan 9, 2024

Type

pdf

Pages

14

Uploaded by UltraBraveryGoat3

Report
MCMASTER UNIVERSITY Department of Electrical and Computer Engineering December 11, 2020 COMP ENG 4TL4 and ECE 6TL4 (Digital Signal Processing) Instructor: Dr. Ratnasingham Tharmarasa FINAL EXAM Duration: 2.5 hours This is an open book exam. This examination paper consists of 14 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 10:30 pm on Dec 11, 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 14
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. Consider a system with the following impulse response: h 1 [ n ] = k n u [ n - 2] + (2 + # D 2) δ [ n + 4] (1) (a) [6] Find the z-transform H 1 ( z ) of h 1 [ n ]. Show your work . Answer: # D 2 = 3 h 1 [ n ] = k 2 k n - 2 u [ n - 2] + 5 δ [ n + 4] (2) H 1 ( z ) = k 2 z - 2 1 - kz - 1 + 5 z 4 (3) ROC: | k | < | z | excluding . (b) [5] Find the condition for the existence of Discrete-Time Fourier transform (DTFT), and find the DTFT when the condition is satisfied. Show your work . Answer: ROC should include the unit circle to have DTFT. Hence, | k | < 1. H 1 ( ω ) = k 2 e - j 2 ω 1 - ke - + 5 e j 4 ω (4) (c) [4] Determine whether the system is stable and causal. Show your work . Answer: System is not causal since infinity is not included in the ROC. System is stable if | k | < 1. (d) [5] As shown in the Figure 1, when the above system is connected in parallel with another system with impulse response h 2 [ n ], the impulse response of the total system is k n u [ n - 2] + (3 + # D 3) δ [ n - 5]. Find the impulse response h 2 [ n ] shown in the figure below. h 1 [ n ] h 2 [ n ] δ [ n ] k n u [ n - 2] + (3 + # D 3) δ [ n - 5] Figure 1 . A new system
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 Answer: # D 3 = 4 h 2 [ n ] = 7 δ [ n - 5] - 5 δ [ n + 4] (5)
page 5 2. (a) [7] Consider the sequence x [ n ] = δ [ n ] + (# D 4 + 3) δ [ n - 3] (6) i. Find 6-point Discrete Fourier Transform (DFT) X [ k ] of x [ n ]. Show your work . Answer: # D 4 = 5 X [ k ] = 5 summationdisplay n =0 ( δ [ n ] + 8 δ [ n - 3]) e - j 2 πkn 6 (7) = 1 + 8 e - j 2 πk 3 6 (8) = 1 + 8 e - jπk (9) Hence, X [ k ] = { 1 + 8 , 1 - 8 , 1 + 8 , 1 - 8 , 1 + 8 , 1 - 8 } = { 9 , - 7 , 9 , - 7 , 9 , - 7 } ii. Find a sequence y [ n ] that has the following 6-point DFT: Y [ k ] = e j 2 π k (7+# D 3) 6 X [ k ] (10) where X [ k ] is the DFT obtained in part i. Show your work . Answer: # D 3 = 4 Using the property x [( n - m ) mod N ] X [ k ] e - j 2 π km N , y [ n ] = x [( n + (7 + 4)) mod 6] (11) = x [( n + 11) mod 6] (12) (b) [8] Consider the sequences x [ n ] = [2 , 3+# D 1 , - (2+# D 3) , 0] and h [ n ] = [2 , 0 , - 1 , 0]. i. Find the four-point circular convolution of sequences x [ n ] and h [ n ]. Show your work . Answer: # D 1 = 2 , # D 3 = 4 x [ n ] = [2 , 5 , - 6 , 0] x [ n ] * h [ n ] = [2 × 2 + - 6 × - 1 , 5 × 2 + 0 × - 1 , - 6 × 2 + 2 × - 1 , (13) 0 × 2 + 5 × - 1] = [10 , 10 , - 14 , - 5] (14) (15)
page 6 ii. Find the linear convolution of sequences x [ n ] and h [ n ]. Show your work . Answer: x [ n ] * h [ n ] = [2 × 2 , 5 × 2 , - 6 × 2 + 2 × - 1 , (16) 0 × 2 + 5 × - 1 , 0 × 2 + - 6 × - 1 , 0 × 0 + 0 * × - 1] = [4 , 10 , - 14 , - 5 , 6 , 0] (17) iii. Show that the circular convolution values that you have obtained are correct using the result of linear convolution. Show your work . Answer: Circular convolution is an alias version of linear convolution. First term in the circular convolution is (6+4) and the second term is (10 +0), so the answer is correct. (c) [5] i. Explain the similarities and differences between DFT and Fast Fourier Trans- form (FFT). Answer: FFT is a faster way of implementing the DFT. So, outputs of both mean the same, i.e., same values. Direct implementation of DFT takes O ( N 2 ) while FFT takes only O ( n log 2 ( N )). In order to calculate the FFT, we may need to zeros to make n = 2 r . ii. If a straight forward DFT implementation of a sequence with 2 16+# D 5 samples takes (2+# D 2) seconds to calculate the DFT, what would be the expected computation time of FFT implementation for the same sequence? Show your work . Answer: # D 5 = 3 , # D 2 = 4 N = 2 19 samples take 6 seconds. T DF T = 6 = c 1 N 2 (18) T F F T = c 2 N log 2 ( N ) (19) If we assume c 1 = c 2 , T F F T T DF T = log 2 N N (20) T F F T = T DF T log 2 N N (21) = 6 19 2 19 (22)
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) [5] A discrete-time signal x [ n ] = (2 + # D 2) cos(0 . 1 πn + π/ 2) + (3 + # D 4) cos(0 . 3 πn ) (23) is passed through a distortionless system and obtained y [ n ] = (0 . 1 × (2 + # D 2)) cos(0 . 1 πn + π/ 4) + a 2 cos(0 . 3 πn + φ 2 ) (24) Find a possible value for a 2 and φ 2 . Show your work . Answer: # D 2 = 3 , # D 4 = 5 Conditions for distortionless systems: i. Amplify each frequency component uniformly ii. Linear phase shift Hence, a 2 = 0 . 1 * 8 (25) φ 2 = 3 * ( π/ 4 - π/ 2) = - 3 π/ 4 (26) (b) [10] Transfer function of a causal LTI system is given by H ( z ) = (1 + (2 + # D 2) z - 1 )(1 - (3 + # D 1) z - 1 ) (1 + 0 . 9 z - 1 )(1 - 0 . 2 z - 1 ) (27) i. What is the Region Of Convergence (ROC) of this system? Is this system stable? Justify your answer. Answer: # D 1 = 2 , # D 2 = 6 Poles are at 0.9 and 0.2. Since the system is causal, ROC is | z | > 0 . 9. Unit circle is included in the ROC, so the system is stable. ii. H ( z ) can be represented as a cascade of a minimum phase system H min ( z ) and a unity-gain all-pass system H ap ( z ). H ( z ) = H min ( z ) H ap ( z ) (28) Find a choice for H min ( z ) and H ap ( z ). Show your work . Answer: H ( z ) = (1 + 8 z - 1 )(1 - 5 z - 1 ) (1 + 0 . 9 z - 1 )(1 - 0 . 2 z - 1 ) (29) = (1 + 1 / 8 z - 1 )(1 - 1 / 5 z - 1 ) (1 + 0 . 9 z - 1 )(1 - 0 . 2 z - 1 ) 1 + 8 z - 1 1 + 1 / 8 z - 1 1 - 5 z - 1 1 - 1 / 5 z - 1 (30) = 8 × 5 (1 + 1 / 8 z - 1 )(1 - 1 / 5 z - 1 ) (1 + 0 . 9 z - 1 )(1 - 0 . 2 z - 1 ) 1 / 8 + z - 1 1 + 1 / 8 z - 1 1 / 5 - z - 1 1 - 5 z - 1 (31) = 40 parenleftbigg (1 + 1 / 8 z - 1 )(1 - 1 / 5 z - 1 ) (1 + 0 . 9 z - 1 )(1 - 0 . 2 z - 1 ) parenrightbigg parenleftbigg z - 1 + 1 / 8 1 + 1 / 8 z - 1 1 / 5 - z - 1 1 - 5 z - 1 parenrightbigg (32)
page 8 Hence, H min ( z ) = 40 parenleftbigg (1 + 1 / 8 z - 1 )(1 - 1 / 5 z - 1 ) (1 + 0 . 9 z - 1 )(1 - 0 . 2 z - 1 ) parenrightbigg (33) H ap ( z ) = parenleftbigg z - 1 + 1 / 8 1 + 1 / 8 z - 1 1 / 5 - z - 1 1 - 5 z - 1 parenrightbigg (34) or H min ( z ) = - 40 parenleftbigg (1 + 1 / 8 z - 1 )(1 - 1 / 5 z - 1 ) (1 + 0 . 9 z - 1 )(1 - 0 . 2 z - 1 ) parenrightbigg (35) H ap ( z ) = parenleftbigg z - 1 + 1 / 8 1 + 1 / 8 z - 1 z - 1 - 1 / 5 1 - 5 z - 1 parenrightbigg (36)
page 9 4. (a) [5] You are asked to design a LTI filter that satisfies the given frequency response requirements. As a first step, you have to decide whether to use an Finite Impulse Response (FIR) filter or an Infinite Impulse Response (IIR) filter. i. How would you make this decision? You have to analyze all the advantages and disadvantages of each filter type. Answer: FIR filter: Stable Linear phase Great possibility in shaping their magnitude response Convenient to implement IIR Filter May be unstable Causal IIR are nonlinear phase An IIR filters of order max( M, N ) can have a sharper frequency response than an FIR filter of order M ii. If you are asked to reduce the memory requirement, which type of filter (FIR or IIR) would you use? Note: You need to satisfy all the given frequency response requirements. Justify your answer. Answer: If linear phase is not a requirement, IIR filter is a good choice, since we can get the required specification with less order. FIR is the only choice if we want linear phase. (b) [5] A lowpass filter is designed using a rectangular window. i. Is it feasible to have the passband response as shown in Figure 2 with a rectangular window? Justify your answer. Answer: No, we do not observe the Gibbs phenomenon. ii. Is it feasible to have the stopband response as shown in Figure 2 with a rectangular window? Justify your answer. Answer: No, stopband attenuation should diminish over frequency. (c) [10] Design a digital lowpass IIR filter that has a 3-dB cutoff frequency ω = 0 . 4 π using a first-order Butterworth filter. Use bilinear transformation for transforming the analog filter to the digital filter. i. Write the transfer function H ( z ) of the filter designed. Show your work . Answer: A lowpass Butterworth filer: | H (Ω) | 2 = 1 1 + (Ω / Ω 0 ) 2 N (37) When the filter is first-order, | H (Ω) | 2 = 1 1 + (Ω / Ω 0 ) 2 (38)
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 0 0.2 0.4 0.6 0.8 1 Normalized Frequency ( rad/sample) -100 -80 -60 -40 -20 0 20 Magnitude (dB) Figure 2 . Frequency response of a lowpass filter Analog prewarped frequency: Ω 0 = 2 T tan( ω 0 / 2) (39) We can pick T = 1: Ω 0 = 2 tan(0 . 4 π/ 2) (40) = 2 tan(0 . 2 π ) (41) For first order filter, H ( s ) = 1 1 + s/ (2 tan(0 . 2 π )) (42) Transforming to digital one as H ( z ) = H c ( s ) | s = 2 T parenleftBig 1 - z - 1 1+ z - 1 parenrightBig (43) = 1 1 + 2 ( 1 - z - 1 1+ z - 1 ) / (2 tan(0 . 2 π )) (44) ii. What is the magnitude response of this filter at ω = 0 . 6 π ? Show your work . Answer: Analog prewarped frequency, with the same T = 1: Ω s = 2 T tan(0 . 6 π/ 2) (45) = 2 tan(0 . 3 π ) (46) Hence, the frequency response at ω = 0 . 6 π : | H s ) | 2 = 1 1 + (2 tan(0 . 3 π ) / 2 tan(0 . 2 π )) 2 (47) = 1 1 + (tan(0 . 3 π ) / tan(0 . 2 π )) 2 (48)
page 11 (d) [5] Draw the direct form I and II block diagrams of a LTI system represented by the following difference equation. y [ n ] = (2 + # D 2) y [ n - 2] - 3 x [ n - 1] + (3 + # D 3) x [ n - 3] (49) Answer:
page 12 5. (a) [10] Consider the input sequence shown in Figure 3. -1 -0.5 0 0.5 1 x[n] 0 20 40 60 80 100 n Figure 3 . Input sequence -1 -0.5 0 0.5 1 x[n] and w[n] 0 20 40 60 80 100 n x[n] w[n] Figure 4 . Window at n = 0 i. Draw the magnitude plots that you would get if you calculate the short-time Fourier transform (STFT) at n = 0 , 20 and 60 with a rectangular window with size 20. A plot showing the window at n = 0 is shown in Fig. 4. Note: You need to draw three magnitude plots instead of a spectrogram. No need to calculate the exact magnitude or frequency values. But, you need to show the relative differences in the magnitude and the frequency across the figures clearly. Answer: DTFT at n = 0 is zero everywhere. DTFT at n = 20 is a sinc function. DTFT at n = 60 is a similar to the one at n = 20, but the magnitude is multiplied by 0.5.
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 13 ii. Repeat the above step with window size 40. Answer: DTFT at n = 0 is sinc similar to the one at n = 20 of (i). DTFT at n = 20 same as at 0. DTFT at n = 60 similar to at n = 20, but the magnitude is multiplied by 0.5. (b) [5] Power spectral density (PSD) estimate of a white noise sequence using pe- riodogram with a rectangular window of length L = 500 is shown in Figure 5. 0 1 2 3 0 0.5 1 1.5 2 2.5 Periodogram Figure 5 . Periodogram of a white noise sequence with a rectangular window of length L=500 i. What will happen to the periodogram if we increase the window length L to 10000? Answer: No improvement in the estimate. The variance will stay the same. ii. If the variance of the estimate shown in Figure 5 is 0.1, what can we do to reduce the variance of an estimate to 0.01? Answer: Split 10000 samples into 10 non-overlapping windows and use Bartlett method to get 0.01 variance. iii. What is the expected variance of an estimator that averages two periodogram values obtained with 99% overlap (i.e., total number of samples = 505, win- dow length = 500; 2 segments; 495 samples are overlapped) compared to the variance of the Periodogram shown in Figure 5? Answer: The variance will be close to 0.1 since the samples used in both periodogram calculations are highly correlated. (c) [5] A speech signal is divided into multiple frames, and each frame is compressed using Linear Prediction Coding (LPC). When the signal is sampled at 8000 sam- ples/sec, there are 160 samples in 20 ms. In LPC compression, these 160 samples are represented by 10 filter parameters and 5 excitation source parameters. We
page 14 get 160/15 compression ratio with this compression. For an application, this com- pression ratio is not enough. Hence, you are suggested to increase the duration of a frame by a factor of 10, i.e., represent 1600 samples in 200 ms duration with 10 filter parameters and 5 excitation source parameters. What is your opinion about this suggestion? Answer: A speech signal generation is not come from a time invariant system. However, for a shorter duration like 20 ms, we can assume the system is time invariant. However, it may not be time invariant for 200 ms, hence we can’t increase the frame duration to 200 ms. End of examination Total pages: 14 Total marks: 100