Using Windows

The smearing or leakage effect mentioned previously is a direct consequence of the definition of the Discrete Fourier Transform and of the fact that a finite time sample of a signal often does not include an integral number of some of the frequency components in the signal. The effect of this truncation can be reduced by increasing the length of the time sequence or by employing a windowing algorithm. IDL's HANNING function computes two windows which are widely used in signal processing: the Hanning window and the Hamming window.

Hanning Window

The Hanning window is defined as:

Using_Windows-17.jpg

The resulting vector is multiplied element-by-element with the sampled signal vector before applying the FFT. For example, the following IDL command computes the Hanning window and then applies the FFT function:

v_n = FFT(HANNING(N)*U) 

The power spectrum of the Hanning windowed signal shows the mitigation of the truncation effect (see the figure below).

Figure 8-5: Time Series Multiplied by Hanning Window (Left)
and Power Spectrum (Right) with Hanning Window (Solid) and without (Dashed)

sigprc07iplot.gif

Example Code
Type @sigprc06 at the IDL prompt to run the batch file that creates this display. The source code is located in sigprc06, in the examples/doc/signal directory. See Running the Example Code if IDL does not find the batch file.

Hamming Window

The Hamming window is defined as:

Using_Windows-18.jpg

The resulting vector is multiplied element-by-element with the sampled signal vector before applying the FFT. For example, the following IDL command computes the Hamming window and then applies the FFT function:

v_m = FFT(HANNING(N, ALPHA=0.56)*U) 

The power spectrum of the Hamming windowed signal shows the mitigation of the truncation effect (see the figure below).

Figure 8-6: Power Spectrum with Hamming Window (Solid)
and without (Dashed)

sigprc08iplot.gif

Example Code
Type @sigprc07 at the IDL prompt to run the batch file that creates this display. The source code is located in sigprc07, in the examples/doc/signal directory. See Running the Example Code if IDL does not find the batch file.