page_title: Window function
section_title: Comparison of windows
hierarchical_section_title: Window function / Comparison of windows
caption_attribution_description: English: Overlayed window functions in the frequency domain
context_page_description: In signal processing and statistics, a window function is a mathematical function that is zero-valued outside of some chosen interval, normally symmetric around the middle of the interval, usually near a maximum in the middle, and usually tapering away from the middle. Mathematically, when another function or waveform/data-sequence is "multiplied" by a window function, the product is also zero-valued outside the interval: all that is left is the part where they overlap, the "view through the window". Equivalently, and in actual practice, the segment of data within the window is first isolated, and then only that data is multiplied by the window function values. Thus, tapering, not segmentation, is the main purpose of window functions.
  The reasons for examining segments of a longer function include detection of transient events and time-averaging of frequency spectra. The duration of the segments is determined in each application by requirements like time and frequency resolution. But that method also changes the frequency content of the signal by an effect called spectral leakage.
context_section_description: When selecting an appropriate window function for an application, this comparison graph may be useful. The frequency axis has units of FFT "bins" when the window of length N is applied to data and a transform of length N is computed.  For instance, the value at frequency ½ "bin" (third tick mark) is the response that would be measured in bins k and k+1 to a sinusoidal signal at frequency k+½.  It is relative to the maximum possible response, which occurs when the signal frequency is an integer number of bins.  The value at frequency ½ is referred to as the maximum scalloping loss of the window, which is one metric used to compare windows.  The rectangular window is noticeably worse than the others in terms of that metric.
  
  Other metrics that can be seen are the width of the main lobe and the peak level of the sidelobes, which respectively determine the ability to resolve comparable strength signals and disparate strength signals.  The rectangular window (for instance) is the best choice for the former and the worst choice for the latter.  What cannot be seen from the graphs is that the rectangular window has the best noise bandwidth, which makes it a good candidate for detecting low-level sinusoids in an otherwise white noise environment.  Interpolation techniques, such as zero-padding and frequency-shifting, are available to mitigate its potential scalloping loss.
caption: Window functions in the frequency domain ("spectral leakage")
exif: {}