john
Guest
|
Posted:
Sat Dec 24, 2005 1:15 am Post subject:
Re: PSD Power Spectral Density |
|
|
JoseBioeng wrote:
| Quote: | Hi, I was reading some Matlab code in Matlab toolbox 'periodogram.m' and
'computepsd.m' and there are something that I cannt understand:
For 'onesided' calculation:
X=fft(x);
Pxx=abs(A).^2/length(A)/fs; %fs =sampling frequency.
%x is an even signal
Sxx=Pxx(1:nfft/2+1); %nfft is the number of samples in fft.
Sxx=[Sxx(1) 2*Sxx(2:end-1) Sxx(end)]; %WHAT 2 TIMES ONLY SAMPLES FROM 2 TO
% END-1!!!!!!!!!
Ok, I will appreciate all kind of cooperation.
Thanks in advance.
JOSEBIOENG
|
Half of the power is implicit in the mirror-image negative frequencies.
The first and last bin (DC and Fs/2) don't have mirror images, all the
power is already contained in those bins.
John |
|