Interpretation of DFT Results

3.7 Interpretation of DFT Results

In general, the DFT takes a complex-valued sequence {x[n], n = 0 : N − 1} and produces another complex-valued sequence {X(k), k = 0 : N − 1}. Then, what is the physical meaning or practical usage of it? To understand it, let us take some examples where we think of a discrete sequence x[n] as the discrete-time version of an analog signal x(t ) such that x[n] = x(nT ).

Example 3.16 DFT Spectrum of a Single-Tone Sinusoidal Wave [L-1] Suppose we have a continuous-time signal

4 Let us use the MATLAB function “ fft()” to find the DFT spectrum of {x[n] =

x (nT ), n = 0 : N −1} with different sampling interval T and DFT size or number of sample points N . Then we will discuss how we can read the frequency information about x(t ) from the DFT spectrum, which has different shape depending on the sampling interval T and DFT size N .

(a) Let the sampling interval and number of samples (DFT size) be T = 0.1 and N = 16, respectively so that the discrete-time sequence will be

x a [n] = cos

4 t =nT =0.1n = cos 8 n = 0, 1, · · · , 15 (E3.16.2)

The magnitude spectrum of this sequence, i.e., the magnitude of X a (k) = DFT 16 {x a [n]} is depicted in Fig. 3.17(a). It has a spike at the frequency index k = 3 corresponding to the digital and analog frequencies as

[rad/sample]

[rad/s] (E3.16.3)

This analog frequency agrees exactly with the real frequency of the original signal (E3.16.1). Note that |X a (k)| has another spike at the frequency index

k = 13, which virtually corresponds to k = 13 − N = −3, but it is just like the

3.7 Interpretation of DFT Results 171 1 x 1 [n]

(a) T = 0.1, N = 16 (b) T = 0.05, N = 16 (faster and shorter) 8

0 4 8 12 15 0 4 8 12 15 k Picket Fense Effect

Spectral Leakage

(c) T = 0.05, N = 32 (faster sampling) (d) T = 0.1, N = 32 (longer interval) 16 16 X (k )

10 2 X π c (k ) : DFT d 10 Ω 0 =

: DFT N

: DTFT : DTFT

0 0 8 16 24 31 k Fig. 3.17 DFT spectra of discrete-time sinusoidal sequences having a single tone

0 0 8 16 24 31 k

mirror image of k = 3. It can be assured by writing the discrete-time sequence (E3.16.2) as

j [n] = 3π n/8 +e − j 3π n/8

IDFT (3.4.3) 1 j 2π 3 n/N

e (E3.16.4) N

1 j 2π 3 n/16

+8e

j 2π (13) n/16

This explains why the magnitude of the DFT spectrum has two spikes of 8 at k = 3 and N − 3 = 13.

(b) Let the sampling interval and number of samples (DFT size) be T = 0.05 (up-sampling) and N = 16, respectively so that the discrete-time sequence will be

x b [n] = cos

4 = cos

16 n = 0, 1, · · · , 15 (E3.16.5)

t =nT =0.05n

The magnitude spectrum of this sequence, i.e., the magnitude of X b (k) = DFT 16 {x b [n]} is depicted in Fig. 3.17(b), which looks quite different from

172 3 Discrete-Time Fourier Analysis Fig. 3.17(a). That is, so many nonzero values show up here and there in the

magnitude spectrum, though the highest two values occur at k = 1 and 2. It is because the picket fence effect (due to the frequency domain sampling of DFT)

hides the spectral peak, allowing the many side lobes (resulting from the spec- tral leakage due to the time domain windowing) to be seen. This is a contrast to the other cases where the picket fence effect coincidentally hides the side lobes except the main peak as if by magic. Still we might fake a “far-fetched” story about the frequency corresponding to k = 1.5 (between 1 and 2) as

[rad/sample]

[rad/s] (E3.16.6)

This agrees with the result of (a), showing the right frequency information. (c) Let the sampling interval and DFT size be T = 0.05 (up-sampling) and N = 32

(more sampling), respectively so that the discrete-time sequence will be

x c [n] = cos

4 t =nT =0.05n = cos 16

π n , n = 0, 1, · · · , 31

(E3.16.7) The magnitude spectrum of this sequence, i.e., the magnitude of X c (k) =

