# Windowing and the DFT

Some of the properties of the DFT that can lead to incorrect results can be improved by using a weighting (or window) function w(n) on the data. e.g.  ## Windows

If we simply truncate a signal in the time domain, then this will lead to ripples appearing in the frequency domain. One option is to alter the window function by which we truncate the signal with a function that produces less ripples. The ripples are caused when we convolve the two frequency domain representations together, so the windows frequency domain should have as few ripples as possible while still maintaining a rectangular shape as possible. This technique is used extensively in the design of digital filters.

Some common window functions are:

1. Rectangle.
2. Hanning.
3. Hamming. Gaussian.
4. Kaiser.
Taking each of these in turn...

## Rectangle

Yes its our old friend again, the rectangle window that we used to produce a finite signal from the infinite signal (basically used whenever any signal is sampled). The windows frequency response is just the same as it was back in the Theory of the DFT section. with the frequency response of: As you can see this frequency response has been drawn a little differently from earlier sections. This is to emphasize a particular point.

An ideal window function would have all the energy in the main lobe of the sinc function (around the y-axis) and decay to zero with no ripples.

Obviously the rectangle window doesn't seem to do this and will introduce ripples into the frequency domain so what we need is another window function.

## Hanning/Hamming Window

Another option is to use a Hamming or Hanning window function. Both of these windows are based on the same function with only a variable alpha determining the difference.

For alpha = 0.5 we get a HANNING window.

For alpha = 0.54 we get a HAMMING window. Which in turn has the frequency response of: As you can see from the graph, this window function has a broader and deeper main lobe (-32 dB), which means that more of the energy is in this main lobe and less is in the ripples. If there is less energy in the ripples then it means that the frequency response will also have less ripples, therefore a better function for windowing data.

The function for these two windows is: ## Kaiser Window

Another option is the Kaiser-Bessel window Function. This window is based upon a modified bessel function. This function has an infinite summation, however only the first 25 terms are needed to produce a respectable result. The equation for this function is: where This variable alpha is a trade-off between the side lobe level (the size of the ripples), and the main lobe width.

On to Intrepreting the results of a DFT or back to Spectral Leakage

or back to DFT Contents or back to Main Contents