The material in this eBook also appears in the print version of this title: 0-07-144492-0.

All trademarks are trademarks of their respective owners. Rather than put a trademark symbol after everyoccurrence of a trademarked name, we use names in an editorial fashion only, and to the benefit of thetrademark owner, with no intention of infringement of the trademark. Where such designations appear in thisbook, they have been printed with initial caps. McGraw-Hill eBooks are available at special quantity discountsto use as premiums and sales promotions, or for use in corporate training programs. For more information,please contact George Hoare, Special Sales, at george_hoare@mcgraw-hill.com or (212) 904-4069.

TERMS OF USE

This is a copyrighted work and The McGraw-Hill Companies, Inc. (“McGraw-Hill”) and its licensors reserve allrights in and to the work. Use of this work is subject to these terms. Except as permitted under the CopyrightAct of 1976 and the right to store and retrieve one copy of the work, you may not decompile, disassemble,reverse engineer, reproduce, modify, create derivative works based upon, transmit, distribute, disseminate, sell,publish or sublicense the work or any part of it without McGraw-Hill’s prior consent. You may use the work foryour own noncommercial and personal use; any other use of the work is strictly prohibited. Your right to use thework may be terminated if you fail to comply with these terms.

THE WORK IS PROVIDED “AS IS.” McGRAW-HILL AND ITS LICENSORS MAKE NO GUARANTEESOR WARRANTIES AS TO THE ACCURACY, ADEQUACY OR COMPLETENESS OF OR RESULTS TOBE OBTAINED FROM USING THE WORK, INCLUDING ANY INFORMATION THAT CAN BEACCESSED THROUGH THE WORK VIA HYPERLINK OR OTHERWISE, AND EXPRESSLY DISCLAIMANY WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIEDWARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. McGraw-Hilland its licensors do not warrant or guarantee that the functions contained in the work will meet yourrequirements or that its operation will be uninterrupted or error free. Neither McGraw-Hill nor its licensors shallbe liable to you or anyone else for any inaccuracy, error or omission, regardless of cause, in the work or for anydamages resulting therefrom. McGraw-Hill has no responsibility for the content of any information accessedthrough the work. Under no circumstances shall McGraw-Hill and/or its licensors be liable for any indirect,incidental, special, punitive, consequential or similar damages that result from the use of or inability to use thework, even if any of them has been advised of the possibility of such damages. This limitation of liability shallapply to any claim or cause whatsoever whether such claim or cause arises in contract, tort or otherwise.

Spectral Analysis 43the frequency spacing between successive samples of the DFT to be(3.2)Using Eq. (3.2), we can easily generate the frequency axis for our plottedspectrum in AdvFFT. The VI shown in Fig. 3.4 is called FreqAxis.vi and its onlyfunction is to generate the frequency axis values based on the spacing betweensamples given in Eq. (3.2). The inputs are N (the number of samples), fs(thesample rate), and a Boolean to determine whether to generate a single-sided ortwo-sided frequency axis.With the addition of the FreqAxis VI, the final block diagram for AdvFFT.viis shown in Fig. 3.5. The signal spectrum plot is changed from a waveformgraph to an XY graph in order to accommodate the two-axis inputs. Now if weedit the connector pane to tie complex input, real input, sample rate, and forceFFT to the input terminals and signal spectrum to one of the output terminalswe can use AdvFFT in other applications as a sub-VI.3.2 Analyzing the DFT ResultsJust as important as being able to use the DFT is being able to understand theresults that you get. Earlier, I mentioned that any spectral components of the inputsignal x(n), not precisely at one of the N DFT frequency bin centers, will not beproperly accounted for in the DFT computation. The interesting things aboutany spectral component away from the bin center frequency are: (1) that compo-nent’s amplitude will not be correctly accounted for because of the shape of thesampling window at that DFT bin, known as scalloping loss and (2) there will beenergy from that component in all other DFT bins, known as spectral leakage [2].Let’s take these two astounding facts one at a time starting with the latter.∆ffNs= Hz44 Chapter ThreeFigure 3.4FreqAxis.vi generates the frequency axis based on Eq. (3.2).Figure 3.5Final form for advFFT.vi.453.2.1 Spectral leakageSpectral leakage is a term used to describe the phenomenon of energy from oneDFT bin leaking into another DFT bin (or more generally into many other DFTbins). Leakage happens because of the lack of orthogonality between some fre-quency components in our signal and the set of basis vectors in the DFT [2]. TheDFT is essentially a computation of the projection of the input signal x(n) ontothe orthogonal DFT basis set made up of the sines and cosines at Ndiscrete fre-quency values evenly spaced from 0 to fs. It turns out that the projection of anyspectral component of x(n) not exactly at one of those N discrete frequencyvalues in the DFT basis set will have nonzero projections on all frequency valuesin the basis set [2]. This all means that unless we do something to reduce thespectral content of x(n) at non-DFT bin center frequencies, the results of theentire DFT calculation could be grossly inaccurate. And the way we reduce anypart of spectral content of a signal is to use a filter. Interestingly, there is a classof filters commonly used for just this purpose known as windowing functions.The following section discusses exactly what is meant by windowing.3.2.2 Sampling window shapeYou might be saying to yourself, “What sampling window?” And the truth is thateven no sampling window is a sampling window. What is important here is that