ece 413 – digital signal processing midterm exam, spring 2017ece413/exams/exams17.pdf ·...

12
University of Waterloo Department of Electrical and Computer Engineering ECE 413 – Digital Signal Processing Midterm Exam, Spring 2017 June 14, 8:30 – 9:50 PM Instructor: Dr. Oleg Michailovich Surname Legal Given Name(s) UW Student ID Number Instructions: This exam has 2 pages. No books and lecture notes are allowed on the exam. Please, turn oyour cell phones, PDAs, etc., and place your bags, backpacks, books, and notes under the table or at the front of the room. Please, place your WATCARD on the table, and fill out the exam attendance sheet when provided by the proctor after the exam starts. Question marks are listed by the question. Please, do not separate the pages, and indicate your Student ID at the top of every page. Be neat. Poor presentation will be penalized. No questions will be answered during the exam. If there is an ambiguity, state your assumptions and proceed. No student can leave the exam room in the first 45 minutes or the last 15 minutes. If you finish before the end of the exam and wish to leave, remain seated and raise your hand. A proctor will pick up the exam from you, at which point you may leave. When the proctors announce the end of the exam, put down your pens/pencils, close your exam booklet, and remain seated in silence. The proctors will collect the exams, count them, and then announce you may leave. 1

Upload: others

Post on 06-May-2020

23 views

Category:

Documents


8 download

TRANSCRIPT

Page 1: ECE 413 – Digital Signal Processing Midterm Exam, Spring 2017ece413/Exams/exams17.pdf · 2017-08-17 · ECE 413 – Digital Signal Processing Midterm Exam, Spring 2017 June 14,

University of WaterlooDepartment of Electrical and Computer Engineering

ECE 413 – Digital Signal Processing

Midterm Exam, Spring 2017

June 14, 8:30 – 9:50 PM

Instructor: Dr. Oleg Michailovich

Surname

Legal Given Name(s)

UW Student ID Number

Instructions:

• This exam has 2 pages.

• No books and lecture notes are allowed on the exam. Please, turn o↵ your cell phones,PDAs, etc., and place your bags, backpacks, books, and notes under the table or at the frontof the room.

• Please, place your WATCARD on the table, and fill out the exam attendance sheet whenprovided by the proctor after the exam starts.

• Question marks are listed by the question.

• Please, do not separate the pages, and indicate your Student ID at the top of every page.

• Be neat. Poor presentation will be penalized.

• No questions will be answered during the exam. If there is an ambiguity, state yourassumptions and proceed.

• No student can leave the exam room in the first 45 minutes or the last 15 minutes.

• If you finish before the end of the exam and wish to leave, remain seated and raise your hand.A proctor will pick up the exam from you, at which point you may leave.

• When the proctors announce the end of the exam, put down your pens/pencils, close yourexam booklet, and remain seated in silence. The proctors will collect the exams, count them,and then announce you may leave.

1

Page 2: ECE 413 – Digital Signal Processing Midterm Exam, Spring 2017ece413/Exams/exams17.pdf · 2017-08-17 · ECE 413 – Digital Signal Processing Midterm Exam, Spring 2017 June 14,

Question 1 (25%)

A signal generator produces a sinusoidal tone xc(t) = cos(2⇡F0t) with fundamental frequency F0

between 1 Hz and 1000 kHz. The signal is sampled with a sampling rate Fs = 1/T = 6000 Hz andreconstructed using an ideal interpolator with a cut-o↵ (folding) frequency ⇡/T = 6000⇡ rads/secs.Determine the reconstructed signal for F0 = 2.8 kHz, 7 kHz, and 20 kHz.

Question 2 (30%)

Let H denote a system representing a continuous-time, ideal low-pass filter with a cut-o↵ frequency⌦c = ⇡/T , for a given T > 0. Suppose that, for some predefined ⌦0 > 0, the real-valued signal xc(t)is transformed into another continuous-time signal x̃c(t) according to

