Skip to content

Analysis Window

Analysis windows are used when we only want to consider a finite part of a large, potentially infinite signal, often for performing a Spectral Transformation. A window in its simples form can just be the signal, multiplied with a rectangular function. However, this will lead to Spectral Leakage#Windowing in almost all cases. To mitigate this issue, more sophisticated windows can be used to decrease the spectral leakage. Most of them taper of to zero at the cut-off points to mitigate the Spectral Leakage due to the impulses in the periodically extended signal fragment.

Overlap

An important requirement for a window is that it is time-limited and that its superposition for all frame-shifts adds up to a constant value:

Pasted image 20240514151939.png

This assures, when reconstructing the signal from its Fourier Transformation#Short Time Fourier Transform (STFT) representation, that the energy introduced by the window overlaps is constant and can be accounted for when doing the inverse transformation.

However this only works, if there are no modifications done in the spectral domain. In cases where we do modify the frequencies, we need other methods to deal with the overlap. Two methods are overlap-add and overlap-save, both shown here with the example of convolution using Fourier Transformation#Fast Fourier Transform:

Overlap-Add

One method to account for the overlap between windows is to

  • pad the filter with \(B\) zeros (\(B\) is the number of samples per block)
  • pad the input block with \(N\) zeros (\(N\) is the length of the filter) The filter and the block are FFT transformed and their spectra multiplied. When doing the inverse FFT, each out output block now contains only a part of the energy of the actual output. Subsequent outputs are now overlapped by \(N-1\) samples and added up to get the actual output. Screenshot 2024-05-14 154815.png Pasted image 20240514160916.png

Overlap-Save

The alternative to overlap-add is to use zero-padding only for the filter. The input blocks now don't have zeros where they overlap but actual signal values. The outputs are now not added up, but only the first b valid samples are kept and the rest is discarded.

Screenshot 2024-05-14 161101.png

Pasted image 20240514161604.png

Window Types

See https://en.wikipedia.org/wiki/Window_function#Examples_of_window_functions. Each windowing function represents a trade-off between noise bandwidth and the error in the maximal amplitude if the transformed signal. An overview for different window types, from this video by Siemens: Pasted image 20240513183903.png As can be seen, the #Uniform window introduces the smallest smearing across the frequencies, but the largest decrease in the maximal amplitude, making it hard to distinguish dominant frequencies. On the other hand, the #Flattop window smears a lot over the frequencies, but its maximal amplitude is very close to the true maximal amplitude. That makes it very useful in calibration tasks, where the frequency is known, but its amplitude must be adjusted for. The #Hanning represents a middle-ground between both.

Uniform

The uniform window is just a rectangular function. If it perfectly aligns with a period length of the input signal, it can perfectly capture the underlying frequencies. But this is rarely the case, which leads to a massive decrease in the energy of the dominant frequency.

Pasted image 20240513185310.png

Hanning

The Hanning (or also Hann) window represents a trade-off between lower spectral resolution but retaining the energy of the dominant frequency.

Pasted image 20240513185704.png

Flattop

The Flattop window has only a minimal error in maximal amplitude, but a bad spectral resolution. That makes it well suited to calibrate a known frequency, but bad a exploratory analysis of a signal.