Digital Signal Processing Reference
In-Depth Information
1
1
0
0
−1
−1
0
10
20
30
0
10
20
30
(a) Sample
(b) Bin
1
1
0
0
−1
−1
0
10
20
30
0
10
20
30
(c) Sample
(d) Bin
1
1
0
0.5
−1
0
0
10
20
30
0
10
20
30
(e) Sample
(f) Bin
Figure 3.12: (a) and (c): Real and Imaginary correlators for Bin 1, i.e., one cycle (over 32 samples) cosine
and sine, respectively; (b) and (d): Real and Imaginary parts of DFT for waveform at (a) and (c), initialized
to zero with Bins 0 and 1 plotted; (e) Truncated square wave serving as test signal; (f ) Magnitude of
DFT, based on real and imaginary parts plotted in (b) and (d).
In Fig. 3.13, we see the final result for performing the DFT on the truncated square wave. There
are a number of things to observe. First, the square wave is an odd function, and is made of a series of
odd harmonics with amplitudes inversely proportional to the harmonic number. Hence, the real part of
the DFT is zero.
Let's analyze the lower right plot of Fig. 3.13, which is the magnitude of the DFT.
Bin 1 (the fundamental) should have an amplitude of 1, Bin 2 should be zero (it's an even harmonic),
Bin 3 should be 0.33, and so forth. Note instead that the values are half this since both positive and negative
frequency bins with the same magnitude of k contribute to the reconstructed waveform when using the
inverse DFT. Hence, when we add Bins 1 and 31 together, we get the required magnitude of 1 for the
first harmonic ( k = 1), 0.33 for the 3rd harmonic, 0.2 for the 5th, harmonic, etc. (later in the chapter
we'll demonstrate the truth of this mathematically in a more detailed discussion of the IDFT). Recall
that Bin 31 is the equivalent of Bin -1 when k runs from 0 to N
1. Recall that for all Bins of the Real
DFT (other than Bins 0 and N/ 2), it was necessary to double the values of the reconstructed harmonics
since only positive frequencies were used in the original set of correlations. From this it can be seen that
 
Search WWH ::




Custom Search