01.05.2017 Views

563489578934

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Sec. 2–8 Discrete Fourier Transform 101<br />

samples is obtained. Second, the DFT and the IDFT are periodic with periods f s = 1/¢t<br />

and T, respectively. The parameters ¢ t, T, and N are selected with the following considerations<br />

in mind:<br />

• ∆t is selected to satisfy the Nyquist sampling condition, f s = 1/¢t 7 2B, where B is<br />

the highest frequency in the waveform. ¢ t is the time between samples and is called the<br />

time resolution as well. Also, t = k¢t.<br />

• T is selected to give the desired frequency resolution, where the frequency resolution is<br />

¢f = 1/T. Also, f = n/T.<br />

• N is the number of data points and is determined by N = T/¢t.<br />

N depends on the values used for ¢ t and T. The computation time increases as N is increased. †<br />

The N-point DFT gives the spectra of N frequencies over the frequency interval (0, f s ) where<br />

f s = 1/¢t = N/T. Half of this frequency interval represents positive frequencies and half represents<br />

negative frequencies, as described by Eq. (2–184). This is illustrated in the following<br />

example.<br />

Example 2–20 USING THE FFT TO CALCULATE SPECTRA<br />

Using the FFT, Eq. (2–178), evaluate the magnitude spectrum and the phase spectrum for a rectangular<br />

pulse. See Example2_20.m for the solution. Table 2–3 lists this MATLAB file. The computed<br />

results are shown in Fig. 2–21. Note that Eqs. (2–178) and (2–183) are used to relate the FFT<br />

results to the spectrum (i.e., the Continuous Fourier Transform). The parameters M, tend, and T<br />

are selected so that the computed magnitude and phase-spectral results match the true spectrum of<br />

the rectangular pulse as given by Eqs. (2–59) and (2–60) of Example 2–6. (T in Example 2–6 is<br />

equivalent to tend in Table 2–3.)<br />

The rectangular pulse is not absolutely bandlimited. However, for a pulse width of<br />

tend = 1, the magnitude spectrum becomes relatively small at 5/tend = 5Hz = B. Thus, we<br />

need to sample the waveform at a rate of 2B = 10 Hz or greater. For T = 10 and N = 128,<br />

¢t = 0.08 or f s = 1/¢t = 12.8 Hz. Therefore, the values of T and N have been selected to satisfy<br />

the Nyquist rate of f s 7 2B. The frequency resolution is ¢f = 1/T = 0.1 Hz.<br />

Consequently, a good spectral representation is obtained by using the FFT.<br />

In the bottom plot of Fig. 2–21, the magnitude spectrum is shown over the whole range<br />

of the FFT vector—that is, for 0 6 f 6 f s , where f s = 12.8 Hz. Because Eq. (2–184b) was<br />

not used in the MATLAB program, the plot for 0 6 f 6 6.8 (f s /2 = 6.8 Hz) corresponds to<br />

the magnitude spectrum of the CFT over positive frequencies, and the plot for<br />

6.4 6 f 6 12.8 corresponds to the negative frequencies of the CFT. The reader should try<br />

other values of M, tend, and T to see how leakage, aliasing, and picket-fence errors become<br />

large if the parameters are not carefully selected. Also, note that significant errors occur if<br />

tend = T. Why?<br />

† The fast Fourier transform (FFT) algorithms are fast ways of computing the DFT. The number of complex<br />

multiplications required for the DFT is N 2 , whereas the FFT (with N selected to be a power of 2) requires only (N/2)<br />

log 2 N complex multiplications. Thus, the FFT provides an improvement factor of 2N/(log 2 N) compared with the<br />

DFT, which gives an improvement of 113.8 for an N = 512 point FFT.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!