Periodogram help in Matlab

darthsidious

Senior member
Jul 13, 2005
481
0
71
I'm attempting to implement my own periodogram function in matlab (for a project), to estimate the PSD of a discrete signal of length 2048 given to me. I noticed something interesting with Matlab's Periodogram function. When I call [Pxx w] = periodogram(v1), there is something funny with Pxx. According to the formula for calculating a periodogram, Pxx(1) (the sample at freq w =0) should be given by (abs(sum(v1)).^2)/2048 (I wrote this in matlab notation, the formula can be found in any spectral analysis book). But that isn't the case. The function I wrote matches the value.

Does this mean matlab's periodogram function is wrong (which I don't think is the case). So what could be reasons for this mismatch? Spectral Analysis gurus please help....

 

eLiu

Diamond Member
Jun 4, 2001
6,407
1
0
I don't know anything about spectral analysis, but if you type ''edit periodogram'' at the command prompt, it'll bring up MATLAB's implementation. Within periodogram there are more calls to other functions like ''computepsd''... so you can type "edit computepsd" into the prompt as well to bring up the code for that guy. MATLAB has a lot of user-viewable functions, and this stuff seems to be part of that.

If you can't find something, try using MATLAB's internal !grep command or Windows search.
 

darthsidious

Senior member
Jul 13, 2005
481
0
71
eeh, too much work ;)

Originally posted by: eLiu
I don't know anything about spectral analysis, but if you type ''edit periodogram'' at the command prompt, it'll bring up MATLAB's implementation. Within periodogram there are more calls to other functions like ''computepsd''... so you can type "edit computepsd" into the prompt as well to bring up the code for that guy. MATLAB has a lot of user-viewable functions, and this stuff seems to be part of that.

If you can't find something, try using MATLAB's internal !grep command or Windows search.