Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Effects of Windowing on the Spectral Content of a Signal 0

Pierre Wickramarachi, Data Physics Corporation, San Jose, California –20


Fourier analysis is commonly used to 1(b)], the energy at f is smeared over ad-
estimate the spectral content of a mea- jacent frequencies because the secondary –40

V, dB
(b) (c)
sured signal. When choosing the appro- lobes of all other filters overlap f with
–60
priate window, one needs to be aware of nonzero gain and these filters respond in
its advantages and pitfalls in order to fit proportion to this gain. This perverse ef-
the measurement situation. The follow- fect is maximum when f = f 0 – ∆ f/2 [case –80
(a)
ing deals with some practical consider- 1(c)], since the frequency f coincides with
–100
ations on the effects of windowing. 1 the peak of each side lobe. 250 500 800
The Fourier series assumes periodicity If side lobes could be reduced in am- Frequency, Hz
of the signal in the time domain. An FFT plitude, this error would decrease as Figure 1. Spectrum of a sine wave with the
is actually a Fourier Series performed well. This is why people have used a Rectangular window: (a) f = f 0; (b) f = f 0 – ∆ f/8;
upon an interval, T span = n ∆ t where n is number of windows to weight the trun- (c) f = f 0 – ∆ f/2.
the number of samples observed and ∆ t cated signal such that the starting value
∆f
is the constant time between samples. and the ending value are zero. This pro- 0
13 dB
Since the sampled time signal may not duces a signal that appears periodic in 31 dB
20 dB/
exactly contain an integer number of pe- Tspan, meeting the basic assumption of the (a) decade
riods, this assumption may not be truly Fourier Series. Weighting avoids the

V, dB
satisfied. sharp discontinuities induced by the 60 dB/
(b)
In effect, the truncation of the original Rectangular window and yields reduced- decade
signal corresponds to its multiplication amplitude side lobes as desired. Figure
with a Rectangular window of length 2(b) shows the spectrum of the well
T span. The Fourier series then assumes known Hanning2 window. Observe that –80
fi−2 fi−1 fi fi+1 fi+2
that the signal is the succession of ver- the amplitude of the first side-lobe is re-
sions of this truncated signal in the time duced from –13.2 dB to –32.2 dB. More Figure 2. Comparison of spectra for the Rect-
domain leading to a spectrum with har- importantly, notice that the amplitudes of angular window (a) and the Hanning window
(b).
monic components at frequencies equal subsequent side-lobes fall off at 60 dB/
to multiples of ∆ f = 1/T Span . decade as opposed to 20 dB/decade for
0
Let us examine the situation with a sine the Rectangular window.
wave of frequency f0. In theory the cor- These improvements come at a cost. –20
responding spectrum is a peak at f 0 . The width of the primary lobe essentially
When a noninteger number of periods is doubles, eliminating the first set of zero- –40

V, dB
acquired, this results in signal leakage, amplitude points. The primary lobe of the –60 (c)
characterized by the smearing of the Rectangular window has a –3 dB band-
spectrum. Figure 1 illustrates this phe- width of 0.85 ∆ f. That of the Hanning –80
(b)

nomenon by comparing three cases, window is increased to 1.4 ∆ f. However, (a)


