thumb|A popular window function, the [[Hann function|Hann window. Most popular window functions are similar bell-shaped curves.]]
In signal processing and statistics, a window function (also known as an apodization function or tapering function as well as beamforming and antenna design.
thumb|400px|Figure 2: Windowing a sinusoid causes spectral leakage. The same amount of leakage occurs whether there are an integer (blue) or non-integer (red) number of cycles within the window (rows 1 and 2). When the sinusoid is sampled and windowed, its [[discrete-time Fourier transform (DTFT) also exhibits the same leakage pattern (rows 3 and 4). But when the DTFT is only sparsely sampled, at a certain interval, it is possible (depending on your point of view) to: (1) avoid the leakage, or (2) create the illusion of no leakage. For the case of the blue DTFT, those samples are the outputs of the discrete Fourier transform (DFT). The red DTFT has the same interval of zero-crossings, but the DFT samples fall in-between them, and the leakage is revealed.]]
Spectral analysis
The Fourier transform of the function is zero, except at frequency ±ω. However, many other functions and waveforms do not have convenient closed-form transforms. Alternatively, one might be interested in their spectral content only during a certain time period.
In either case, the Fourier transform (or a similar transform) can be applied on one or more finite intervals of the waveform. In general, the transform is applied to the product of the waveform and a window function. Any window (including rectangular) affects the spectral estimate computed by this method.
Filter design
Windows are sometimes used in the design of digital filters, in particular to convert an "ideal" impulse response of infinite duration, such as a sinc function, to a finite impulse response (FIR) filter design. That is called the window method.) is the simplest window, equivalent to replacing all but N consecutive values of a data sequence by zeros, making the waveform suddenly turn on and off:
:<math>w[n] = 1.</math>
Other windows are designed to moderate these sudden changes, to reduce scalloping loss and improve dynamic range (described in ).
The rectangular window is the 1st-order B-spline window as well as the 0th-power power-of-sine window.
The rectangular window provides the minimum mean square error estimate of the Discrete-time Fourier transform, at the cost of other issues discussed.
B-spline windows
B-spline windows can be obtained as k-fold convolutions of the rectangular window. They include the rectangular window itself (k = 1), the (k = 2) and the (k = 4).
In most cases, including the examples below, all coefficients a<sub>k</sub> ≥ 0. These windows have only 2K + 1 non-zero N-point DFT coefficients.
Blackman window
thumb|480px|right|Blackman window;
Blackman windows are defined as
:<math>w[n] = a_0 - a_1 \cos \left ( \frac{2 \pi n}{N} \right) + a_2 \cos \left ( \frac{4 \pi n}{N} \right),</math>
:<math>a_0=\frac{1-\alpha}{2};\quad a_1=\frac{1}{2};\quad a_2=\frac{\alpha}{2}.</math>
By common convention, the unqualified term Blackman window refers to Blackman's "not very serious proposal" of (a<sub>0</sub> = 0.42, a<sub>1</sub> = 0.5, a<sub>2</sub> = 0.08), which closely approximates the exact Blackman,
Flat top window
thumb|480px|right|Flat-top window
A flat top window is a partially negative-valued window that has minimal scalloping loss in the frequency domain. That property is desirable for the measurement of amplitudes of sinusoidal frequency components.
See also
- Apodization
- Kolmogorov–Zurbenko filter
- Multitaper
- Short-time Fourier transform
- Spectral leakage
- Welch method
- Weight function
- Window design method
Notes
Page citations
References
Further reading
External links
- LabView Help, Characteristics of Smoothing Filters, http://zone.ni.com/reference/en-XX/help/371361B-01/lvanlsconcepts/char_smoothing_windows/
- Creation and properties of Cosine-sum Window functions, http://electronicsart.weebly.com/fftwindows.html
- Online Interactive FFT, Windows, Resolution, and Leakage Simulation | RITEC | Library & Tools