DFT 32 {x c [n]} is depicted in Fig. 3.17(c). Like Fig. 3.17(a), it has two spikes at k = 3 and N − 3 = 29 with only a difference in their amplitude (16), which

is two times as large as those in (a) because of the increased number of samples (N = 32). Thus we can read the digital and analog frequencies as

[rad/sample]

[rad/s] (E3.16.8)

This analog frequency also agrees exactly with the real frequency of the original signal (E3.16.1).

(d) Let the sampling interval and DFT size be T = 0.1 and N = 32 (longer interval/more sampling), respectively so that the discrete-time sequence will be

x d [n] = cos

= cos

8 n = 0, 1, · · · , 31 (E3.16.9)

4 t =nT =0.1n

The magnitude spectrum of this sequence, i.e., the magnitude of X d (k) = DFT 32 {x d [n]} is depicted in Fig. 3.17(d). It has two spikes at k = 6 and N − 6 = 26, which tells us about the existence of the digital and analog

3.7 Interpretation of DFT Results 173 frequencies as

Ω 6 = 6Ω 0 =6 [rad/sample]

[rad/s] (E3.16.10)

This analog frequency also agrees exactly with the real frequency of the original signal (E3.16.1).

Example 3.17 DFT Spectrum of a Multi-Tone Sinusoidal Wave Suppose we have a continuous-time signal

x (t ) = sin(ω 1 t ) + 0.5 cos(ω 2 t ) = sin(1.5πt) + 0.5 cos(3πt) (E3.17.1)

with ω 1 = 1.5π and ω 2 = 3π

Figure 3.18 shows the four different discrete-time versions of this signal and their DFT spectra, which will be discussed below.

(a) With sampling interval T = 0.1 and DFT size N = 32, the discrete-time sequence will be

x a [n] = x(nT )| T =0.1 = sin(0.15πn) + 0.5 cos(0.3πn), n = 0, 1, · · · , 31 (E3.17.2)

The magnitude spectrum depicted in Fig. 3.18(a) is large at k = 2 & 3 and 4 &

5 and they can be alleged to represent two tones, one between kω 0 = kΩ 0 / T=

2π k/N T = 2πk/3.2 k=3 = 1.25 π and kω

k=2

0 = 1.875 π and the other between

0 = 2.5 π and kω 0 = 3.125 π. Of these two tones, the former corresponds to ω 1 = 1.5π (with larger amplitude) and the latter to ω 2 = 3π (with smaller amplitude). (b) With shorter sampling interval T = 0.05 (up-sampling) and larger DFT size N = 64, the discrete-time sequence will be

kω k=5

k=4

x b [n] = x(nT )| T =0.05 = sin(0.075πn) + 0.5 cos (0.15πn), (E3.17.3) n = 0, 1, · · · , 63 For all the up-sampling by a factor of 2, the magnitude spectrum depicted in

Fig. 3.18(b) does not present us with any more information than (a). Why? Because all the frequency components (ω 1 = 1.5π and ω 2 = 3π) are already covered within the principal analog frequency range [−π/T, π/T ] with T = 0.1, there is nothing to gain by expanding it via shorter sampling interval.

174 3 Discrete-Time Fourier Analysis

0 10 20 30 0 10 20 30 40 50 60 (a) T = 0.1, N = 32

(b) T = 0.05, N = 64 (faster sampling)

0 10 20 30 40 50 60 0 10 20 30 40 50 60 (c) T = 0.1, N = 64 (zero-padding)

(d) T = 0.1, N = 64 (longer interval)

20 30 40 50 60 Fig. 3.18 DFT spectra of a two-tone sinusoidal wave

(c) With the same sampling interval T = 0.1, but with larger DFT size N = 64 (by zero-padding), the discrete-time sequence will be

0 for n = 32, · · · , 63 The magnitude spectrum depicted in Fig. 3.18(c) is large at k = 4 & 5 and

9 & 10 and they can be alleged to represent two tones, one between kω 0 =

kΩ k=5

0 / T = 2πk/N T = 2πk/6.4 = 1.25 π and kω 0 = 1.5625 π and the other between kω k=9

k=4

0 = 2.8125 π and kω 0 = 3.125 π. Comparing this with the result obtained in (a), we see that larger DFT size by zero-padding can yield better resolution for the spectrum.

k=10

