Professional Documents
Culture Documents
DSP1 - Practice Homework With Solutions
DSP1 - Practice Homework With Solutions
Solution 1.
(a) A classic result for the partial sum of a geometric series states that:
N
¨ N +1
1−z
X
k 1−z for z 6= 1
z =
i =0
N + 1 for z = 1.
s = 1+ z + z2 + ...+ zN ,
−z s = −z − z 2 − . . . − z N − z N +1 .
1 − z N +1
(1 − z )s = 1 − z N +1 ⇒ s = .
1−z
From this we can easily derive
N2 2 −N1
NX
X z N1 − z N2+1
z k = z N1 zk = .
k =N1 k =0
1−z
we have
∞
X 1
s [n] = 1 + j.
n=1
2
1
(b) We have
N
X j 1 − ( j /3)N
s [k ] = · .
k =1
3 1 − j /3
j 1
Since | 3 | = 3 < 1, limN →∞ ( j /3)N = 0. Therefore
∞
X j j (3 + j ) 1 3
s [k ] = = =− + j · .
k =1
3− j 10 10 10
(c) If z ∗ = z −1 then
z z ∗ = 1, ∀ z 6= 0.
Since z z ∗ = |z |2 the condition is equivalent to |z |2 = 1; this is valid for all complex number that lie on
the unit circle in the complex plane.
2k π 2k π
(d) Since e j 2k π = 1, for all k ∈ Z, z k = e j 3 will satisfy z k3 = 1. The sequence e j 3 is periodic with period
3, so there are only three distinct values as k takes on all possible values and these are:
2π 4π
z 0 = 1, z1 = e j 3 and z2 = e j 3 .
(e) We have
N
1 1−2−N
Y π
PN −n
e j 2n = e j π n=1 2 = e jπ2· 1−1/2 .
n=1
Solution 2.
To compute the number of samples N , we need to multiply the length in seconds of the signal by the sampling
frequency, i.e., the number of samples per second:
This assumes that the audio is mono; for stereo data, there are two independent channels so the number of
samples is double.
2
Solution 3.
We compute y [n] by substituting the expression for x [n] into y [n] = (x [n] + x [n − 1])/2:
δ[n] + 2δ[n − 1] + 3δ[n − 2] + δ[n − 1] + 2δ[n − 2] + 3δ[n − 3]
y [n] =
2
By collecting the delta signals that have the same delay we finally obtain:
z −1 −1
c
b
+ z −3
z −1
Solution 4.
To determine the input-output relationship of a complex circuit, it is a good strategy to first look at the inter-
mediate signals that appear at key nodes in the graph. Once the expressions for these signals are computed,
they can be combined to produce the global output of the circuit.
In the graph below, call p [n], q [n], r [n] the internal signals in the circuit at the shown locations:
a p [n] b
b b
x [n] + + y [n]
z −1 −1
c q [n]
b
+ z −3
r [n]
z −1
3
(a) p [n] = a x [n] + x [n − 1]
(c) r [n] = q [n − 3]
y [n] = a b x [n] + b x [n − 1] − c x [n − 3] − x [n − 4]
Exercise 5. Bases
Let {x(k ) }k =0,...,N −1 be a basis for a subspace S . Prove that any vector z ∈ S is uniquely represented in this basis.
Hint: remember that the vectors in a basis are linearly independent and use this to prove the thesis by contra-
diction.
Solution 5.
Suppose by contradiction that the vector z ∈ S admits two distinct representations in the basis {x(k ) }k =0,...,N −1 .
In other words, suppose that there exist two set of scalars α0 , . . ., αN −1 and β0 , . . ., βN −1 , with αi 6= βi for all i ,
such that
N
X −1
z= αk x(k )
k =0
and
N
X −1
z= βk x(k ) .
k =0
or, equivalently,
N
X −1
(αk − βk )x(k ) = 0.
k =0
The above expression is a linear combination of basis vectors that is equal to zero. Because of the linear
independence of a set of basis vector, the only set of coefficients that satisfies the above equation is a set of
null coefficients so that it must be αi 6= βi for all i , in contradiction with the hypothesis.
Solution 6.
The eight vertexes of the unit cube can be represented by the following four vectors:
4
and the four associated diagonals are therefore:
d1 = v8 − v1 = [1, 1, 1].
d2 = v7 − v2 = [−1, 1, 1].
d3 = v6 − v3 = [1, −1, 1].
d4 = v5 − v4
T are orthogonal if their inner product is zero but it is easy to verify that 〈di , d j 〉 =
6 0 for all i , j .
xr = [x [N − 1] x [N − 2] . . . x [1] x [0]]T
−(N −k )
in terms of the DFT X of the signal x. Hint: you may find it useful to remark that WNk = WN .
Solution 7.
Recall the DFT (analysis) formula
N
X −1
X [k ] = x [n]WNnk .
n=0
−(N −n)
By replacing WNn with WN , we get
N
X −1 N
X −1
−(N −n)k −(n+1)k
X r [k ] = x [N − 1 − n]WN = x [n]WN
n=0 n=0
N
X −1 N
X −1
n(N −k )
= WN−k x [n]WN−nk = WN−k x [n]WN
n=0 n=0
−k
= WN X [N − k ].
Consider now the length-2N signal obtained by interleaving the values of x with zeros
.
Express X2 (the 2N -point DFT of x2 ) in terms of X.
Solution 8.
Knowing that
2π 2π
WNnk , 0≤k <N
2nk −j 2nk −j N nk
W2N =e 2N =e =
n(k −N )
WN , N ≤ k < 2N
5
we get
PN −1
nk
n=0 x [n]WN = X [k ], 0≤k <N
X 2 [k ] =
PN −1 n(k −N )
n=0 x [n]WN = X [(k − N )], N ≤ k < 2N
y = DFT{DFT{x}}?
In other words, what are the effects of applying twice the DFT transform?
Solution 9.
Let X = DFT{x}. We have:
N
X −1
2π
y [n] = X [k ]e − j N nk
k =0
N
X −1§ N
X −1 ª
2π 2π
= x [i ]e − j N ik e −j N nk
k =0 i =0
N
X −1 N
X −1
2π
= x [i ] e − j N (i +n)k .
i =0 k =0
Now,
N −1
X
−j 2π
N (i +n)k
N for (i + n) = 0, N , 2N , 3N , . . .
e = = N δ[(i + n) mod N ]
0 otherwise
k =0
so that
N
X −1
y [n] = x [i ]N δ[(i + n) mod N ]
i =0
N x [0] for n = 0
=
N x [N − n] otherwise.
Express rx in terms of X. [Hint: build a signal S [n] = X [n]X ∗ [n], compute its inverse DFT and work back-
wards.]
6
Solution 10.
N −1
1 X 2π
IDFT {S} [m ] = X [k ]X ∗ [k ]e j N k m
N k =0
N −1 N −1 NX −1
1 X X 2π 2π 2π
= x [n]e − j N k n x ∗ [l ]e j N l k e j N k m
N k =0 n=0 l =0
N −1 N −1 N −1
1 X X X 2π
= x [n] x ∗ [l ] e j N k (l +m−n)
N n=0 l =0 k =0
N
X −1
= x [n]x ∗ [(n − m ) mod N ]
n=0
Solution 11.
The IDFT of Y can be expressed as
N
2 −1
1 X 2π
y [n] = Y [l ]e j N /2 nl
N /2 l =0
N
2 −1
2 X 2π
= X [2l ]e j N 2nl
N l =0
7
(a) Show that
1
〈x [n], y [n]〉 = 〈X (e j ω ), Y (e j ω )〉,
2π
where we use the inner products for l 2 (Z) and L 2 ([−π, π]) respectively.
(b) What is the physical meaning of the above formula when x [n] = y [n] ?
Solution 12.
(a) The inner product in l 2 (Z) is defined as
Thus,
Z π Z π
1 1 ∗
X ∗ (e j ω )Y (e j ω )d w = Σn x [n]e − j ωn Σm y [m ]e − j ωm d w
2π −π
2π −π
Z π
(1) 1
= Σn x ∗ [n]e j ωn Σm y [m ]e − j ωm d w
2π −π
Z π
1
= Σn Σm x ∗ [n]y [m ]e j ω(n−m) d w
2π −π
Z π
(2) 1
= Σn Σm x ∗ [n]y [m ] e j ω(n−m) d w
2π −π
(3) ∗
= Σn x [n]y [n],
where (1) follows from the properties of the complex conjugate, (2) from swapping the integral and the
sums and (3) from the fact that
Zπ
1 j ω(n−m) 1 if m = n
e dw = .
2π −π 0 if m 6= n
(b) 〈x [n], x [n]〉 corresponds to the energy of the signal in the time domain; 〈X (e j ω ), X (e j ω )〉 corresponds
to the energy of the signal in the frequency domain. The Plancherel-Parseval equality illustrates an
energy conservation property from the time domain to the frequency domain. This property is known
as the Parseval’s theorem.
Solution 13.
We have:
∞
X ∞
X
x [−n]e − j ωn = x [m ]e j ωm
n=−∞ m=−∞
∞
X
= x [m ]e − j (−ω)m
m=−∞
−jω
= X (e )
8
with the change of variable m = −n. Hence, we obtain that the DTFT of the time-reversed sequence x [−n]
is X (e − j ω )
Similarly:
∞
X ∞
X
x [n − n0 ]e − j ωn = x [m ]e − j ω(m+n0 )
n=−∞ m=−∞
∞
X
= e − j ωn0 x [m ]e − j ωm
m=−∞
− j ωn0 jω
= e X (e )
with the change of variable m = n −n0 . We, therefore, obtain the DTFT of the time-shifted sequence x [n −n0 ]
is e − j ωn0 X (e j ω )