x̃c(t) = H{xc(t) cos(⌦0t)}+ |H{xc(t) sin(⌦0t)},which is subsequently sampled with Fs = 1/T to yield x̃[n] = x̃c(nT ), n 2 Z.

a) Is it possible to recover xc(t) from {x̃[n]}n2Z? If yes, then explain how.

b) Assuming xc(t) is band-limited with Xc(|⌦) = 0 for ⌦ /2 (�⌦H ,�⌦L) [ (⌦L,⌦H), defineconditions on ⌦L and ⌦H (in terms of ⌦0 and T ) such that the above reconstruction can beguaranteed to be free of any aliasing artifacts.

Question 3 (25%)

By selecting di↵erent ROCs, calculate four possible impulse responses of the transfer function

H(z) =1� z�1

(1� 0.5z�1)(1� 0.75z�1)(1� 1.25z�1).

Determine the impulse response of the system that is stable. Is it causal? Why or why not?

Question 4 (20%)

You are hired by a signal processing firm and you are hoping to impress them with the skills thatyou have acquired in this course. The firm asks you to design a discrete-time LTI system that hasthe property that if the input is given by

x[n] = (1/3)nu[n]� (1/4)nu[n],

the output is given byy[n] = (1/4)nu[n].

Determine the impulse response and the di↵erence-equation representation of the LTI system.

2

Page 3: ECE 413 – Digital Signal Processing Midterm Exam, Spring 2017ece413/Exams/exams17.pdf · 2017-08-17 · ECE 413 – Digital Signal Processing Midterm Exam, Spring 2017 June 14,

Solutions for ECE 413 midterm exam

Spring, 2017

Question 1:

We have the following three cases.(a) F0 = 2.8 kHz. In this case, F0 < Fs/2 = 3 kHz and hence xc(t) will be recovered exactly.(b) F0 = 7 kHz. In this case, F0 > Fs/2 and hence there will be aliasing. In particular, within the

passband of the reconstruction filter, we will have too “fake” deltas at frequencies (�6+7) = 1kHz and (6 � 7) = �1 kHz. As a result, yr(t) = cos(2⇡1000t). Note that the other spectralreplicas “miss” the passband.

(c) F0 = 20 kHz. In this case, F0 > Fs/2 and therefore there will be aliasing as well. In particular,within the passband of the reconstruction filter, we will have too “fake” deltas at frequencies(�3 · 6+ 20) = 2 kHz and (3 · 6� 20) = �2 kHz. As a result, yr(t) = cos(2⇡2000t). Note thatthe other spectral replicas “miss” the passband.

Question 2:

First note that, by linearity, we have

x̃c(t) = H{xc(t) cos(⌦0t)}+ |H{xc(t) sin(⌦0t)} = H{xc(t)e|⌦0t)},

which suggests that

X̃c(|⌦) =

