# Difference between revisions of "Windowing"

### Short Topical Videos

• [to come] (by Zaki Ali)]

# Windowing Functions

WINDOWING FUNCTIONS

## 1 Spectral Leakage

Suppose we are taking a discrete Fourier transform(DFT) of a signal. When taking the DFT for the signal, we can only sample it for a finite time (the Fourier transform of a function is defined for infinite time). This leads to some unwanted features. Because we are only sampling the signals for a finite time, we need to assume something about the signal outside of this interval. The DFT implicitly assumes that the signal repeats. This causes discontinuities at the edges of the sampled signal. Fourier transforms of discontinuities lead to broad frequency structure. For an example, see figure 1 and 2. Notice the leakage of power in the neighboring spectral bins. This is "spectral leakage". The time series signals. The top window shows the real time signal in the ’infinite’ limit. The middle window shows that actual sampled wave that we feed into the FFT. The bottom window shows what the FFT thinks the signal is : infinitely repeated sampled signal. The Fourier transform of the sine wave that does not have sharp discontinuities (top). The FFT of the sampled sine wave, which has sharp discontinuities.

## 2 Windowing

Windowing is a way to minimize spectral leakage by tapering off the ends of the sampled waveform to 0. This is nothing new, and in fact when we take a regular ol’ FFT (the fast Fourier transform algorithm that implements a DFT efficiently), we are in fact multiplying by a windowing function. This windowing function is a square windowing function which is described as being 1 if in the sampled window, and 0 otherwise. Hence, we can write the Fourier transform as

${\hat {f}}=\int {W(t)f(t)e^{-2\pi {j}\omega {t}}}={\hat {W}}\star {\hat {f}},\,\!$ where $\star$ is the convolution function and ${\hat {}}$ denotes the Fourier transform. $W$ is the windowing function. Note that the windowing function can either be defined in time space or frequency space. The same term refers to both spaces. The result above follows from the convolution theorem.\

As we noted above, the sharp discontinuities at the ends of the sampled waveform are what cause spectral leakage. To minimize this we can use a different windowing function that tapers off to zero at the ends. This will minimize discontinuities. Some popular windowing functions include the Hanning and Hamming windowing functions, see figure 3 and 4. \ The hanning window and its frequency response. The frequency response is the Fourier transform of the window function on a test tone. The hamming window and its frequency response. The frequency response is the Fourier transform of the window function on a test tone.

One way to think about spectral leakage is that it is a spreading out of energy/power over spectral bins by the windowing function. The contribution of the spectral bin to its neighbors is the weight of the window function (in frequency space) centered at the given frequency component evaluated at the FFT bin in question. Another way to think about it is to think about the FFT as a series of filters centered on a specific spectral channel. Then the FFT filters response at that spectral channel is given by the windowing function (in frequency space). Therefore, each spectral bin includes signal from all other frequencies in the filters bandwidth.\

## 3 Noise Equivalent Bandwidth

Note that for non square window functions are tapering off at the ends and hence we are in effect throwing away information about the signal. Specifically, we are decreasing signal to noise. One way to quantify this, is the talk about the Noise Equivalent Bandwidth : the bandwidth (of the non rectangular windowed function) that gives us the same amount of noise power as the rectangular window did. Numerically,

$NEB={\frac {B}{B_{eq}}}\,\!$ There is also a concept of the Signal Equivalent bandwidth. By the radiometer equation, this is just given by the square root of the Noise Equivalent Bandwidth. Hence the NEB is always greater than the SEB. Therefore, there is a crucial trade off for windowing functions. The narrower your window is, the greater your NEB is and hences the lower your signal to noise is going to be. Depending on your needs, you need to pick your windowing function wisely.