–100
where f is the sine wave frequency and ∆f the benefits far outweigh the cost as
250 500 750
the frequency resolution. shown in Figure 3. Here the Hanning win- Frequency, Hz
Case 1(a) allows us to determine the dow is applied to the three cases previ-
ideal situation where an integer number ously examined. Indeed results with the Figure 3. Spectrum of a sine wave with the
Hanning window are close to case 1(a) Hanning window: (a) f = f 0; (b) f = f 0 – ∆ f/8; (c)
of periods (200) is set for the signal gen-
f = f 0 – ∆ f/2.
erator. The corresponding frequency is f0 done with the Rectangular window (ideal
= 508.626 Hz. In practice this case is not case). is usually selected. Its spectrum is char-
likely to occur, because the frequency However, the Hanning window exhib- acterized by a nearly flat main lobe across
that is being measured rarely falls on a its a deficiency. Like the Rectangular win- fi ±∆ f, which reduces maximum ampli-
frequency line. On the other hand, case dow, its primary lobe has significant cur- tude error to 0.1%! As for the side lobes,
1(b) represents a typical situation where vature or ‘ripple’ across the ± ∆ f band. their amplitudes remain at –70 dB below
the leakage is clearly visible. Here f has When a sine falls “exactly between cells,” that of the main lobe, which strongly re-
been slightly decreased, which results in its amplitude is reported 15% (–1.42 dB) duces leakage. However this window
a non-integer number of periods within lower than it would be at the filter cen- must be used with care, particularly if the
T span. The maximum leakage is obtained ter-frequency. The Rectangular window periodic signal of interest is ‘buried’ in
in case 1(c). Why? The answer lies in the exhibits this same fault, but more pro- broadband noise. The Flat-Top window
spectrum of the window as shown in Fig- nounced at 36% (–3.92 dB). should only be applied to clean periodic
ure 2(a). When the application requires an accu- waveforms. It is indeed a poor choice for
The FFT emulates a bank of parallel rate measure of peak amplitude (e.g. ro- random-signal or mixed-signal analysis
bandpass filters with the center frequen- tating machinery), the Flat-Top window because it lacks selectivity. A Hanning
cies exactly centered on integer multiples
of ∆ f. The width and shape of each filter Table 1. Comparison of windows for FFT analysis.
is identical and are given by the spectrum
of the observation window shown in Fig- Window Advantages Pitfalls Nb Applications
ure 2. Note that the filter shape is char- Rectangular . . . . . . . Raw data Leakage 1 ∆f Transient
acterized by multiple lobes separated by Identification of closely- (Impact testing)
zero values at multiples of ∆ f and that all spaced frequencies
filters in the bank ‘overlap.’ Hanning . . . . . . . . . . Little leakage Some amplitude error 1.50 ∆f Periodic, random
Frequency accuracy
When f of an applied sine corresponds
exactly to a filter center-frequency [case Flat-Top . . . . . . . . . . Little leakage Large noise bandwidth 3.43 ∆f Periodic
Amplitude accuracy No roll-off
1(a)], only that filter will respond because
f corresponds to an amplitude notch of all Exponential . . . . . . . .Shorter Tspan (quick Adds artificial damping Variable Impact testing
measurements for (Lightly damped
other filters in the bank. Conversely, if f structures)
modal analysis)
is not exactly on a frequency line [case

10 SOUND AND VIBRATION/JANUARY 2003


–25 exhibits an Nb of only 1.5 ∆f. Note that a
Rectangular window has a noise band-
–30 width equal to ∆ f, but it is unsuitable for
random analysis due to its previously
(a)
V, dB

–35 described leakage. Figure 4 compares


spectra of a sine wave in random noise
–40 using the Hanning and Flat-Top win-
(b) dows. Note the superior dynamic range
–45 between the sine peak and the noise floor
0 100 200 300 400 500
provided by the Hanning window.
Frequency, Hz
So when would the Rectangular win-
Figure 4. Comparison of spectra of a sine wave dow be actually an appropriate choice?
buried in random noise with: (a) the Flat-Top When the waveform is a transient and the
window; and (b) the Hanning window.
window is large enough to contain the
40 entire transient. This would apply to
impact testing for instance, where the
(a)
30 (b) response decays from the time of impact.
Note that T span should be chosen large
20 (c)
V, dB

enough such that the response has suffi-


10 ciently decayed to avoid any leakage due
to the discontinuity at the block end.
0
When Tspan is not large enough to con-
–10 tain the entire transient (as with lightly
140 150 160 170 180
damped structures), leakage errors can
Frequency, Hz
result from the truncation of the signal.
Figure 5. Transfer functions: (a) baseline; (b) Often people use the Exponential win-
with Rectangular window; (c) with Exponential dow to ensure a sufficient decay at t =
window.
T span. This approach is not always ad-
700 equate, because it adds some artificial
600 damping to the transfer function, as
500 shown in Figure 5(c). Here a Single De-
400 gree of Freedom module from the Men-
Amplitude, mV

300
tor 3 system provides the desired transfer
200
function for this example. The damping
(a)
100 (b) coefficient is adjusted to obtain a lightly
0
damped system. Then the averaged trans-
fer function is measured by 5 impact
–100
tests, with excellent frequency resolution
–200
0 20 40 60 80
(large Tspan). This constitutes our baseline
Time, msec [Figure 5(a)]. To exaggerate the different
windowing effects in this example, the
Figure 6. Time responses: (a) with Rectangular
window; (b) with Exponential window. sampling parameters are modified such
that T span = 98.304 msec. The natural fre-
window is a far better choice when try- quency of the baseline is set to ω =
ing to find a tone masked by random 162.125 Hz in order to be close to a fre-
background. The Flat-Top window lacks quency line. Hence the leakage observed
selectivity for two reasons. First, its pri- in case 1(a) is avoided. Then the impact
mary lobe is over twice as wide as that of test is performed with the Rectangular
the Hanning window suppressing addi- window [Figure 5(b)] and the Exponen-
tional zeros. Second, there is no roll-off tial window chosen with an appropriate
of the side-lobes with frequency. Both of decay rate [Figure 5(c)]. Although both
these characteristics render the Flat-top windows give a good estimate of ω, the
window sensitive to broadband noise, Rectangular window achieves a better es-
compromising its ability to ‘find’ a timate of the amplitude (error of 1 dB as
masked tone. opposed to 6 dB with the Exponential
A window’s sensitivity to broadband window). The time responses are dis-
random noise is standardly characterized played in Figure 6. Table 1 summarizes
by its equivalent noise bandwidth N b . the different characteristics of the win-
This one-number description of a compli- dows mentioned here.
cated shape may be found as follows.
Consider an ideal (unity gain) rectangu- References
1. Discrete-Time Signal Pr ocessing , A. V.
lar ‘brickwall’ bandpass filter and an FFT Oppenheim and R. W. Schafer, 1989.
filter that results from applying a window 2. Named after the Austrian meteorologist
in time domain. When both filters are Julius Von Hann. It is in fact a corruption of
excited with the same random signal, N b the name Hann Window, perhaps through
association with the Hamming Window
would simply be the frequency width at
named after the mathematitian R. W. Ham-
which the ‘brickwall’ filter passes the ming.
same power as the FFT filter. N b is the 3. The Mentor is a self-contained integrated
‘Hz’ reported in a g2 /Hz Power Spectral signal analysis training system, G. F. Lang,
Data Physics Corporation, 2001.
Density measurement.
While a Flat-Top window has a noise The author can be contacted at: wickram
bandwidth of 3.43 ∆f, a Hanning window arachi@dataphysics.com.

SOUND AND VIBRATION/JANUARY 2003 11

You might also like