(X(j(⌦� ⌦0)), |⌦| < ⇡/T,

0, otherwise.

Since H band-limits x̃c(t) to (�⇡/T, ⇡/T ), x̃c(t) can be sampled with Fs = 1/T without aliasing,and, therefore, it can be reconstructed from x̃[n] exactly. Thus, the question of whether is it possibleto recover xc(t) from x̃[n] boils down to determining conditions on which xc(t) can be recoveredfrom x̃c(t). The latter is possible when X̃c(|(⌦ + ⌦0)) = Xc(|⌦), for all ⌦ 0. In this case, givenx̃c(t), the values of the CTFT of x̃c(t)e�|⌦0t define Xc(|⌦), for ⌦ 0, and therefore for all ⌦, sinceXc(|⌦) = X⇤

c (�|⌦) (due to the real-valuedness of xc(t)).From the above considerations it is clear that ⌦L and ⌦H have to be equal to ⌦0 � ⇡/T and

⌦0 + ⇡/T , respectively.

1

Page 4: ECE 413 – Digital Signal Processing Midterm Exam, Spring 2017ece413/Exams/exams17.pdf · 2017-08-17 · ECE 413 – Digital Signal Processing Midterm Exam, Spring 2017 June 14,

Question 3:

By using the method of partial fraction expansion, we get

H(z) =A

1� 0.5z�1+

B

1� 0.75z�1+

C

1� 1.25z�1

A =�(1� 0.5z�1)H(z)

�|z=0.5 = �4

3

B =�(1� 0.75z�1)H(z)

�|z=0.75 =3

2

C =�(1� 1.25z�1)H(z)

�|z=1.25 =5

6

H(z) =�4/3

1� 0.5z�1+

3/2

1 + 0.75z�1+

5/6

1� 1.25z�1

Now, we have the following four scenarios:(a) ROC = {z | |z| < 0.5}. The ROC does not include the UC, and therefore the system is not

BIBO stable. In this case,

h[n] =4

30.5nu[�n� 1]� 3

20.75nu[�n� 1]� 5

61.25nu[�n� 1].

The impulse response is left-sided, and therefore the system is not causal.(b) ROC = {z | 0.5 < |z| < 0.75}. The ROC does not include the UC, and therefore the system

is not BIBO stable. In this case,

h[n] = �4

30.5nu[n]� 3

20.75nu[�n� 1]� 5

61.25nu[�n� 1].

The impulse response is two-sided, and therefore the system is not causal.(c) ROC = {z | 0.75 < |z| < 1.25}. The ROC includes the UC, and therefore the system is BIBO

stable. In this case,

h[n] = �4

30.5nu[n] +

3

20.75nu[n]� 5

61.25nu[�n� 1].

The impulse response is two-sided, and therefore the system is not causal.(d) ROC = {z | |z| > 1.25}. The ROC does not include the UC, and therefore the system is not

BIBO stable. In this case,

h[n] = �4

30.5nu[n] +

3

20.75nu[n] +

5

61.25nu[n].

The impulse response is right-sided, and therefore the system is causal.

2

Page 5: ECE 413 – Digital Signal Processing Midterm Exam, Spring 2017ece413/Exams/exams17.pdf · 2017-08-17 · ECE 413 – Digital Signal Processing Midterm Exam, Spring 2017 June 14,

Question 4:

The system function of the required system is given by

H(z) =Y (z)

X(z)=

1

1� (1/4)z�1÷

✓1

1� (1/3)z�1� 1

1� (1/4)z�1

◆=

=1

1� (1/4)z�1· (1� (1/3)z�1)(1� (1/4)z�1)

(1/12)z�1= 12z � 4.

Therefore, the system has a finite impulse response of length two, viz. h[�1] = 12 and h[0] = �4(hence, non-causal). The di↵erence equation of the system is given by

y[n] = 12x[n+ 1]� 4x[n].

3

Page 6: ECE 413 – Digital Signal Processing Midterm Exam, Spring 2017ece413/Exams/exams17.pdf · 2017-08-17 · ECE 413 – Digital Signal Processing Midterm Exam, Spring 2017 June 14,

University of WaterlooDepartment of Electrical and Computer Engineering

ECE 413 – Digital Signal Processing

Final Exam, Spring 2017

August 8, 12:30 –15:00

Instructor: Dr. Oleg Michailovich

Surname

Legal Given Name(s)

UW Student ID Number

Instructions:

• This exam has 3 pages.

• Only unannotated printouts of the lecture slides are allowed on the exam. Please,turn o↵ your cell phones, PDAs, etc., and place your bags, backpacks, books, and notes underthe table or at the front of the room.

• Please, place your WATCARD on the table, and fill out the exam attendance sheet whenprovided by the proctor after the exam starts.

• Question marks are listed by the question.

• Please, do not separate the pages, and indicate your Student ID at the top of every page.

• Be neat. Poor presentation will be penalized.

• No questions will be answered during the exam. If there is an ambiguity, state yourassumptions and proceed.

• No student can leave the exam room in the first 45 minutes or the last 15 minutes.

• If you finish before the end of the exam and wish to leave, remain seated and raise your hand.A proctor will pick up the exam from you, at which point you may leave.

• When the proctors announce the end of the exam, put down your pens/pencils, close yourexam booklet, and remain seated in silence. The proctors will collect the exams, count them,and then announce you may leave.

1

Page 7: ECE 413 – Digital Signal Processing Midterm Exam, Spring 2017ece413/Exams/exams17.pdf · 2017-08-17 · ECE 413 – Digital Signal Processing Midterm Exam, Spring 2017 June 14,

Question 1 (20%)

The autocorrelation of a real-valued, absolutely summable sequence x[n] is defined as

rxx

[l] =X

n

x[n]x[n� l].

Let X(z) be the z-transform of x[n] with ROC ↵ < |z| < �.

a) Show that the z-transform of rxx

