Given below is a function written in MATLAB for computing the modified periodogram, taken from Hayes, Statistical Digital Signal Processing and Modeling

function Px = mper(x, win, n1, n2)

x = x(:);
if nargin == 2
    n1 = 1; n2 = length(x);

N = n2 - n1 + 1;

switch win
    case 1
        w = rectwin(N);
    case 2 
        w = hamming(N);
    case 3
        w = hanning(N);
    case 4
        w = bartlett(N);
    case 5
        w = blackman(N);

xw = x(n1:n2).*w/norm(w);
Px = N*mypdg(xw);

Can anyone explain what is going on in second last line of the code xw = x(n1:n2).*w/norm(w)

Is dividing by norm necessary to compute xw?


Yes it's explicitly necessary to normalize the periodogram for non-rectangular windows. However I cannnot see the mypdg script in the book ?

From Monson Hayes's book Statistical Digital Signal Processing and Modeling , chapter 8 (spectrum estimation), Section 8.2.3 (modified periodogram), equations 8.49

$$ \boxed{ \hat{P}_M(e^{j\omega}) = \frac{1}{NU} \left| \sum_{n=-\infty}^{\infty} x(n)~ w(n) ~ e^{-j\omega n} \right|^2 }$$

and 8.50

$$ \boxed{ U = \frac{1}{N} \sum_{n=0}^{N-1} |w(n)|^2 }$$

define the scaling to correct the biasing of the periodogram estimate due to using nonrectangular windows.

Note that in the program norm is used during windowing stage before the FFT, so that after FFT and squaring, you will get norm square which is identical to $U$ above.

  • $\begingroup$ I forgot to mention, mypdg is the periodogram function given in the book. I changed the name to mypdg $\endgroup$ – MaxFrost Oct 27 '18 at 8:36
  • $\begingroup$ It would be great if you could provide the equation involving the use of norm or cite the explanation from the book? $\endgroup$ – MaxFrost Oct 27 '18 at 8:39

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.