Chapter 3: Problem SolutionsFourier Analysis of Discrete Time Signals
Problems on the DTFT: Definitions and Basic Properties
à Problem 3.1
Problem
Using the definition determine the DTFT of the following sequences. It it does not exist say why:
a) xn 0.5nunb) xn 0.5n
c) xn 2nund )xn 0.5nune) xn 2n
f) xn 30.8ncos0.1n
Solution
a) Applying the geometric series
X n0
0.5nejn 110.5ej
b) Applying the geometric series
X n0
0.5nejn
n1
0.5nejn
n0
0.5nejn
n0
0.5nejn 1 110.5ej 110.5ej 1
1.5 2. 0.5 c) Applying the geometric series
X n0
2nejn
n0
2nejn 110.5ej
d) Applying the geometric series
X n0
0.5nejn
n0
0.5nejn
n0
2nejn does not converge
and the DTFT does not exist;
e) Applying the geometric series
X n0
2nejn
n1
2nejn
n0
2nejn
n1
2nejn does not converge
and the DTFT does not exist;
f) Expanding the cosine, we can write
xn 32 0.8n ej0.1nun 32 1.25n ej0.1nun 1 32 0.8n ej0.1nun 32 1.25n ej0.1nun 1
which becomes
xn 32 0.8ej0.1nun 32 1.25ej0.1n
un 1 32 0.8 ej0.1n
un 32 1.25 ej0.1nun 1
Taking the DTFT of every term, recall that
DTFTanun n0
anejn ej
eja , if a 1
DTFTanun 1 n1
anejn
n0
anejn 1 ej
eja , if a 1
Therefore we obtain
X w = ejwÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅejw-0.8äej0 .1 p + ejw
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅejw-0.8äe-j0 .1 p - ejwÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅejw-1.25äej0 .1 p - ejw
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅejw-1.25äe-j0 .1 p
2 Solutions_Chapter3[1].nb
Basic Problems on the DFT
à Problem 3.3
Problem
Compute the DFT of the following sequences
a) x 1, 0, 1, 0b) x j, 0, j, 1c) x 1, 1, 1, 1, 1, 1, 1, 1d) xn cos0.25n, n 0, ..., 7
e) xn 0.9n, n 0, ..., 7
Solution
a) N 4 therefore w4 ej24 j . Therefore
Xk n0
3xnjnk 1 j2k, k 0, 1, 2, 3 . This yields
X 0, 2, 0, 2
b) Similarly, Xk j jj2k j3k j j1k jk, k 0, ..., 3 , which yields
X 1 2j, j, 1 2j, jc) N 8 and w8 ej28 ej4 . Therefore, applying the geometric sum we obtain
Xk n0
7w8nk
1w88k1w8k 0 when k 0
8 when k 0
since wNN ej2NN 1 . Therefore
X 8, 0, 0, 0, 0, 0, 0, 0d) Again N 8 and w8 ej4 . Therefore
4 Solutions_Chapter3[1].nb
Xk 12 n0
7ej 4 nej 4 nk
n0
7ej 4 nej 4 nk
12 n0
7ej 4 k1n
n0
7ej 4 k1n
Applying the geometric sum we obtain
X 0, 4, 0, 0, 0, 0, 4e) Xk
n0
70.9nej 4 nk 10.98
10.9ej 4 k
, for k 0, ..., 7 Substituting numerically we
obtain
X 5.69, 0.38 0.67 j, 0.31 0.28 j,0.30 0.11 j, 0.30, 0.30 0.11 j, 0.31 0.28 j, 0.38 0.67 j
à Problem 3.4
Problem
Let X 1, j, 1, j , H 0, 1, 1, 1 be the DFT's of two sequences x and h respec-tively. Using the properties of the DFT (do not compute the sequences) determine the DFT's of the following:
Solution
a) xn 14Recall DFTxn mN wN
kmXk . In our case w4 ej24 j and therefore
DFTxn 14 jkXk for k 0, ..., 3
This yields DFTxn 14 1, 1, 1, 1
b) DFTxn 34 j3kXk 1, 1, 1, 1
c) Yk HkXk from the property of circular convolution. This yields
Y 0, j, 1, j
Solutions_Chapter3[1].nb 5
a) DFTx3, x0, x1, x2b) DFT h0, -h1, h2, -h3c) DFT h ≈ x, where ≈ denotes circular convolution
d) DFT x0, h0, x1, h1, x2, h2, x3, h3
Solution
a) DFT x3, x0, x1, x2 = DFT xn - 14 = w4-k X k with w4 = e-j2p4 = - j Therefore
DFT x3, x0, x1, x2 = - jk1, j, -1, - j = 1, 1, 1, 1b) DFT h0, -h1, h2, -h3 =
DFT -1n hn = DFT e-j22 p 4 n hn = Hk - 24 = 1, 1 - j, 0, 1 + jc) DFT h ≈ x = Hk X k = 0, -1 + j, -1, -1 - jd) Let y = x0, h0, x1, h1, x2, h2, x3, h3 , with length N = 8. Therefore its DFT is
Y k = Sn=0
7 yn w8
nk = Sm=0
3 y2 m w8
2 mk + Sm=0
3 y2 m + 1 w8
2 m+1 k
Y k = X k + w8k Hk , for k = 0, ..., 7
This yields Y = 1, j + 1 + j e- j pÅÅÅÅÅÅÅÅ4 , -1 - j, - j + 1 - j e- 3 j pÅÅÅÅÅÅÅÅÅÅÅÅ4 , 1, j + 1 + j e
3 j pÅÅÅÅÅÅÅÅÅÅÅÅ4 , -1 + j, - j + 1 - j ej pÅÅÅÅÅÅÅÅ4
à Problem 3.8
Problem
Two finite sequences h and x have the following DFT's:
X = DFT x = 1, -2, 1, -2H = DFT h = 1, j, 1, - j
Let y = h ≈ x be the four point circular convolution of the two sequences. Using the properties of the DFT (do not compute xn and hn),
a) determine DFT xn - 14 and DFT hn + 24;
b) determine y0 and y1 .
8 Solutions_Chapter3[1].nb
Solution
a) DFT xn - 14 = - jk X k = - j-k1, -2, 1, -2 = 1, 2 j, -1, -2 j . Similarly DFT hn + 24 = - j2 k Hk = -1k1, j, 1, - j = 1, - j, , 1, jb) y0 = 1ÅÅÅÅ4 S
k=0
3 Y k = 1ÅÅÅÅ4 1 0 + j 1 + j + -1 1 + - j 1 - j = -3ÅÅÅÅÅÅÅÅ4 and
y1 = 1ÅÅÅÅ4 Sk=0
3 Y k - j-k = 1ÅÅÅÅ4 1 0 + j 1 + j - j-1 + -1 1 - j-2 + - j 1 - j - j-3 = -1ÅÅÅÅÅÅÅÅ4
à Problem 3.9
Problem
Let x be a finite sequence with DFT
X = DFT x = 0, 1 + j, 1, 1 - jUsing the properties of the DFT determine the DFT's of the following:
a) yn = e jp2 n xnb) yn = cos pÅÅÅÅ2 n xnc) yn = xn - 14d) yn = 0, 0, 1, 0 ∆ xn with ∆ denoting circular convolution
Solution
a) Since e jp2 n xn = e j2 p4 n xn then DFT e jp2 n xn = X k - 14 = 1 - j, 0, 1 + j, 1b) In this case yn = 1ÅÅÅÅ2 e j2 p4 n xn + 1ÅÅÅÅ2 e- j2 p4 n xn and therefore its DFT is 1ÅÅÅÅ2 X k - 14 + 1ÅÅÅÅ2 X k + 14 = 1ÅÅÅÅ2 1 - j, 0, 1 + j, 1 + 1ÅÅÅÅ2 1 + j, 1, 1 - j, 0 . Putting things together
we obtain
Y = 1, 1ÅÅÅÅ2 , 1, 1ÅÅÅÅ2 c) DFT xn - 14 = e- j2 p4 k X k = - jk X k and therefore
Y = 0, 1 - j, -1, 1 + jd) DFT xn - 24 = - j2 k X k = -1k X k = 0, -1, j, 1, -1 + j
Solutions_Chapter3[1].nb 9
Problems on DFT: Manipulation of Properties and Derivation of Other Properties
à Problem 3.11
Problem
You know that DFT 1, 2, 3, 4 = 10, -2 + 2 j, -2, -2 - 2 j . Use the minimum number of opera-tions to compute the following transforms:
Solution
a) Let
x = 1, 2, 3, 4s = 1, 2, 3, 4, 1, 2, 3, 4y = 1, 2, 3, 4, 0, 0, 0, 0
Then we can write yn = sn wn , n = 0, ..., 7 where
w = 1, 1, 1, 1, 0, 0, 0, 0and then, by a property of the DFT we can determine
Y k = DFT yn = DFT sn wn = 1ÅÅÅÅÅÅN W k ≈ SkLet's relate the respective DFT's:
Sk = DFT s = Sn=0
7 sn w8
n k
= Sn=0
3 sn w8
n k + Sn=0
3 sn + 4 w8
n+4 k
= Sn=0
3 sn w8
n k + -1k Sn=0
3 sn w8
n k
= 1 + -1k Sn=0
3 sn w8
n k
This implies that
10 Solutions_Chapter3[1].nb
S2 k = 2 X kS2 k + 1 = 0
and therefore
S = DFT 1, 2, 3, 4, 1, 2, 3, 4 = 2 X 0, 0, X 1, 0, X 2, 0, X 3, 0Furthermore:
W = DFT w = Sn=0
3 w8
n k = 1--1kÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
1-w8k if k = 1, ..., 7
4 if k = 0
and therefore
W = 4, 1 - j2 .4142, 0 , 1 - j 0.4142, 0, 1 + j0 .4142, 0, 1 + j 2.4142Finally the result:
Y k = 1ÅÅÅÅ8 Sm=0
7 Sm W k - m8
= 1ÅÅÅÅ8 Sp=0
3 2 X p W k - 2 p8
= 1ÅÅÅÅ4 Sp=0
3X p W k - 2 p8
where we used the fact that Sm ∫ 0 only for m even, and S2 p = 2 X p .
The final result is simpler than it seems. In fact notice that W 2 = W 4 = W 6 = 0. This implies that
Y 0 = 1ÅÅÅÅ4 W 0 X 0 = 1ÅÅÅÅ2 X 0 = 10
Y 2 = 1ÅÅÅÅ4 W 0 X 1 = 1ÅÅÅÅ2 X 1 = -2 + 2 j
Y 4 = 1ÅÅÅÅ4 W 0 X 2 = 1ÅÅÅÅ2 X 2 = -2
and we have only to compute
Y 1 = 1ÅÅÅÅ4 W 1 X 0 + W 7 X 1 + W 5 X 2 + W 3 X 3 = -0.4142 - j 2.4142
Y 3 = 1ÅÅÅÅ4 W 3 X 0 + W 1 X 1 + W 7 X 2 + W 5 X 3 = 2.4142 - j 1.2426
All other terms are computed by symmetry as Y 8 - k = Y *k , for k = 1, 2, 3.
b) Let y = 1, 0, 2, 0, 3, 0, 4, 0 . Then we can write
Y k = Sn=0
7 yn w8
n k = Sm=0
3 xm w8
2 m k
since y2 m = xm and y2 m + 1 = 0. From the fact that
w82 = e- j 2 pÅÅÅÅÅÅÅÅ8 2 = w4
Solutions_Chapter3[1].nb 11
we can write
Y k = Sm=0
3 xm w4
m k = X k , k = 0, 1, ..., 7
and therefore
Y = 10, -2 + 2 j, -2, -2 - 2 j, 10, -2 + 2 j, -2, -2 - 2 j
à Problem 3.12
Problem
You know that the DFT of the sequence x x0, ..., xN 1 is X X0, ..., XN 1 . Now consider two sequences:
s x0, ..., xN 1, x0, ..., xN 1y x0, ..., xN 1, 0, ... , 0´¨¨¨¨¨¨¨¨̈ ¨̈≠ ƨ¨¨¨¨¨¨¨̈̈
N times
both of length 2N . Let S DFTs and Y DFTy .
a) Show that S2m 2Xm , and S2m 1 0 , for m 0, ..., N 1;
b) Show that Y2m Xm for m 0, ..., N 1;
c) Determine an expression for Y2m 1 , k 0, ..., N 1 . Use the fact that yn snwn where w 1, ..., 1´¨¨¨¨̈ ¨¨¨̈≠ ƨ¨¨¨̈ ¨̈¨
N times, 0, ..., 0´¨¨¨¨̈ ¨̈ ¨̈≠ ƨ¨¨¨̈ ¨¨̈
N times is the rectangular sequence.
Solution
a) Sk n0
N1xnw2Nnk
n0
N1xnw2NnNk from the definition of sn . Now
consider that w2NNk ej22N2N 1 . Also consider that w2N ej22N wN 12 . Therefore
we obtain
Sk 1 1k n0
N1xnw2Nnk 0 if k is odd
2X k2 if k is even
b) Y2m n0
N1xnw2N2m n . But again w2N2 wN and therefore Y2m Xm , for
m 0, ..., N 1
c) Since clearly yn snwn for all n 0, ..., 2N 1 , we can use the property of the DFT which states
DFTsn wn 12N SkWkwhere Wk DFTwn
n0
N1w2Nnk 1w2NNk
1w2Nk . Therefore
12 Solutions_Chapter3[1].nb
Yk 12N m0
N1Xm Hk 2m2N
where we take into account the result in part a). ie S2m Xm and S2m 1 0 .
à Problem 3.13
Problem
A problem in many software packages is that you have access only to positive indexes. Suppose you want to determine the DFT of the sequence x 0, 1, 2, 3, 4
n0
, 5, 6, 7 with the zero index
as shown, and the DFT algorithm let you compute the DFT of a sequence like x0, ..., xN 1 , what do you do?
Solution
Since x is effectively a period of a periodic sequence, we determine the DFT of one period starting at n 0 , which yields
X DFT4, 5, 6, 7, 0, 1, 2, 3
à Problem 3.14
Problem
Let Xk DFTxn with n, k 0, ..., N 1 . Determine the relationships between Xk and the following DFT's:
a) DFTxnb) DFTxnNc) DFTRexnd) DFTImxne) apply all the above properties to the sequence x IDFT1, j, 2, 3j
Solution
a) DFTxn n0
N1xnwN
nk n0
N1xnwN
nk
XkN
b) DFTxnN n0
N1xnNwN
nk n0
N1xnwN
nk XkNc) DFTRexn 12 DFTxn 12 DFTxn 12 Xk 12 X
kN
Solutions_Chapter3[1].nb 13
d) DFTImxn 12j DFTxn 12j DFTxn 12j Xk 12j XkN
e) DFTxn 1, 3j, 2, jDFTxnN 1, 3j, 2, jDFTRexn 1, 2j, 2, 2jDFTImxn 0, 1, 0, 1
à Problem 3.15
Problem
Let xn IDFTXk for n, k 0, ..., N 1. Determine the relationship between xn and the following IDFT's:
a) IDFTXkb) IDFTXkNc) IDFTReXkd) IDFTImXke) apply all the above properties to the sequence Xk DFT1, 2j, j, 4j
Solution
a) IDFTXk 1N k0
N1XkwN
nk 1N k0
N1XkwN
nk
xnN
b) IDFTXkN 1N k0
N1XkNwN
nk 1N k0
N1XkwN
nk xnNc) IDFTReXk 12 IDFTXk 12 IDFTXk 12 xn 12 x
nNd) IDFTImXk
12j IDFTXk 12j IDFTXk 12j xn 12j xnN
e) IDFTXk 1, 4j, j, 2jIDFTXkN 1, 4j, j, 2jIDFTReXk 1, j, 0, jIDFTImXk 0, 3, 1, 3
14 Solutions_Chapter3[1].nb
à Problem 3.16
Problem
Let xn be an infinite sequence, periodic with period N . This sequence is the input to a BIBO stable LTI system with impulse response hn, n . Say how you can use the DFT to determine the output of the system.
Solution
Call x x0, ..., xN 1 one period of the signal, and let X DFTx . Then the whole
infinite sequence xn can be expressed as xn 1N k0
N1Xkej k2N n . Therefore the output
becomes
yn 1N k0
N1XkH k2N ej k2N n
We can see that the output sequence yn is also periodic, with the same period N given by
yn IDFTH k2N Xk , for n, k 0, ..., N 1
à Problem 3.17
Problem
Let xn be a periodic signal with one period given by 1, 2, 3
n0
, 4, 5, 6 with the zero
index as shown.
It is the input to a LTI system with impulse response hn 0.8n . Determine one period of the output sequence yn .
Solution
The input signal is periodic with period N = 6 and it can be written as
xn = 1ÅÅÅÅ6 Sk=0
5 X k e j k pÅÅÅÅÅ3 n , for all n ,
where
X k = DFT 3, -4, 5, -6, 1, -2 =-3.0, 3.0 + j 1.7321, -3.0 - j 5.1962, 21.0, -3.0 + j 5.1962, 3.0 - j 1.7321
The frequency response of the system is given by
Hw = DTFT 0.8n un + 1.25n u-n - 1 = ejwÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅejw-0.8 - ejw
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅejw-1.25
Solutions_Chapter3[1].nb 15
Therefore the response to the periodic signal xn becomes
yn = 1ÅÅÅÅ6 Sk=0
5 Hk X k e j k pÅÅÅÅÅ3 n , for all n ,
with
Hk = Hw w=kp3 = e j k pÅÅÅÅÅ3ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅe j k pÅÅÅÅÅ3 -0.8
- e j k pÅÅÅÅÅ3ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅe j k pÅÅÅÅÅ3 -1.25
, k = 0, ..., 5
Therefore one period of the output signal is determined as
yn = IDFT Hk X k , n = 0, ..., 5,
where
Hk = 9.0, 0.4286, 0.1475, 0.1111, 0.1475, 0.4286Computing the IDFT we obtain
yn = -3.8301, -4.6079, -3.8160, -5.4650, -4.6872, -4.5938 , n = 0, ..., 5
The DFT: Data Analysis
à Problem 3.18
Problem
A narrowband signal is sampled at 8kHz and we take the DFT of 16 points as follows. Determine the best estimate of the frequency of the sinusoid, its possible range of values and an estimate of the amplitude:
X 0.4889, 4.0267 j24.6698, 2.0054 j5.0782,1.8607 j2.8478, 1.8170 j1.8421, 1.7983 j1.2136,
1.7893 j0.7471, 1.7849 j0.3576, 1.7837, 1.7849 j0.3576 ,1.7893 j0.7471, 1.7983 j1.2136, 1.8170 j1.842,
1.8607 j2.8478, 2.0054 j5.0782, 4.0267 j24.6698
16 Solutions_Chapter3[1].nb
Solution
Looking at the DFT we see that there is a peak for k 1 and k 15 , withe the respective values being X1 4.0267 j24.6698, and X15 4.0267 j24.6698. The magnitude is X1 X15 25.0259. Therefore the frequency is within the interval k0 1 FsN F k0 1 FsN
with k0 1 . Fs 8kHz and N 16 . This yield an estimated frequency 0 F 2 816 kHz 1kHz .
à Problem 3.19
Problem
A real signal xt is sampled at 8kHz and we store 256 samples x0, ..., x255 . The magnitude of the DFT Xk has two sharp peaks at k 15 and k 241 . What can you say about the signal?
Solution
The signal has a dominant frequency component in the range 14 8256 F 16 8256 kHz, that is to say 0.4375kHz F 0.500kHz .
à Problem 3.21
Problem
We have seen in the theory that the frequency resolution with the DFT is F 2Fs N , with Fs the sampling frequency and N the data length. Since the lower F the better, by lowering the sampling frequency Fs , while keeping the data length N constant, we get arbitrary good resolution! Do you buy that? Why? or Why not?
Solution
It is true that by lowering the sampling frequency Fs and keeping the number of points N constant we improve the resolution. In fact by so doing the sampling interval Ts gets longer and we get a longer interval of data. However we cannot decrease the sampling frequency Fs indefinitely, since we have to keep it above twice the bandwidth of the signal to prevent aliasing.
Solutions_Chapter3[1].nb 17
à Problem 3.23
We want to plot the DTFT of a sequence which is not in the tables. Using the DFT and an increasing number of points sketch a plot of the DTFT (magnitude and phase) of each of the following sequences:
Solution
For every signal in this problem we need to take the DFT of the following sequence
xN = x0, ..., xN - 1, x-N, ..., x-1of length 2 N . In other words the first N points correspond to positive indexes, while the last N points correspond to negative indexes. By increasing the value of the parameter N we observe the conver-gence of the DFT.
a) xn 1n un 1The following figures show the DFT for different lengths N = 27, 29, 211 (magnitude and phase):
-3 -2 -1 0 1 2 30
5
10
-3 -2 -1 0 1 2 3
-2
0
2
N = 27
18 Solutions_Chapter3[1].nb
-3 -2 -1 0 1 2 30
5
10
-3 -2 -1 0 1 2 3
-2
0
2
N = 29
-3 -2 -1 0 1 2 3
-2
0
2
-3 -2 -1 0 1 2 30
5
10
N = 211
Notice that at w = 0 the DFT does not converge (the magnitude increases with N ) while it converges at all other frequencies. As a consequence, we can say that the DFT converges to the DTFT for all w ∫ 0. This is expected, since the signal xn is NOT absolutely summable.
Also notice the discontinuity in the phase at 0 .
b) xn 1n2 un 1
Solutions_Chapter3[1].nb 19
The following figures show the DFT for different lengths N = 27, 211 (magnitude and phase):
-3 -2 -1 0 1 2 30
0.5
1
1.5
2
-3 -2 -1 0 1 2 3
-2
0
2
N 27
-3 -2 -1 0 1 2 30
0.5
1
1.5
2
-3 -2 -1 0 1 2 3
-2
0
2
20 Solutions_Chapter3[1].nb
N 211
Notice that the DFT converges everywhere, as expected since the signal is absolutely summable.
c) xn 1n21
The following figures show the DFT for different lengths N = 27, 211 (magnitude and phase):
-3 -2 -1 0 1 2 30
1
2
3
4
-3 -2 -1 0 1 2 3
-2
0
2
N 27
-3 -2 -1 0 1 2 30
1
2
3
4
-3 -2 -1 0 1 2 3
-2
0
2
Solutions_Chapter3[1].nb 21
N 211
Notice that the DFT converges everywhere, as expected since the signal is absolutely summable.
d) xn 1n1
The following figures show the DFT for different lengths N = 27, 29, 211 (magnitude and phase):
-3 -2 -1 0 1 2 30
5
10
15
20
-3 -2 -1 0 1 2 3
-2
0
2
N 27
22 Solutions_Chapter3[1].nb
-3 -2 -1 0 1 2 30
5
10
15
20
-3 -2 -1 0 1 2 3
-2
0
2
N 29
-3 -2 -1 0 1 2 30
5
10
15
20
-3 -2 -1 0 1 2 3
-2
0
2
N 211
Solutions_Chapter3[1].nb 23
Notice that at w = 0 the DFT does not converge (the magnitude increases with N ) while it converges at all other frequencies. As a consequence, we can say that the DFT converges to the DTFT for all w ∫ 0. This is expected, since the signal xn is NOT absolutely summable.
Review Problems
à Problem 3.26
Problem.
In the system shown, let the continuous time signal xt have Fourier Transform as shown. Sketch X DTFTxn for the given sampling frequency.
Solution.
Recall that, for a sampled signal,
DTFTxn Fs k
XF kFs FFs2
with xn xnTs , and Ts 1Fs .
a) Fs 8kHz . Then clearly there is no aliasing, and therefore
5.335.3 3 85.48 5.4
)(FX)( sFFX )( sFFX
we can write
X FsXF FFs2 , for
In other words we just need to rescale the frequency axis (F 2FFs ) and the vertical axis (multiply by Fs ), as shown below. For the "delta" function recall that the value associated is not the amplitude but it is the area. This implies
F F0 FFs2 Fs2 0 2Fs 0
where 0 2F0 Fs .
24 Solutions_Chapter3[1].nb
8
7
)(X
4
3
4
38
7
000,8
44
b) Fs 6kHz . In this case the two "delta" functions are aliased, as shown below
3
k
skFFX )(
5.25.36
)(kHzF
(aliased)
The aliased frequency is at 6-3.5=2.5kHz. The DTFT of the sampled signal is then given in the figure below.
6
5
)(X
000,6
44
6
5
c) Fs 2kHz . In this case the whole signal is aliased, not only the narrowband component as in the previous case. In order to make the figure not too confusing, consider the parts of the signal separately.
For the "broadband" component of the signal, the repetition in frequency yields the following:
Solutions_Chapter3[1].nb 25
3 )(kHzF2 5411
Then summing all components we obtain the result shown. Just sum within one period (say 1kHz F 1kHz) and repeat periodically.
32
35
11
)(kHzF
k
skFFX )(
For the "narrowband" component (the two "delta" functions) we obtain the following:
5.3115.3
5.00.225.3 5.00.225.3
)(kHzF
2
5.10.25.3 5.10.25.3
Finally consider only the interval 1kHz F 1kHz, put the two together and properly rescale the axis (Fs the vertical axis, and 2Fs the horizontal axis) to obtain X:
26 Solutions_Chapter3[1].nb
3000,4
3000,10
2
2
)(X
à Problem 3.27
Problem.
The signal xt 3 cos2F1t 0.25 2 sin2F2t 0.3 has frequencies F1 3kHz and F2 4kHz . Determine the DTFT of the sampled sequence for the given sampling frequencies:
Solution.
The continuous time signal can be written in terms of complex exponentials as
xt 32 ej0.25ej2F1t 32 e
j0.25ej2F1t
jej0.3ej2F2t jej0.3ej2F2t
Therefore its Fourier Transform becomes
XF 32 ej0.25F F1 32 e
j0.25F F1 ej0.2F F2 ej0.2F F2
which is shown below.
)(kHzF3 44 3
)(FX25.0
23 je
25.023 je
2.0je2.0je
a) Fs 9kHz . In this case there is no aliasing, and it is just a matter of computing X FsXF FFs2 shown below.
Solutions_Chapter3[1].nb 27
3
2
9
89
8
)(X 25.03 je
2.02 je 2.02 je
3
2
25.03 je
b) Fs 7kHz . In this case there is aliasing as shown:
)(kHzF3 44 3
)(FX
25.023 je
25.023 je
2.0je2.0je
)( sFFX )( sFFX
2.0je25.0
23 je
25.023 je 2.0je
Summing the components within the interval 3.5kHz F 3.5kHz we obtain only two "delta" functions as
kXF kFs ej0.2 32 e
j0.25F 3, 000 ej0.2 32 e
j0.25F 3, 000Therefore
X 21.9285ej0.2477 67 21.9285ej0.2477 67 c) Fs 5kHz . The aliased components are computed from the figure below.
28 Solutions_Chapter3[1].nb
)(kHzF3 44 3
)(FX
25.023 je
25.023 je
2.0je2.0je
)( sFFX )( sFFX
2.0je
25.023 je
25.023 je
2.0je
1 22 1
Therefore within the interval 2.5kHz F 2.5kHz we can write
kXF kFs 32 e
j0.25F 2000 ej0.2F 1000 32 e
j0.25F 2000 ej0.2F 1000Therefore
X 3ej0.25 45 2ej0.2 25 3ej0.25 45 2ej0.2 25
for .
à Problem 3.28
Problem.
You want to compute the DCT of a finite set of data., but you have only the DFT. Can you still com-pute it?
Solution.
From the definition of DCT-II,
XIIk 2N Ck k0
N1xncos k2n12N
Expanding the cosine term we obtain
Solutions_Chapter3[1].nb 29
k0
N1xncos k2n12N 12 e
j k2N k0
N1xnejk 22N n 12 e
j k2N k0
N1xnejk 22N n
Now form the sequence
x0 x0, x1, ..., xN 1, 0, ..., 0of length 2N , zero padded with N zeros, and call X0k DFTx0n , for k 0, ..., 2N 1 . Then if the sequence xn is real it is easy to see that
k0
N1xncos k2n12N 12 Reej k2N X0k , k 0, ..., N 1
and therefore
XIIk 12NCkReej k2N X0k , k 0, ..., N 1 .
à Problem 3.29
Problem
In MATLAB generate the sequence xn = n - 64 for n = 0, ..., 127.
a) Let X k = DFT xn . For various values of L set to zero the "high frequency coefficients" X 64 - L 2 =. .. = X 64 + L 2 = 0 and take the IDFT. Plot the results;
b) Let XDCTk = DCT xn . For the same values of L set to zero the "high frequency coefficients" XDCT127 - L =. .. = X 127 = 0. Take the IDCT for each case, and compare the reconstruction with the previous case. Comment on the error.
Solution
a) Take L = 20, 30, 40 and set L coefficients of the DFT to zero, as X 64 - L 2 =. .. = X 64 + L 2 = 0 . Call XL
` k the DFT we obtain in this way, and x̀Ln = IDFT X` Lk . Notice that x̀Ln is still a real signal, since its DFT is still symmetric around the middle point.
Plots of x̀Ln for L = 20, 30, 40 show that x̀Ln is not a good approximation of xn . As expected the errors are concentrated at the edges of the signal.
30 Solutions_Chapter3[1].nb
b) Now let XDCTk = DCT xn and set L coefficients to zero, for L = 20, 30, 40, as XDCT127 - L =. .. = XDCT127 = 0. Notice that in this case a real signal always yields a real DCT and viceversa. This is due to the basis functions being "cosines" and not "complex exponentials" as in the DFT. As a consequence we do not have to worry about symmetry to keep the signal real, as we did for the DFT in a). The inverse DCT obtained for L = 20, 30, 40 are shown below. Notice that the error is very small compared to the signal itself, and it is not concentrated at any particular point.
Solutions_Chapter3[1].nb 31
The DFT and Linear Algebra
à Problem 3.30
Problem.
An N ä N circulant matrix A is of the form
A =
a0 a1 ... aN - 1aN - 1 a0 ... aN - 2
ª ∏ ∏ ªa1 ... aN - 1 a0
Then, do the following:
32 Solutions_Chapter3[1].nb
Solution.
a) Verify that Ak, n = an - kN , for n, k = 0, ..., N - 1.
Easy, by inspection. Just notice that the first row (k = 0) is the sequence a0, ..., aN - 1 , and the k - th row is the first row circularly shifted by k .
b) Verify that the eigenvectors are always given by ek = 1, wNk , wN
2 k, ..., wNN-1 kT
, with k = 0, ..., N - 1 and wN = e-j2pN
By multiplying the matrix A by each vector ek we obtain the k -th component of the DFT of each row. Since the k -th row is obtained by circularly shifting the first row k times, the DFT of the k - th row is DFT an - kN = wN
k X k , where X k = DFT an is the DFT of the first row. Therefore
A ek =
X kwN
k X kª
wNN-1 k X k
= X k ek
which shows that ek is an eigenvector, and X k is the corresponding eigenvalue.
c) Determine a factorization A = E L E*T with L diagonal and E*T E = I .
"Pack" all eigenvectors e0, ..., eN-1 in an N ä N matrix E as
Eêêê
= e0, e1, ..., eN-1First notice that E
êêê *T Eêêê
= N since
ek*T em = 0 if k ∫ m
N if k = m
Then the matrix
E = 1ÅÅÅÅÅÅÅÅÅÅÅN
Eêêê
= 1ÅÅÅÅÅÅÅÅÅÅÅN
e0, e1, ..., eN-1is such that E*T E = I .
Then use the fact that the vectors ek are eigenvectors, to obtain
A E = A 1ÅÅÅÅÅÅÅÅÅÅÅN
e0, e1, ..., eN-1 = 1ÅÅÅÅÅÅÅÅÅÅÅN
e0, e1, ..., eN-1
X 0 0 ... 00 X 1 ∏ 00 ∏ ∏ 00 0 ... X N - 1
which can be written as
A E = E L
with L = diagX 0, ..., X N - 1 . Since E-1 = E*T we obtain the desired decomposition
Solutions_Chapter3[1].nb 33
A = E L E*T
d) Let hn and xn be two sequences of equal length N , and yn = hn ≈ xn be the circular convo-lution between the two sequences. Show that you can write the vector y = y0, ..., yN - 1T in terms of the product y = H x where x = x0, ..., xN - 1T and H circulant. Show how to determine the matrix H .
From the definition of circular convolution
yn = Sk=0
N-1 hn - kN xk = S
k=0
N-1 Hk, n xk
Therefore
y = HT x
with H being circulant.
e) By writing the DFT in matrix form, and using the factorization of the matrix H , show that Y k = Hk X k , for k = 0, ..., N - 1, with X , H , Y being the DFT's of x, h, y respectively.
Decomposing the circulant matrix we obtain HT = E L E*T T = E* L ET and therefore
y = E* L ET x
Multiplying on the left by ET we obtain
ET y = L ET x
where L = H0, ..., HN - 1 . Now
ET y = 1ÅÅÅÅÅÅÅÅÅÅÅN
e0T
e1T
ªeN-1
T
y = 1ÅÅÅÅÅÅÅÅÅÅÅ
N
Y 0Y 1ª
Y N - 1
, and ET x = 1ÅÅÅÅÅÅÅÅÅÅÅ
N
e0T
e1T
ªeN-1
T
x = 1ÅÅÅÅÅÅÅÅÅÅÅ
N
X 0X 1ª
X N - 1
where X k = DFT xn and Y k = DFT yn . Therefore, since L = diagH0, ..., H N - 1 we obtain
Y k = Hk X k , for k = 0, ..., N - 1
34 Solutions_Chapter3[1].nb
Top Related