[l] is given by

Rxx

(z) = X(z)X(z�1).

What is the ROC of Rxx

(z)?

b) Let x[n] = anu[n], |a| < 1. Determine Rxx

(z) and sketch its pole-zero plot and the ROC.

c) Determine the autocorrelation rxx

[l] for the x[n] in (b) above.

Question 2 (20%)

Given a sequence with Fourier transform X(e|!) = 1/(1+0.8e�|!), determine the Fourier transformof the following signals:

a) x1[n] = e|⇡n/2x[n+ 2],

b) x2[n] = x[n] cos(0.4⇡n),

c) x3[n] = x[n] ⇤ x[�n],

d) x4[n] = x[2n],

e) x5[n] = x[n], n is even and x5[n] = 0, n is odd.

Question 3 (15%)

Consider a single echo system y[n] = x[n] + 0.1x[n� 5].

a) Determine and sketch the impulse, magnitude and phase responses of the system H(z).

b) Determine the di↵erence equation of an inverse system Hi

(z) so that H(z)Hi

(z) = 1.

c) Determine and sketch the impulse, magnitude and phase responses of the inverse systemH

i

(z).

Question 4 (10%)

The filter

H(z) =(z2 + 2z � 3)(z2 � 3z + 5)

(z2 + 3.7z + 1.8)(z2 � 0.4z + 0.35)

is unstable. Determine a stable system function G(z) such that |G(e|!)| = |H(e|!)|.

2

Page 8: ECE 413 – Digital Signal Processing Midterm Exam, Spring 2017ece413/Exams/exams17.pdf · 2017-08-17 · ECE 413 – Digital Signal Processing Midterm Exam, Spring 2017 June 14,

Question 5 (20%)

The first five values of the 9-point DFT of a real-valued sequence x[n] are given by

{4, 2� |3, 3 + |2, �4 + |6, 8� |7} .

Without computing IDFT and then DFT but using DFT properties only, determine the DFT ofeach of the following sequences:

a) x1[n] = x[hn+ 2i9],

b) x2[n] = 2x[h2� ni9],

c) x3[n] = x[n] ⇣ x[h�ni9],

d) x4[n] = x2[n],

e) x5[n] = x[n]e�|4⇡n/9.

Question 6 (15%)

Determine the output y[n] in terms of the input x[n] for the following system

3

Page 9: ECE 413 – Digital Signal Processing Midterm Exam, Spring 2017ece413/Exams/exams17.pdf · 2017-08-17 · ECE 413 – Digital Signal Processing Midterm Exam, Spring 2017 June 14,

Solutions for ECE 413 final exam

Spring, 2017

Question 1:

(a) The autocorrelation sequence rxx

[l] can be expressed as a convolution of x[n] with its time-reversed (i.e., folded) version x̃[n] = x[�n], viz. r

xx

[l] = (x ⇤ x̃)[l]. The convolution theoremsuggests R

xx

(z) = X(z)X̃(z), while X̃(z) = X(1/z) by the properties of z-transform. Hence,

Rxx

(z) = X(z)X(1/z).