(d) With the same sampling interval T = 0.1, but with larger DFT size N = 64 (by more sampling), the discrete-time sequence will be

x d [n] = x(nT )| T =0.1 = sin(0.15πn) + 0.5 cos(0.3πn), n = 0, 1, · · · , 63 (E3.17.5)

3.7 Interpretation of DFT Results 175 The magnitude spectrum depicted in Fig. 3.18(d) is strikingly large at k = 5

and 10, which can be alleged to represent two tones of kω 0 = 2πk/N T = 2π k/6.4 k=5

0 = 3.125 π. Comparing this with the result obtained in (a), we see that larger DFT size by more sampling can improve the spectrum resolution. Comparing this with (c), we see that more sampling can yield better resolution than zero-padding as it collects more information about the signal.

= 1.5625 π and kω k=10

Example 3.18 DFT Spectrum of a Triangular Pulse Consider the following sequences that are obtained by sampling the continuous- time triangular wave ˜x 8 (t ) = 2(˜λ 2 (t ) − ˜λ 2 (t − 4)) of period 8 and with peak-to- peak range between −2 and +2. Let us consider the DFT magnitude spectra of the sequences that are depicted in Fig. 3.18.

(a) With sampling interval T = 1 and DFT size N = 8, the discrete-time sequence will be

x a [n] = ˜x 8 (nT ) | T =1 , n = 0, 1, · · · , 7 (E3.18.1) The 8-point DFT magnitude spectrum of x a [n] together with the CTFT mag-

nitude spectrum of the single-period triangular pulse x 8 (t ) (Eq. (E3.11.3)) is depicted in Fig. 3.19(a). (b) With shorter sampling interval T = 0.5 (up-sampling) and larger DFT size N = 16, the discrete-time sequence will be

x b [n] = ˜x 8 (nT ) | T =0.5 , n = 0, 1, · · · , 15 (E3.18.2) The 16-point DFT magnitude spectrum of x b [n] together with the CTFT magni-

tude spectrum of the single-period triangular pulse x 8 (t ) is depicted in Fig. 3.19(b). It shows that the DFT is similar to the CTFT for the expanded principal analog frequency range [−π/T, π/T ].

(cf.) Note that to be compared with the DFT, the CTFT spectrum has been scaled not only vertically in consideration for the sampling interval T (Eq. (3.5.7) or Remark 3.7(2)) and the number of sample points, but also horizontally in consideration for the relationship between the digital frequency Ω and analog frequency ω = Ω/T .

(c) With the same sampling interval T = 1, but with larger DFT size N = 16 (by zero-padding), the discrete-time sequence will be

x a [n] for n = 0, 1, · · · , 7

x c [n] =

(E3.18.3)

0 for n = 8, · · · , 15

176 3 Discrete-Time Fourier Analysis

2 More sampling 8 x b [n] c x d [n]

0 0 2 4 6 t 0 0 2 4 6 t 0 Zero-padding x a [n] 0 4 8 12 t 0 0 4 8 12 t –2

(b) T = 0.5, N = 16

DTFT 5 10 DFT 10 5 CTFT X a (k)

2 More sampling Zero-insertion

2 2 Down-sampling 2

x f [n]

& Zero - padding 0 0 2 4 6 0 t & Zero-padding 0 2 6 t 0

Down-sampling 4 0 4 8 12 t 0 0 4 8 12 –2 t x e [n] –2 –2 x g [n] –2 x h [n] (e) T = 0.5, N = 16

(f) T = 2, N = 4

(g) T = 2, N = 8

(h) T = 1, N = 16 5 5 Spectal leakage

Fig. 3.19 DFT spectra of various discrete-time versions of a triangular wave

Figure 3.19(c) shows that the DFT becomes closer to the DTFT spectrum, while it has the same principal analog frequency range for which it is similar to the CTFT.

(d) With the same sampling interval T = 1, but with larger DFT size N = 16 (by more sampling), the discrete-time sequence will be

for n = 0, 1, · · · , 7 x d [n] =

x a [n]

(E3.18.4) x a [n − 8] for n = 8, · · · , 15

Figure 3.19(d) shows that we gained nothing with more sampling and larger DFT size in contrast with the case of Example 3.17(d). However, we lost nothing with more sampling.

(e) With larger DFT size N = 16 by zero-insertion, i.e., inserting one zero between the samples, the discrete-time sequence will be

