MATLAB: Why is periodogram(y,w) not periodogram(y.*w)

MATLABperiodogramsignal processingwindow

why is periodogram(y,w) not the same as periodogram(y.*w), where y is the signal and w the window. For a rectangular window it is the same but for a hanning window there is a difference that has something to do with the mean and variance of the window I guess. What exactly is this difference? And why is this difference there? Same holds for pwelch.

Best Answer

The difference is that the syntax periodogram(y,w) uses the window normalization constant explained here:
Read about the modified periodogram.
While periodogram(y.*w) does not use that normalization because you are using a rectangular window
I would recommend using
periodogram(y,w)
However, if you look at the two periodograms, you'll see that one is simply a scaled version of the other and that scaling is due to window normalization you get with
periodogram(y,w)
Related Question