Suppose the ROC of X(z) is {z | r1 < |z| < r2}, where 0 r1 < 1 and 1 < r2 1, sothat the unit circle is included in the ROC in accordance with the assumption on x[n] to beabsolutely summable. In this case, the ROC of X̃(z) is given by {z | 1/r2 < |z| < 1/r1}.Since the ROC of R

xx

(z) is defined as the intersection of the above two ROCs, we have

ROCRxx

= {z | max{r1, 1/r2} < |z| < min{r2, 1/r1}} .

(b) For x[n] = anu[n] (with |a| < 1), we have

Rxx

(z) =1

1� az�1

1

1� az=

1

1 + a2 � a(z + z�1),

with its ROC being an annular region defined by {z | a < |z| < 1/a}.(c) The autocorrelation sequence r

xx

[l] is symmetric, i.e., rxx

[l] = rxx

[�l]. Therefore, it is su�cientto define it for l � 0. In particular, we have

rxx

[l] =X

n

anu[n]an�lu[n� l] = a�l

1X

n=l

(a2)n = a�l

1X

n=0

(a2)n �l�1X

n=0

(a2)n!

=

= a�l

✓1

1� a2� 1� a2l

1� a2

◆=

al

1� a2.

Thus, we finally obtain

rxx

[l] =a|l|

1� a2, 8l.

Question 2:

(a)

X1(ej!) = X(ej(!�⇡/2))e2j(!�⇡/2) =

e2j(!�⇡/2)

(1 + 0.8e�j(!�⇡/2))= � ej2!

(1 + 0.8e�j(!�⇡/2)).

1

Page 10: ECE 413 – Digital Signal Processing Midterm Exam, Spring 2017ece413/Exams/exams17.pdf · 2017-08-17 · ECE 413 – Digital Signal Processing Midterm Exam, Spring 2017 June 14,

(b)

X2(ej!) =

1

2X(ej(!�0.4⇡)) +

1

2X(ej(!+0.4⇡)) =

1

2

1

(1 + 0.8e�j(!�0.4⇡))+

1

(1 + 0.8e�j(!+0.4⇡))

�.

(c)

X3(ej!) = X(ej!)X(e�j!) =

1

(1 + 0.8e�j!)

1

(1 + 0.8ej!)=

1

1.64 + 1.6 cos!.

(d)

X4(ej!) =

1X

n=�1x[2n]e�j!n =

1X

n=�1x[n]e�j!n/2 = X(ej(!/2)) =

1

(1 + 0.8e�j!/2).

(e) Note that x5[n] can be obtained by point-wise multiplication of x[n] by (1 + e|⇡n)/2. Conse-quently, by the modulation property of DTFT, we have

X5(e|!) =

1

2

1

1 + 0.8e|!+

1

1 + 0.8e|(!�⇡)

�.

Question 3:

(a) The system equation y[n] = x[n] + 0.1x[n � 5] can be expressed as a convolution of x[n]with h[n] = {1, 0, 0, 0, 0, 0.1}, which amounts to FIR filtering. The frequency response of thesystem is given by

H(e|!) = H(z)���z=e

|!= (1 + 0.1z�5)

���z=e

|!= 1 + 0.1e�|5! = 1 + 0.1 cos(5!)� | sin(5!),

and therefore

|H(e|!)| =p(1 + 0.1 cos(5!))2 + (0.1 sin(5!))2 =

p1.01 + 0.2 cos(5!)

and

\H(e|!) = � tan�1

sin(5!)

10 + cos(5!)

�.

(b) The inverse system is defined by

Hi

(z) = 1/H(z) =1

1 + 0.1z�5,

with its corresponding di↵erence equation of the form

y[n] = �0.1y[n� 5] + x[n].

(c) Let g[n] = (�0.1)nu[n] with G(z) = 11+0.1z�1

, and note that Hi

(z) = G(z5). Hence, hi

[n] isobtained by inserting 4 zeros between every pair of successive samples of g[n]. Formally,

hi

[n] =