a [n/2] for n = 0, 2, · · · , 14 (even) x e [n] =

(E3.18.5)

0 for n = 1, 3, · · · , 15 (odd) Figure 3.19(e) shows that zero-insertion results in the periodic extension of

the DFT spectrum. This has an interpretation that zero-insertion increases the variation rate of the signal, producing the high frequency components.

(f) With longer sampling interval T = 2 (down-sampling or subsampling) and smaller DFT size N = 4, the discrete-time sequence will be

x f [n] = x a [2n], n = 0, 1, · · · , 3 (E3.18.6)

3.7 Interpretation of DFT Results 177 Figure 3.19(f) shows that down-sampling compresses the principal analog

frequency range and besides, smaller DFT size harms the spectrum resolution. (g) With longer sampling interval T = 2 (down-sampling or subsampling), but

with the same DFT size N = 8 (by zero-padding), the discrete-time sequence will be

0 for n = 4, 5, · · · , 7 Figure 3.19(g) shows that zero-padding may help the spectrum to look better,

but it does not recover the spectrum damaged by down-sampling. (h) With the same sampling interval T = 1, but with larger DFT size N = 16

(by more sampling partly and zero-padding partly), the discrete-time sequence will be

0 for n = 12, · · · , 15 Figure 3.19(h) shows that zero-padding may help the spectrum to look better

compared with (d). Remark 3.10 DFS/DFT (Discrete Fourier Series/Transform) and Spectral

Leakage (1) Generally, the DFT X (k) is complex-valued and denotes the magnitude &

phase of the signal component having the digital frequency Ω k = kΩ 0 = 2π k/N [rad/sample], which corresponds to the analog frequency ω k = kω 0 =

kΩ 0 / T = 2πk/N T [rad/s]. We call Ω 0 = 2π/N and ω 0 =Ω 0 / T (N : DFT size) the digital/analog fundamental or resolution frequency since it is the minimum digital/analog frequency difference that can be distinguished by the N -point DFT. Note that the frequency indices k = 0 and N/2 represent the DC component (Ω = 0) and the virtually highest digital frequency component

(Ω N/ 2 = N/2 × 2π/N = π), respectively. (2) As illustrated in Figs. 3.17(b) and 3.18(a)-(d), if a periodic signal does not go through a multiple of periods within the sampled signal range [0, N T ), its DFT spectrum is dirty. This is because the spectral leakage is not hidden by the picket fence effect. It seems that we might avoid this problem by setting the sampled signal range so that it covers exactly a multiple of the period of the signal. However, it is only our desire because we hardly know in advance the frequency contents of the signal and besides, most signals have many frequency components.

(3) The spectral leakage problem is always in the midst of DFT because it is inherently due to the time-domain windowing as can be observed in the DTFT spectrum of Fig. 3.5(b3). Then, how could the DFT spectra of Figs. 3.17(a), (c), and (d) be free from the spectral leakage? The fact is that we could not

178 3 Discrete-Time Fourier Analysis see the existing spectral leakage (as shown by the DTFT spectrum plotted in

dotted lines) because the picket fence effect [D-1] of DFT (attributed to the frequency-domain sampling of DTFT) coincidentally happens to hide the many side lobe ripples except the main peaks.

(4) From another point of view, we might put the responsibility for spectral leakage on the assumption of DFT that every signal is periodic with period equal to the DFT size, which is hard to be true. As a measure to alleviate the spectral leakage problem, there is a smooth windowing technique [W-1] that can reduce the “faked” abrupt change of the signal (at both ends of the signal range) caused by the rectangular windowing. Interested readers can see Problem 3.14.

Through the examples given above, we have already observed how the DFT spec- trum is affected by the sampling interval, DFT size, zero-padding, and so on. The observations are summarized as follows:

Remark 3.11 The Effects of Sampling Period (Interval) T and DFT Size N on DFT

(1) Shorter sampling interval expands the principal analog frequency range [−π/T, π/T ] so that it can help higher frequency components to be reflected

on the DFT spectrum if every frequency component is not covered within the present principal analog frequency range.

(2) Larger DFT size (by zero-padding or more sampling) may help the (discrete) DFT spectrum to become closer to the (continuous) DTFT spectrum and that with better frequency resolution.