Monday 30 May 2016

fourier transform - Why are there so many windowing functions?


Many windowing functions are listed here in the Mathematica documentation. I tried using a few to reduce leakage when computing a Discrete Fourier Transform. From what I could tell it made little difference which windowing function is used. Two of them that are very dissimilar are the BartlettHannWindow and BlackmanHarrisWindow. Could someone provide an example where the BarttletHannWindow is a very good choice, and another where the BlackmanHarrisWindow is a very good choice. That might help me understand why there are so many to choose from.




Answer



Aside from reduction of spectral leakage, there is a one major trade-off to be made when choosing a window function. Below you can see a figure with various parameters. Two of them are most important:



  • Main Lobe Width

  • Peak Side Lobe Level


enter image description here


Width of the main lobe affects resolution of your analysis. I am sure you know that multiplication in time domain is convolution in frequency domain. By default you always use rectangular window, which has frequency response in a form of $\mathrm{sinc}$ function.


For example it might be the case that two pure sinusoids (Fourier Transform being Dirac deltas) with frequencies being very close to each other, peaks can be very hard to distinguish and thus become one. On figure below I compared 4 window functions for two sinusoids separated exactly by 3 frequency bins. You can see how wide is the main lobe of Nuttall window and how it affects the separation, whereas Rectangular window is the window with narrowest possible width of main lobe (i.e. lowest Normalized Equivalent Noise Bandwidth - NENBW)


enter image description here



On the other hand level of first side lobe affects the ability to recognize adjacent frequencies when spectral leakage is present and side lobes of frequency with high amplitude are almost "covering" other frequency next to it with much lower amplitude:


enter image description here


And here is the trade-off... You can't get very low level of side lobes and very narrow main lobe, i.e. it's not possible to have window function with main peak like in rectangular window, and very low level of side lobes as in Nuttal window. Here is the comparison of some windows:


enter image description here


enter image description here


Apart from parameters mentioned above, there is more features such as:



  • Side Lobe Roll-off rate (how fast side lobes decrease - for example see Bartlett and Nuttal above)

  • Existence of analytical frequency response equation (useful when performing theoretical calculations)

  • Summing of window samples to constant value in time domain when doing overlap (for example Hann window with $33\%$ of overlap)



enter image description here


This is extremely useful when you want to perform STFT and then reconstruct time domain signal.


So now to answer your question. Why do we have so many window functions?


Depending on task whether it is simple FFT analysis of: closely spaced sinusoids, white noise, impulsive sounds, or even FIR filter design, different type of window is recommended. Obviously in 90% of cases people are using Hamming/Hanning window or no window at all. Nevertheless for some specific signals you might find that extracted features depending on window choice tend to be more discriminative.


For more info about Window Functions please refer to:



F. J. Harris - On the Use of windows for Harmonic Analysis with the Discrete Fourier Transform


G. Heinzel, et al - Spectrum and spectral density estimation by the DFT, including a comprehensive list of window functions and some new flat-top windows


M. Cerna, A. F. Harvey - The Fundamentals of FFT-Based Signal Analysis and Measurement



H. A. Gaberson - A Comprehensive Windows Tutorial



No comments:

Post a Comment

readings - Appending 内 to a company name is read ない or うち?

For example, if I say マイクロソフト内のパートナーシップは強いです, is the 内 here read as うち or ない? Answer 「内」 in the form: 「Proper Noun + 内」 is always read 「ない...