((�0.1)nu[n], if hni5 = 0

0, otherwise.

Moreover, we have

Hi

(e|!) =1

1 + 0.1e�|5!, |H

i

(e|!)| = 1p1.01 + 0.2 cos(5!)

, \Hi

(e|!) = tan�1

sin(5!)

10 + cos(5!)

�.

2

Page 11: ECE 413 – Digital Signal Processing Midterm Exam, Spring 2017ece413/Exams/exams17.pdf · 2017-08-17 · ECE 413 – Digital Signal Processing Midterm Exam, Spring 2017 June 14,

Question 4:

The given filter H(z) has 4 poles, only one of which, z1 = 3.1238, lies outside the unit circle, thusrendering the filter unstable (assuming the latter is causal). To stabilize H(z), one should multiplyit with an all-pass filter that has a zero at z1 = 3.1238, which will cancel the unstable pole. Suchall-pass filter is given by

Hap(z) =z�1 � p11� p1z�1

,

where p1 = 1/3.1238 ⇡ 0.3201. Thus,

G(z) = H(z)z�1 � 0.3201

1� 0.3201z�1.

Question 5:

Since x[n] is real, its DFT is conjugate symmetric. Thus, the entire set of values of X[k] is given by

X = {4, 2� |3, 3 + |2, �4 + |6, 8� |7, 8 + |7, �4� |6, 3� |2, 2 + |3}.

(a)X1[k] = X[k] · exp{|2(2⇡/9)k} = X[k] · exp{|4⇡k/9} = X[k] ·W 2k

9 ,

for k = 0, 1, . . . , 8.(b)

X2[k] = 2X⇤[k] · exp{�|2(2⇡/9)k} = 2X⇤[k] · exp{�|4⇡k/9} = 2X⇤[k] ·W�2k9 = 2X⇤

1 [k],

for k = 0, 1, . . . , 8.(c)

{X3[k]}8k=0 = {|X[k]|2}8

k=0 = {16, 13, 13, 52, 113, 113, 52, 13, 13}.(d)

X4[k] =1

9(X 9○X) [k] =

= {398, �117+|126, 7�|222, 122+|116, 31+|60, 31�|60, 122�|116, 7+|222, �117�|126}.

(e)

X5[k] = X[hn+ 2i9] = {3 + |2, �4 + |6, 8� |7, 8 + |7, �4� |6, 3� |2, 2 + |3, 4, 2� |3}.

Question 6:

The given DSP pipeline consists of 4 consecutive operations: 1) upsampling by a factor of 2, 2) LTIfiltering, 3) downsampling by a factor of 5, and 4) upsampling by a factor of 2. Let’s denote theoutputs of these operations by y1[n], y2[n], y3[n], and y4[n], respectively (with y4[n] = y[n]).

First, we define each Yi

(e|!), for i = 1, . . . , 4, in terms of Yi�1(e|!) (with Y0(e|!) = X(e|!) and

Y4(e|!) = Y (e|!)).Y1(e

|!) = X(e|2!).

3

Page 12: ECE 413 – Digital Signal Processing Midterm Exam, Spring 2017ece413/Exams/exams17.pdf · 2017-08-17 · ECE 413 – Digital Signal Processing Midterm Exam, Spring 2017 June 14,

Y2(e|!) = Y1(e

|!)H(e|!).

Y3(e|!) =

1

5

4X

m=0

Y2

�e|(!�2⇡m)/5

�.

Y (e|!) = Y3(e|2!).

Then, by “back-substitution”, we obtain

Y (e|!) = Y3(e|2!) =

1

5

4X

m=0

Y2

�e|(2!�2⇡m)/5

�=

1

5

4X

m=0

Y1

�e|(2!�2⇡m)/5

�H�e|(2!�2⇡m)/5

�=

=1

5

4X

m=0

X�e|(4!�2⇡m)/5

�H�e|(2!�2⇡m)/5

�.

This formula relates X(e|!) to Y (e|!), and, therefore, x[n] to y[n].

4