Inconsistent PSD depending on window length

I think I've partly understood this effect. Any comments or corrections are welcome!

It is due to the choice of the window function, in this case Hamming. The effect is present with windows that do not go to zero at the edges, but disappears with Hann, Blackman or Tukey windows for example. Intuitively, the discontinuity in the windowed data (when considered periodic) is similar to a sawtooth wave and leads to broadband power. By using a wider window, the period of the wave is increased, which spaces out the harmonics and generally decreases the power per Hz.

I think we can also visualize this with respect to the Fourier transform of the windows themselves (e.g. Wikipedia) and spectral leakage. In general, windows with a discontinuity will have slow roll-off in the side lobes, which I guess explains why in this example we can see the leakage everywhere (at frequencies above the peaks) because it has higher amplitude than the 1/f^2 noise background. And increasing the window width "compresses" the window FT around the peak frequency, which reduces the leakage at a given (non-peak) frequency. So I think the effect would also happen with Hann, but it's hidden below the noise background because of the rapid roll-off.

So short solution: use a window with rapid roll-off, one that goes to zero at the edges. Hann, Blackman and Tukey are already implemented in Brainstorm, but we need to add the window function as an option in the PSD function/process.

PsdWindowEffects

4 Likes