Top Banner

of 10

A Comprehensive Windows Tutorial

Jun 01, 2018

Download

Documents

sekharsamy
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 8/9/2019 A Comprehensive Windows Tutorial

    1/10

    -0.2 000 5 00

    1.4 -

    1.8

    1.6

    1.0

    0.8

    0.6

    0.4

    0.2

    BoxcarHanning -Hamming -Kaiser Bessel-GaussFa top

    Com prehensive Window s TutorialHoward A. Gaberson Oxnard, California

    This article is a tutorial attempt to provide an easier analy-sis of how windows work. I begin by looking at individualspectrum bins as affected by off-bin-centered tones with sixdifferent windows. I define and use the convolution theoremto explain why the windows do what they do. I review the so-phisticated misunderstood fat-center-peaked, picket-fence-

    looking FFTs of various windows that come from adding ze-ros to increase. resolution. I then use these drawings in astep-by-step graphical convolution to show how this or thatwindow will affect the FFT of your data. This is a procedureto demonstrate how any oddly shaped, even graphically de-fined, window affects data. These techniques are tools to al-low you to invent a graphical window to affect data in newways. To demonstrate how to use graphically defined win-dows, I use digitized drawings of a Hawaiian mountain andthe popular cartoon beagle as windows. To use these windows,I demonstrate FFT-IFFT interpolation and resampling, whichin itself is interesting. Finally, I compare how eight windowsaffect the spectrum of typical vibration data.

    We need a window for vibration spectrum analysis becausethe beginning does not match the end of the data segment weare analyzing and because we virtually never have an integernumber of periods of any cyclic information in the signal seg-ment/chunk. The discrete Fourier transform (DFT) analysis isreally a Fourier series expansion of whatever segment we in-put. It is considered periodic. Mismatched ends and nonintegernumbers of periods garbles the result. Windows somewhat al-leviate that garbling but in a complicated way.

    Windows are shapes - like a hill, a hump in the center, andthey go to zero at the ends. When you multiply these windowshapes term by term with a segment of data, you force the endsof the data segment to zero, so at least the ends match the be-ginning. You cannot really fix the noninteger number of peri-ods. Figure 1 shows a w indow application. In Figure la we havea 1,024 value plotted list of acceleration data; in Figure lb, a1024 value Hanning window plotted for the same time values.Figure lc shows the product of the two. The beginning and endscertainly match.

    I am sure there are more than 100 windows described in theliterature. Figure 2, shows six of them that I happen to use andwill illustrate here: boxcar (or uniform), Hanning, Hamming,Gaussian, Kaiser Bessel, and flat-top this is very different fromthe boxcar or uniform window). Signal analyzers frequentlyoffer five or six to choose from, with variably helpful discus-sions of when to use each. Hanning is the most widely recom-mended. Reference 1 gives 44 and R eference 2 gives eight more;these might be the m ost widely referenced windows papers, butthese authors hadn't yet heard of the flat-top. Ron Potter 3 givesabout five windows and is famous for an unpublished HP pub-lication. Potter did have a flat-top in there. Finally, the vener-able Briiel Kjxr Technical Review published the first fully

    disclosed flat-top window and a nice version of the KaiserBessel window. 4 5These two publications are downloadablefrom the B K web site. I read a papers from the 2004 Interna-tional Modal Analysis Conference where the investigator wasworking on keeping the side lobes extremely low because ofall the new high-resolution, 24-bit, data-collecting hardware.If you really want to dig into things, Harris 7 wrote a difficult64-page article with excellent drawings that I recommend.

    Defining the Bin-Centered ConceptNon-bin centered or not, an integer number of periods or

    cycles in the analyzed data segment is the topic to start with.A sine wave component of our signal is bin centered if it hasan integer number of periods in the data segment being ana-

    0.4

    0.2

    0

    -0.2

    a

    0.400.05 l .15 .2 .25

    to

    10.5

    0

    b

    0 .05 .1 .15 .2 .25

    0.4

    0.2c erm by term product of top tgure data with m iddle f igure windod

    -0.2

    -0.40 .05 .1 .15 .2 .25

    l ime sec

    Figure 1. This shows a 1,024-point Hanning window applied to 1,024-point chunk of air handler acceleration.

    Figure 2. Six common window shapes.

    lyzed, which almost never happens without planning. We candevelop a formula for testing if a sine wave signal componentis bin centered as follows. A sine wave is given by Equation 1:

    y = sin2rft 1)

    where f is the frequency in cycles/second (Hz). The period ofa sine wave P (seconds per cycle) is the reciprocal of the fre-quency (Equation 2):

    P 2)

    Since we have to work with digitized data, define:N = number of samples in data segment being analyzedf = sample rate in samples/secondThe time interval between samples h is the reciprocal of thesampling rate fs (Equation 3):

    h 3)s

    The signal duration T is given by Equation 4:

    T =Nh=- f

    4)

    14 OUND AND VIBRATION/MARCH 2006

  • 8/9/2019 A Comprehensive Windows Tutorial

    2/10

    f= 16.3 1=18.5 16.7

    11.0

    f=16.2=18.0 1= 16.1

    1.0

    2.0

    1,0

    0

    -1.0

    -2.01 1 ,9

    2.0

    1.0

    -1.0

    -2.0

    \1 0.0 1 .9 1.1

    2.0

    1.0

    0

    -1.0

    -2 01 1 .9

    2.0

    1.0

    1.0

    1.0 1.0Boxcar0.8 0.8

    0.8 0.8

    0.4 0.4

    0.2 0.2

    010 5 0

    0

    1.0Kaiser 1.0

    0.8 0.80.6 0.8

    0.4 0.4

    0.2 0.2

    0 0Oa e e e e15 0

    1.0

    0.8

    0.6

    0.4

    0.2

    Gauss

    ft

    1 15 2

    Frequency, Hz

    1.0

    0.8

    0.6

    0.4

    0.2

    15 2

    Rat-top

    1 15 2

    1.0

    0.8

    0.6

    0.4

    0.2

    0

    1.0

    0.8

    0.6

    0.4

    0.2

    015

    1.0

    0.8

    0.8

    0.4

    0.2

    0

    1 15 2

    1.0

    0.8

    0.6

    0.4

    0.2

    0

    1.0

    0.8

    0.6

    0.4

    0.2

    0

    Figure 3. Non-bin-centered tone time histories; except for the case ofexactly 16 Hz, the beginnings and ends do not match.

    The number of periods N has to be given by the duration overthe period Equation 5):

    N =Tp 5)

    By substituting Equations 2 and 4 into Equation 5, we find:

    N

    P s

    Nf from

    P

    N1 / f 6)

    Now, as long as N P is a whole number, the sine wave in thedata segment is bin centered or has an integer number of peri-ods. Such test segments of a sine wave signal are needed forcalibrating a window coefficient in our spectrum calculationprograms, so this is a handy formula to keep in mind. In thecase of a sampling rate of 1,024/second and if our number ofsamples is also 1,024, the number of periods will be equal tothe frequency. I will set things up that way here. To illustratehow the end and beginning not matching affects things, I willdraw an expanded view of the end of a 16-Hz, 1,024-point sine

    wave chunk connected to the beginning of the identical 16-Hz,1,024-point sine wave chunk. This is shown for 16 Hz and sev-eral frequencies close to 16 Hz in Figure 3. I have expandedthe region where the end of the first sine meets the beginningof the second sine to make it clear that a discontinuity occurswhen the frequency is not a whole number. Notice that the twocurves match perfectly end to beginning) only for the case of16 Hz, which makes the signal bin centered.

    Non Bin Centered Effects

    Now we are in an excellent position to consider the effectsthat those six windows I mentioned help us alleviate but can-not really cure) the picket fence and leakage effects of a non-bin-centered signal on the spectra we compute. In case you arerusty, I want to review some spectrum fundamentals so you will

    know what to expect. I use the acronyms DFT and FFT syn-onymously. DFT means the discrete Fourier transform, and FFTmeans the fast Fourier transform, the calculation procedureused to calculate the DFT. All signal analyzers and data col-lectors use an FFT to initially compute and then develope thespectrum from that result.

    The DFT of an N-point signal, sampled at fs gives us a spec-trum of N/2 + 1) amplitudes at frequencies from 0 to f 5/2. Wefrequently call these N/2 + 1) amplitudes the bin values. The4f or bin frequency spacing, is 1/T = fs /N We get a frequencyvalue starting at f = 0, and values spaced at zlf all the way upto f 5 /2. There will be N/2 intervals between 0 and fs /2; there-fore, each interval or space is Lif = )/(N/ 2) = f s /N This is1/T. The time between samples is 1/f s , and (1V)(1/f s = T. These

    INSTRUMENTATION REFERENCE ISSUE

    Figure 4. Expanded DFTs for 16 Hz; this is the bin-centered case, sixdifferent windows.

    Figure 5. Expanded DFTs, 16.1 Hz 10 off bin center, six different win-dows; all windows seem reasonable in this situation, but the boxcarwindow shows side lobe leakage.

    Figure 6. Expanded DFTs, 16.2 Hz, 20 off bin center, six different win-dows; thin line shows actual tone positioned at 16.2 Hz.

    15

  • 8/9/2019 A Comprehensive Windows Tutorial

    3/10

  • 8/9/2019 A Comprehensive Windows Tutorial

    4/10

    More DFT Background:We have to look a little closer at the DFT and how it is used

    to compute our spectrum. We have to look at the DFT of a win-dow, and I have to explain this shifted idea. The DFT equationsare Equations 7a and 7b:

    n=N-1Xk = N ne -izzicn/ N

    n=0

    N-1 kINXn =Xke 2

    k = o

    Equation 7a is the DFT analysis equation; it analyzes Nsamples of digitized data, the x n into N DFT values, the X k . The

    NX k values are complex sine wave amplitude values; we saythey are complex because they contain an amplitude and a

    phase or the same thing is real and imaginary parts. Equation7b is the synthesis equation; it exactly transforms the complexX s back to the original x s. However, I have the 1/N where Ithink it belongs, not where it is usually placed.

    To use Equations 7a and 7b for vibration analysis, there aresome ground rules. The data list is sampled at sampling ratefs . The x n of Equation 1 are samples from a signal that was ac-curately sampled and band limited to f 912; this means its Fou-rier transform is zero for all frequencies greater than half thesampling rate. There is an even number of N samples in thelist. In Equations 7a and 7b, the complex exponential is alsoexactly Equation 8:

    e -12 ' niN = cos 2itknisin

    27rkn8)

    We can see the frequency in that 27ckn/N, if we multiply it byhf s which equals 1, by Equation 3, and rearrange as in Expres-sion 8a:

    kfcos 27r h) is analagous to cos 27rft 8a)

    Thus, in digitized terms, nh is the discrete time, and kfiN sthe frequency. The time index is n and the frequency index isk.

    Let us repeat: the DFT as an exact transformation of a digi-tized vibration signal. It transforms the data into discrete (orsampled) complex exponentials (or equivalent sinusoids). Thetransform is the list of their amplitudes as a function of fre-quency. Equation 7a transforms the signal into N sine waves;each X k is the amplitude and phase of a complex sine wave.Figure 10 attempts to show one of the k discrete complex si-nusoids in 3-D. X k is its complex amplitude or a vector fromthe origin to the beginning point of the discrete spiral. The littlecircles on the spiral represent the values of the discrete sinu-soid for the sequence of n values. The smooth spiral on whichthe data lie is the underlying curve, the curve with time takento be continuous or with nh replaced by t in Equation 8a. EachX k is the complex amplitude of one of the discrete spirals.Equation 7b says to add them all up and you have your origi-nal signal. The transform is the list of complex X s.

    Since it is an exact transformation, we are able to exactlyinverse transform the DFT back to the original data. The trans-form is a set of amplitudes and phases of complex sine wavesthat form a continuous curve when added together. When thecurve is evaluated at the signal sampling instants, it exactlyreproduces the signal. The continuous curve, which is the sumof the N sine waves, is the continuous periodic band-limitedcurve the original x s were sampled from. The inverse trans-form evaluates all these sine waves at the signal sample instantsand adds them up. I want to also use the word reconstructionfor the inverse transform operation, the IFFT.

    The DFT is most economically computed using the FFT. Ibelieve MATLAB S algorithm is able to deliver efficient resultsfor all N values, not just powers of 2. The FFT will compute NFourier coefficients from a sequence of Nnumbers. The X s arenumbered from 0 to N- 1. If Nis even, X is the DC or averagevalue; it is real and contains one value. X N/2 also contains one

    2.0

    1.5

    1.0

    0.5

    0

    g 0.5

    1.0

    1.5

    -2.0

  • 8/9/2019 A Comprehensive Windows Tutorial

    5/10

    2.0Shifted DFT

    2.0

    1.5

    1.0

    0.5

    2.01024-pointboxcar window

    1.5 F

    1.0

    0.5

    DFT of boxcar

    1.5

    1.0

    0.5

    00 .5 .0 00 000

    Time, sec requency, Hz

    2.0Expanded shifted

    1.5

    t }

    0.5

    -10

    2.0 , 2.0 2,01024-paintHenning window

    DFT of Henning Shifted DFT

    1.5 1.5 1.5

    1.0 1.0 1.0

    0.5 0.5 0.5

    0500 000 0 005 .0

    Time, sec requency, Hz

    2.0 2.0Expanded shifted Stem plot

    1.5 1.5

    1.0 1.0

    0.5 0.5

    -10 0 10 0

    Ak = l2

    O k = tan -1ak

    A k is the content or the amplitude of the kth harmonic or tone;0k is its phase. This is the quantity shown on signal analyzersand data collectors. More manipulating leads us to the follow-ing. The X k s from k = 1 . . . N- 1)/2 that we get from the DFTare related to the content as Equations 11, 11a, and 11b:

    a k bkX k =

    2

    Ak - 21X 11a)

    Sok = tall 1 -Im(X k ))Re(X k ) 11b)

    The amplitude and phase of the kth harmonic defined in Equa-tion 10a are summarized in Equations 12 and 12a:

    Ak = 2IX A = X 0 A N/2 - X N 12)

    (pk = tan 1Re(Xk) 12a)

    -Im(X k )The DFT, which is most economically computed using the

    FFT, will compute N Fourier coefficients from a sequence of Nnumbers. X is the DC or average value; it is real and contains

    one value. XN/2

    also contains one real value. In between thesetwo are (N/2 - 1) unique complex values, each containing twovalues. The X values from X o X N _ I are not unique butare complex conjugates of the values from X N/2 _ down to X 1.The values symmetrical about X N/2 are complex conjugatepairs. Thus for the N values of the sequence, we get N uniquevalues from the transform.

    That is dry and tough. One more DFT concept and then weproceed, and it is shifted. The values past X N/2 can be pickedup as a group and lifted to the other side of zero so that nowinstead of having values on either side of the Nyquist value,X N /2 be complex conjugate pairs, the values on either side ofzero frequency or X 0 are complex conjugate pairs. In thismethod of plotting a DFT we will have positive and negativefrequencies. This is a common method of plotting a DFT. Weare used to plotting a spectrum, which is content versus fre-quency from 0 to the Nyquist frequency, or f /2. Many peoplenot in this business plot the X k s and use positive and nega-tive frequencies. That is what I mean by shifted.

    FT of a Window

    Now let us look at the DFT magnitude of some windows; theDFT or the X k s, not the spectrum. I am going to make all thesewindows 1,024 points long, and I am going to sample them at1,024 samples per second. Therefore, the time duration of eachwindow will be one second; the 4f, which is one over the du-ration, will be 1 Hz. We will start with a boxcar window, TheDFT is going to be digitized Fourier series of a boxcar windowconsidered periodic and going on forever. It is a straight linewith an amplitude of 1. It only has a DC component; it shouldhave one line in its DFT with amplitude 1 at frequency equalto 0. Figure 11 shows this. In Figure 11a, we see the 1,024 onesas a horizontal line. In Figure 11b, we have the DFT magnitudeand we see a 1 at 0 frequency. In Figure 11c, I show the shiftedDFT magnitude with positive and negative frequencies. We stillhave a 1 at 0 frequency. In Figure 11d, I expand the plot to onlyslow values from -10 to 10 Hz, which shows a triangle with abase from -1 to 1 Hz and an apex of 1 at 0 frequency; we getthis triangle because the plotter draws straight lines betweenthe values. In Figure 11e, ; use the stem plot feature that makesit clear we only have one value at zero frequency with an am-plitude of 1.

    Now let us look at the DFT magnitude of a Hanning window.The equation of the Hanning window is Equation 13:

    Figure 11. DFT of a 1,024-point boxcar window; only one line, DC. F s =1024, so T = 1 sec; df = 1 Hz.

    Figure 12, DFT 1,024 point Hanning window; only three lines; F = 1024So T = 1 sec; .4f = 1 Hz.

    1w =2

    (1 cos 27rn 13)

    This is a raised cosine with an average or DC value of 1/2. Ithas a period of our window length, 1 second, thus its Af is 1Hz. The DFT is going to be a digitized Fourier series of this 1Hz raised cosine with an average value of 1/2 considered peri-odic and going on forever. Figure 12a shows its time history.In Figure 12b, we see its 1,024 value DFT. We see what appearsto be a 1 at 0 frequency and a 1/2 at the 1024th value. In Fig-ure 12c, we see the results of shifting the 513th to the 1,024thvalue over on the other side of 0. In Figure 12d we expand theplot to only slow values from -10 to 10 Hz, which shows a tri-angle with a base from -2 to +2 Hz and an apex of 1 at 0 fre-quency. We get this triangle, because the plotter draws straightlines between the values. In Figure 12e, I use the stem plotfeature that makes it clear we only have three values; one at 0frequency with an amplitude of 1, and two values of 1/2 at 1and +1 Hz. By Equation 12, these two values of 1/2 would addto 1 when we convert this to a spectrum so the spectrum willhave a 0 frequency or DC value of 1 and a 1 Hz value of 1. Theyboth should be 1/2, but I normalized the DFT plot to make thelargest value 1. The Hanning window has a convenient lysimple DFT; three numbers. We will soon discuss that the con-volution can be used to apply the window, and a convolutionwith just these three numbers made significant economic sensein the late 1960s and early 70s when the new signal analyzersbecame digital and started using the FFT. Most of the popularwindows have simple DFTs for this reason.

    (lob)

    10c)

    18OUND AND VIBRATION/MARCH 2006

  • 8/9/2019 A Comprehensive Windows Tutorial

    6/10

    20 2.0B o x c a rwindowend 9X zeros

    1.5 1.5

    10 1.0

    0.5 0.5

    0l ime, sec

    20 2.0Shifted D FT

    0403011.5 1.5

    1.0 1.0

    0.5 0.5

    0500 0 00

    Frequency, Hz

    2.0

    1.5

    1.0

    0.5

    10 Log plot shifted DFTxpanded shifted DFT

    10

    10

    10-5 5

    Frequency, Hz requency H z

    DFT of zero-padded boxcar

    0 510 0 0l ime, sec

    500 000Frequency, Hz

    Expanded viewof window

    Log piot ShiftedO P T

    20Henning windowand 9x zeros

    2.0

    1.5

    1.0

    0.5

    DFT of zero-padded Nanning

    1.5

    1.0

    as

    02468Time, sec

    500 1000Frequency Hz

    20 20Shifted OFT Expanded Shifted DFT

    1.5 1.5

    1.0 1.0

    0.5

    0-500 00 -5

    1040

    Frequency Hz requency, Hz-5 5

    Frequency, Hz

    10'

    10°

    10

    10

    20 2.0 10

    10°

    10 10

    Shifted OFT

    1.5

    1.0

    0.5

    1.5

    1.0

    0.5

    0-500 od-

    Frequency Hz0

    las-5 5

    Frequency Hz requency, Hz

    flat-top wiridowand 9x zeros__ :

    20Expancied viewotWindefw.

    1.5

    1.0

    0.5

    2 0 .5 1.0Time, sec ime, sec

    DFT of zero-padded flat-top

    500 000Frequency Hz

    20

    1.5

    1.0

    0.5

    2.0

    1.5

    1.0

    0.5

    Effect of dding Lots of ZerosThis may seem silly for a minute, but just for a minute. The

    DFT of a digitized time history returns N+ 1 frequency valueswhen it receives N time history values equally spaced betweenzero and . I will append nine times 1,024 zeros to the end ofa 1,024 point window time history. Now this forces the DFT toanalyze a periodic time history with the window, a nine timesas long string of zeros, and the window again, and so on; theDFT will now calculate 10,241 frequency values. For the box-car or uniform window, this is very different from our periodicboxcar that was just a horizontal line. Figure 13a shows a timehistory for a 10,240-point boxcar window in which the first1,024 values are ones. (You have to append a lot of zeros to seethe window shape.) The time history is 10 seconds long. Thesample rate is 1024 sample/second, so the first 1,024 pointshave a duration of 1 second. Figure 13b is a view of just thefirst 1,050 points of the time history to show that we have thesame boxcar window. Figure 13c shows the magnitude of theDFT of the zero-padded boxcar 10-second time history. Nowthe plot appears to show the value 1 at 0 frequency and a 1 atthe highest frequency. The shifted DFT magnitude in Figure13d shows content near 0 frequency. To see what is going onnear 0, I expanded the plot to just show the region from -5 to+5 Hz in Figure 13e. This is the amazing result of adding thezeros. Instead of getting the single line of Figure 11e, we nowhave a continuous curve with a main lobe 2 Hz wide betweenan array of side lobes 1 Hz wide. In Figure 11f, I have plotteda semi-log plot showing the log of the DFT values. Quite a com-

    plicated result. This is the kind of DFT I will use to show whatthe windows do .

    I will pursue adding zeros in examples with the Hanningwindow shown in Figure 14. Our Hanning window in Figure12 was a cosine with a amplitude of 1/2 and a mean value of1/2 oscillating forever. In Figure 14a, we see the Hanning win-dow with nine times as many zero values appended. Figure 14cshows the DFT magnitude and Figure 14d the shifted DFTmagnitude, again with all of the content apparently clusterednear 0 frequency. But reducing the frequency range from -5 to+5 Hz shows a main lobe 4 Hz wide with a slight ripple appar-ent. This ripple becomes apparent on the semi-log plot of Fig-ure 14f. The main lobe is fatter, 4 Hz wide, and the ripplemagnitude is considerably reduced; the highest lobe is abouta 0.02. These side lobes are again 1 Hz wide.

    Finally, in Figure 15, I did the same thing for the flat-topwindow to show the extremely wide main lobe, which we shallsee enables the flat-top window to provide extreme amplitudeaccuracy. The reason it is called the flat-top is because the mainlobe has a flat top. The side lobes are so small they do not showin this plot. Now we move on to the convolution theorem wherewe will use these ideas.

    Convolution TheoremThe only way I can analyze or explain window effects (that

    is, why the window affects leakage, the content in the adjacentbin, and reduces picket fence errors) is via the convolutiontheorem, 9 which is difficult. The convolution theorem for usis: the DFT of the term-by-term product of two digitized timesignals (a digitized time signal is a long list of digitized accel-eration or velocity values) is equal to the convolution of theDFTs of each of the signals. If we want the DFT of the productof two time signals, we can get it by a convolution of the twoindividual DFTs. And that is our situation exactly. We want tounderstand the DFT of a windowed signal, and we will do itby looking at the convolution of the DFT of unwindowed sig-nal and the DFT of the window. So we have to use the convo-lution.

    What is a convolution? It is horribly confusing, important,and widely used. It drives most students nuts and still confusesme every now and then. The equation is:

    q=AT-1X k) q)W k - q) 14)

    q = 0

    I N S T R U M E N TAT I O N R E F E R E N C E I S S U E

    Figure 13. 1,024 point boxcar window, 9x zero-padded, expanded, DFT,shifted, expanded, semi-log plot.

    Figure 14. 1,024 point Hanning window, 9x zero-padded DFT, shifted,expanded, and semi-log plot.

    Figure 15. 1,024 point flat-top windo DFT, shifted, expanded, semi-log plot.

    For our s ituation, Y(q) represents the DFT of our un-windowed data as collected, and W is the DFT of the window.X is the DFT of the windowed data that we can convert to the

    19

  • 8/9/2019 A Comprehensive Windows Tutorial

    7/10

    Signal

    46 41 il

    4 0 100 200 300 00 00

    Boxcar window function

    60000 200 300 00 00

    4

    2

    0

    P r o d u c t o f w i n d o w a n d s i g n a l

    -2

    100 200 300 00T m e m s

    4

    2

    0

    -2

    1.2

    1.0

    0.8

    0.6

    0.4

    0.2

    0

    12 1.2

    1.0 .0

    rserivo m0.2

    0.4

    0.2

    0.8 .8

    0.6 .6

    0.4

    012 14 16 18 2

    Frequency Hz

    12 14 16 18 2 12 14 16 18 2

    1 4 6 18 22 14 16 18 2

    1.2

    1.0

    0.8

    0.6

    0.4

    0.2

    0

    12

    1.0

    0.8

    0.6

    0.4

    2

    0 1 2 2 0

    1 2

    1.0

    0.8

    0.6

    0.4

    a 2 rAi t12 14 16 18

    spectrum we see in the signal analyzer. The equation says (andrealize that X Y and W are lists of N numbers, like 1,024 num-bers) that the value of the windowed DFT at frequency k is thesum of the products of the flipped, shifted, window DFT val-ues centered at frequency k and the DFT of the data. We aregoing to do this in the explanation and I will draw it shortly,so I think this will become clear. But remember: sum of prod-ucts of flipped, shifted, window DFT, and data DFT.

    pplying Convolution Theorem to Windows nalysisHow does the convolution theorem help us understand win-

    dows? We will view the window as a long digitized time sig-nal, a string of mostly zeros with a non-zero digitized windowshape in the center. Thus, the process of term-by-term multi-plying the long window with the long sign l conceptu llyforms our windowed segment that our analyzer/data collectorFFTs. I need this concept to explain what we saw in Figures 4through 9. Figures 16 and 17 illustrate this for the boxcar andHanning windows.

    In Figure 16, by speaking of a widowed segment, I meanconsidering the term-by-term product of the upper plot (pre-tend it is a long vibration signal, say 50,000 points) and themiddle plot is an equally long list of zeros with a set of ones(perhaps 1,024) in the region where we want to select a seg-ment of the signal for analysis. By multiplying these two graphsor data lists term by term, we end of with the third plot, a seg-ment of the long signal. The third plot represents a chunk ofdata our signal analyzer would analyze. By speaking of a wid-

    owed segment, for now, I mean the product of the upper plot(the signal), and the middle plot of the long list of zeros with aset of ones in the middle. Similarly, Figure 17 shows the sameconcept, except this time we have a centered Hanning windowflanked by a huge number of zeros. Now you can see why Ineeded the DFT of the window with the huge amount of zeros.

    We know that the DFT of a signal returns spectrum values ata set of frequencies Af apart. The Af is 1/T, where T is the timeduration of the signal segment. If we have a signal that is stableand infinitely long (let fe mean forever) T f is infinitely long,N is infinite, Af f is infinitesimally small; its DFT has infi-nitely many lines and is exact for every tone or harmonic con-tent the signal contains. This is an idea of the true spectrumconcept: no picket fence or frequency error and no leakage. Ithas lines everywhere and is exact for every tone in that stable

    signal. That is the true spectrum we want, but we cannot haveit because we cannot collect or analyze such a long signal.

    We use the infinitely long zeros-window-zeros of Figures 16band 17b to select a chunk T long of that stable, very long timehistory. The DFT of this windowed chunk will still have lineseverywhere, because it had infinitely many time values. So itwill also have lines at the frequencies that our signal analyzercan compute. To explain what the window will do to variouskinds of signals analyzed on any real signal analyzer, we willconvolve the highly detailed zero-padded window DFT withthe DFT of a sine wave signal. We know the DFT of our T lengthsignal analyzer spectrum is going to be a discrete vector withvalues for frequencies starting at 0, and at every 1/ T on up toN/2.

    And what does this 'convolved' mean? This means the value

    of the convolution at frequencyk

    Or: flip the window DFT leftright, center it on one k value, term by term multiply, and addup the products. Summarizing: take the DFT of the window,which is symmetric if plotted with positive and negative fre-quencies - center it at some frequency f t on the DFT of the sig-nal - term-by-term multiply the two DFTs together; add up theproducts; and that is value of the convolution for f t . Continuethis for every frequency of interest.

    Let us illustrate this with the examples of Figure 7, the caseof a 30 of bin-centered signal. Figure 18 illustrates this forthe boxcar window. The true signal is a tone at 16.3 Hz shownas a black line. In Figure 18a, the window DFT (blue) is cen-tered at 13 Hz. The product of the DFT of the window with theDFT of the 16.3 Hz tone is short red line at 13 Hz. In Figure

    2 0

    Figure 16. Boxcar window to select a segment of data from long timehistory.

    2

    2 -11116 49f 4

    Signal

    1

    100 00 00 t1:1 00 00

    2

    1

    0

    Henning window function_____________/

    100 00 00 00 00 00

    4

    2

    0

    Product of window and signil

    -2_

    100 00 00 00 00 00Time ins

    Figure 17. Hanning window to select a segment of data from long timehistory.

    Figure 18. Convolution steps of boxcar window with 16.3 Hz tone.

    S O U N D A N D V I B R AT I O N /M A R C H 2 0 0

  • 8/9/2019 A Comprehensive Windows Tutorial

    8/10

  • 8/9/2019 A Comprehensive Windows Tutorial

    9/10

    20 20 20D i a m o n d H e a d : E x p a n d e d v i e w D F T o f z e r o -w i h d 3 W a n d 9 x z e ro s of wind* p a d d e dDiamond

    1.5 1.5 1 .5

    1.0 1 .0 1.0

    0.5 0.5 0.5

    2 0 0 0.5 .0 500 000lime, sec i m e s e c r e q u e n c y H z

    20 2 .0 10'S h i f te d D F T E x p a n d e d S h i f te d D F TLog plot shif ted OFT

    1.5 1.5 1 0 °

    1.0 1 .0 1 0

    0.5 0.5 1 0 2

    o - 6 0 0F r e q u e n c y H z

    0 5F r e q u e n c y H z r e q u e n c yH z

    DFT of zero-padded sn000py

    Logp b t s h i f te d D F T

    20 20S n o o d p yv v i n d o wa n d9x zeros

    1 .5 1.5

    1.0 1 .0

    0.5 0.5

    0Ti m e s e c

    20 20S h i f te d O F T

    0 4 0 3 0 11.5 1.5

    1 . 0 1.0

    0.5

    0 5

    0.5

    0 0 0 0 .5 U5 50 5F r e q u e n c y H z r e q u e n c y H z r e q u e n c y H z

    500 000Frequency Hz

    2.0

    1 . 5

    1.0

    0.5

    0.5 .0Tr n e s e c

    E x p a n d e d S h i l te d D F T10'

    1 0 °

    10'

    102

    Figure 23. Diamond Head window 9x zero-padded DFT shifted lin-ear semi-log.

    only high-frequency zeros and an even number for economi-cal computing. The current Nyquist or center value is the high-est frequency value and is real. We make the new Nyquist 0.Half of the old Nyquist is placed on each side as highest fre-

    quency non-zero values. Add a complex zero.) Then place anodd number of complex zeros in the transform center for thedesired values in reconstruction. Because of the 1/N in MATLAB ,the reconstructed window must be renormalized to make itsmaximum value 1. Adding zeros is a sensible practical proce-dure and certainly worked well here.

    In the case of the beagle window, I digitized the drawing with170 samples, and this was resampled by adding zeros to theDFT, and inverse transforming to bring the time plot to 1 024samples. Figure 24 shows a plot of both the original andresampled versions of the window, and Figure 25 shows thezero-padded version, its DFT, and both linear and semi log plotsof its expanded central region.

    Side Lobe Height

    From our discussion of Figures 18, 19, and 20 we can seethe problems of side lobe height. The windowed spectrum levelat any of the frequencies will be the sum of the products of thewindow DFT and the data DFT. I illustrated the easy problemof the convolution with a single tone. Windows with high DFTside lobes or skirts allow noise and other tones or content tocontaminate or increase the apparent level for the line at whichthe window is centered. Figures 26 and 27 show compositelinear and semi-log plots of the side lobes of the six windows.

    Effects on Machinery Vibration ataFinally, I made two busy plots, Figures 28 and 29, showing

    the eight windows applied to some pump vibration data. Theyprovide an opportunity to examine spectral changes expectedfrom different windows. The running speed is close to 20 Hz.There is a strong 2x component near 40 Hz, probably due tomisalignment. The content at 7x is because the pump has sevenvanes. The high skirt characteristic of the boxcar windowshows well on Figure 29, the semi-log plot. The wide flat-topwindow smears the peaks and obscures detail. It is interestingthat the beagle and the Diamond Head widows do as well asthey do.

    Conclusion

    ope some of this adds some insight to your understand-ing of windows. Maybe it will give you enough background totackle some of the difficult references. It certainly seems to mefrom References 1, 2 and 9, that many bright people have de-voted years to developing windows. All of the figures and cal-

    Figure 24. The digitized and edited as well as resampled beagle win-dow.

    Figure 25. Beagle window 9x zero-padded DFT shifted DFT linearsemi-log plots.

    Figure 26. DFTs of common windows shifted expanded zero-paddedlinear plot.

    22 O U N D A N D V I BR AT IO N / M A R C H2006

  • 8/9/2019 A Comprehensive Windows Tutorial

    10/10

    0 0 20.1 - BoxcarO _ A

    lanning0.1

    0.02

    l

    0.1 tr m m i n g_... ,-,},-, -,An _ _ I _As.0 0 2

    0.1 Gaussian

    0 0 20.1 - _A LF P

    0.1 Diamond Head0

    0 0 201^ B e a g l e ma y

    0 0 20 40 0 80 100 20Frequency

    140 160 180 200

    102

    104. 1 0 2

    104

    102

    10 1

    1 02 1Kaiser Vessel

    1 0410 Gatissi ri

    104

    lat-top

    D i a m o g H e a d

    Beagle

    h04 ‘

    020 40 60 80 100120 140 160 180 200

    Frequency

    102

    102

    104

    102

    20 YEARS EXPERIENCEin producing measurementmicrophones.

    EACH YEAR we supplythousands of microphonesto OEMs.

    WIDE RANGEof modelsto fit your a pplicationneeds.

    Good Selectionetter Microphones

    est PriceBSWA Technology Co. Ltd.

    Unit 620, Shangfang Building, 1127 Bei SanHuan Zhong Road, Beijing, 100029, ChinaPhone: 86-10-6252 5350 Fax: 86-10-6200 6201inf Abswa-tech. corn ww. bswa-tech. comH

    Figure 27. Semi-log plot of shifted zero-padded expanded windowsshowing skirts.

    Figure 28. Eight linear spectra from the bearing of a large pump eachanalyzed with the indicated window. Note the errors in peak ampli-tudes; the flat-top should be most accurate.

    Figure 29. Eight semi-log spectra from the bearing of a large pump eachanalyzed with the indicated window. High skirts of the boxcar windowshow well around 40 Hz. The windows have an effect to be sure.

    culations were done with MATLAB.12 I kept copies of all the littleprograms used to draw the figures. If you would like copies of

    the programs to see how I have done them, let me know.

    References1. Harris, F. J.. On the use of Windows for Harmonic Analysis with

    the Discrete Fourier Transform, Proc. IEEE, Vol. 66, No. 1, pp. 5 1-8 3, January 1978.

    2. Nuttall , A. H., Some Windows wi th Very Good Sidelobe Behavior,IEEE Trans. on Acoustics Speech and Signal Processing Vol.ASSP-29, No. 1, pp. 84-91, February 1981.

    3. Potter, R. W., Compilat ion of Time Windows and Line Shapes forFourier Analysis, Handout notes from an HP seminar circa 1978

    4. Gade, S., and Herlufsen, H., Use of Weighting Functions in DFT/FFT Analysis (Part I), Briiel Kjfflr Technical Review, No. 3, pp. 1-28, 1987.

    5. Gade, S., and Herlufsen, H., Use of Weighting Functions in DFT/FFT Analysis (Part II), Briiel Kjnr Technical Review, No. 4, pp.1-35, 1987.

    6. Tran, T., Dahl, M., Claesson, I., and Lago, T., High Accuracy Win-dows for Today's 24 Bit ADCs, IMAC 22, Session 29, Signal Pro-cessing, Soc. for Experimental Mechs., www.sem.org.

    7. Harris, F. J., Trigonometric Transforms, a Unique Introduction to theFFT, Spectral Dynamics, Inc., San Marcos, CA., October 1977.

    8. Gaberson, H. A., The DFT and the FFT as a Discr ete Fourier Se-ries of Sampled Data , MFPT Advanced Signal Analysis CourseNotes, Section 2, January 2003.

    9. McConnell, K. G ., Vibration Testing; Theory and Practice JohnWiley & Sons, Inc., pp. 266-278, 1995. (Most digital signal process-ing books cover the convolution theorem, but this one is more di-rected to our area.)

    10. Gaberson, H. A.; Using the FFT for Filtering, Transient Details, andResampling, Proc. National Technical Training Symposium and27th Annual Meeting, Vibration Institute, Willowbrook, IL, pp. 127-136, July 2003.

    11. UN-SCAN-IT, Silk Scientific Inc., Orem, UT.12. MATLAB ® for Windows, Version 5.3, High-Performance Numeric

    Computation and Visualization Software The MathWorks, Inc.,Natick, MA, 1999.

    The author c an b e contacted at: [email protected].

    R S 115 at www SandVeasy com

    INSTRUMENTATION REFERENCE ISSUE 23