Exams 17
Exams 17
Exams 17
Surname
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 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
Question 1 (25%)
A signal generator produces a sinusoidal tone xc (t) = cos(2⇡F0 t) with fundamental frequency F0
between 1 Hz and 1000 kHz. The signal is sampled with a sampling rate Fs = 1/T = 6000 Hz and
reconstructed 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(⌦0 t)} + |H{xc (t) sin(⌦0 t)},
Question 3 (25%)
By selecting di↵erent ROCs, calculate four possible impulse responses of the transfer function
1 z 1
H(z) = .
(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 that
you have acquired in this course. The firm asks you to design a discrete-time LTI system that has
the property that if the input is given by
2
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) = 1
kHz and (6 7) = 1 kHz. As a result, yr (t) = cos(2⇡1000t). Note that the other spectral
replicas “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 that
the other spectral replicas “miss” the passband.
Question 2:
First note that, by linearity, we have
x̃c (t) = H{xc (t) cos(⌦0 t)} + |H{xc (t) sin(⌦0 t)} = H{xc (t)e|⌦0 t )},
1
Question 3:
By using the method of partial fraction expansion, we get
A B C
H(z) = 1
+ 1
+ 1
1 0.5z 1 1 0.75z 1.25z
1 4
A = (1 0.5z )H(z) |z=0.5 =
3
1 3
B = (1 0.75z )H(z) |z=0.75 =
2
1 5
C = (1 1.25z )H(z) |z=1.25 =
6
4/3 3/2 5/6
H(z) = 1
+ 1
+ 1
1 0.5z 1 + 0.75z 1 1.25z
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,
4 3 5
h[n] = 0.5n u[ n 1] 0.75n u[ n 1] 1.25n u[ n 1].
3 2 6
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,
4 n 3 5
h[n] = 0.5 u[n] 0.75n u[ n 1] 1.25n u[ n 1].
3 2 6
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,
4 n 3 5
h[n] = 0.5 u[n] + 0.75n u[n] 1.25n u[ n 1].
3 2 6
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,
4 n 3 5
h[n] = 0.5 u[n] + 0.75n u[n] + 1.25n u[n].
3 2 6
The impulse response is right-sided, and therefore the system is causal.
2
Question 4:
The system function of the required system is given by
✓ ◆
Y (z) 1 1 1
H(z) = = 1
÷ 1
=
X(z) 1 (1/4)z 1 (1/3)z 1 (1/4)z 1
1 (1 (1/3)z 1 )(1 (1/4)z 1 )
= · = 12z 4.
1 (1/4)z 1 (1/12)z 1
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
3
University of Waterloo
Department of Electrical and Computer Engineering
Surname
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 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
Question 1 (20%)
The autocorrelation of a real-valued, absolutely summable sequence x[n] is defined as
X
rxx [l] = x[n]x[n l].
n
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] = an u[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 transform
of the following signals:
a) x1 [n] = e|⇡n/2 x[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 system
Hi (z).
Question 4 (10%)
The filter
(z 2 + 2z 3)(z 2 3z + 5)
H(z) =
(z 2 + 3.7z + 1.8)(z 2 0.4z + 0.35)
is unstable. Determine a stable system function G(z) such that |G(e|! )| = |H(e|! )|.
2
Question 5 (20%)
The first five values of the 9-point DFT of a real-valued sequence x[n] are given by
Without computing IDFT and then DFT but using DFT properties only, determine the DFT of
each of the following sequences:
d) x4 [n] = x2 [n],
|4⇡n/9
e) x5 [n] = x[n]e .
Question 6 (15%)
Determine the output y[n] in terms of the input x[n] for the following system
3
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. rxx [l] = (x ⇤ x̃)[l]. The convolution theorem
suggests Rxx (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, so
that the unit circle is included in the ROC in accordance with the assumption on x[n] to be
absolutely summable. In this case, the ROC of X̃(z) is given by {z | 1/r2 < |z| < 1/r1 }.
Since the ROC of Rxx (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] = an u[n] (with |a| < 1), we have
1 1 1
Rxx (z) = 1
= ,
1 az 1 az 1+ a2 a(z + z 1 )
with its ROC being an annular region defined by {z | a < |z| < 1/a}.
(c) The autocorrelation sequence rxx [l] is symmetric, i.e., rxx [l] = rxx [ l]. Therefore, it is sufficient
to define it for l 0. In particular, we have
1 1 l 1
!
X X X X
rxx [l] = an u[n]an l u[n l] = a l (a2 )n = a l (a2 )n (a2 )n =
n n=l n=0 n=0
✓ ◆
l 1 1 a2l al
=a = .
1 a2 1 a2 1 a2
Thus, we finally obtain
a|l|
rxx [l] = , 8l.
1 a2
Question 2:
(a)
e2j(! ⇡/2)
ej2!
X1 (ej! ) = X(ej(! ⇡/2)
)e2j(! ⇡/2)
= j(! ⇡/2) )
= .
(1 + 0.8e (1 + 0.8e j(! ⇡/2) )
1
(b)
1 1 1 1 1
X2 (e ) = X(ej(!
j! 0.4⇡)
) + X(e j(!+0.4⇡)
)= + .
2 2 2 (1 + 0.8e j(! 0.4⇡) ) (1 + 0.8e j(!+0.4⇡) )
(c)
1 1 1
X3 (ej! ) = X(ej! )X(e j!
)= j! ) j!
= .
(1 + 0.8e (1 + 0.8e ) 1.64 + 1.6 cos !
(d)
1
X 1
X 1
X4 (ej! ) = x[2n]e j!n
= x[n]e j!n/2
= X(ej(!/2) ) = j!/2 )
.
n= 1 n= 1
(1 + 0.8e
(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
|! 1 1 1
X5 (e ) = |!
+ .
2 1 + 0.8e 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 the
system is given by
and therefore
p p
|H(e|! )| = (1 + 0.1 cos(5!))2 + (0.1 sin(5!))2 = 1.01 + 0.2 cos(5!)
and
sin(5!)
\H(e ) = |!
tan 1
.
10 + cos(5!)
(b) The inverse system is defined by
1
Hi (z) = 1/H(z) = 5
,
1 + 0.1z
with its corresponding di↵erence equation of the form
y[n] = 0.1y[n 5] + x[n].
1
(c) Let g[n] = ( 0.1)n u[n] with G(z) = 1+0.1z 5
1 , and note that Hi (z) = G(z ). Hence, hi [n] is
obtained by inserting 4 zeros between every pair of successive samples of g[n]. Formally,
(
( 0.1)n u[n], if hni5 = 0
hi [n] = .
0, otherwise
Moreover, we have
1 1 sin(5!)
|!
Hi (e ) = |5!
|!
, |Hi (e )| = p , \Hi (e ) = tan|! 1
.
1 + 0.1e 1.01 + 0.2 cos(5!) 10 + cos(5!)
2
Question 4:
The given filter H(z) has 4 poles, only one of which, z1 = 3.1238, lies outside the unit circle, thus
rendering the filter unstable (assuming the latter is causal). To stabilize H(z), one should multiply
it with an all-pass filter that has a zero at z1 = 3.1238, which will cancel the unstable pole. Such
all-pass filter is given by
z 1 p1
Hap (z) = ,
1 p1 z 1
where p1 = 1/3.1238 ⇡ 0.3201. Thus,
1
z 0.3201
G(z) = H(z) .
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
(a)
X1 [k] = X[k] · exp{|2(2⇡/9)k} = X[k] · exp{|4⇡k/9} = X[k] · W92k ,
for k = 0, 1, . . . , 8.
(b)
for k = 0, 1, . . . , 8.
(c)
{X3 [k]}8k=0 = {|X[k]|2 }8k=0 = {16, 13, 13, 52, 113, 113, 52, 13, 13}.
(d)
1
X4 [k] =(X ○X)
9 [k] =
9
= {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) LTI
filtering, 3) downsampling by a factor of 5, and 4) upsampling by a factor of 2. Let’s denote the
outputs 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
Y2 (e|! ) = Y1 (e|! )H(e|! ).
4
1X
Y3 (e|! ) = Y2 e|(! 2⇡m)/5
.
5 m=0
Y (e|! ) = Y3 (e|2! ).
Then, by “back-substitution”, we obtain
4 4
|! |2! 1X 1X
Y (e ) = Y3 (e )= Y2 e|(2! 2⇡m)/5
= Y1 e|(2! 2⇡m)/5
H e|(2! 2⇡m)/5
=
5 m=0 5 m=0
4
1X
= X e|(4! 2⇡m)/5
H e|(2! 2⇡m)/5
.
5 m=0