It helped my understanding to actually write my own periodogram PSD estimation function for Matlab. Matlab's built in function has too many options and details that obscure the concepts.
function [x, p] = genPSD( signal, NumDataPoints, ScanRate, window_fun) halfn = floor(NumDataPoints / 2)+1; deltaf = 1 / ( NumDataPoints / ScanRate); %do the actual work z = fft(signal .* feval(window_fun, NumDataPoints) , NumDataPoints); %compensate for the norm of the window z = z' * (NumDataPoints / norm(feval(window_fun,NumDataPoints),1)); %generate the vector of frequencies xfreq = (0:(halfn-1)) * deltaf; x = xfreq'; %generate PSD psd = abs(z ./ NumDataPoints) .^ 2 / deltaf; % convert from 2 sided spectrum to one sided spectrum (assuming that the input is a real signal) p(1) = psd(1) ; p(2:(halfn-1)) = psd(2:(halfn-1)) * 2; p(halfn) = psd(halfn) ;
/' $I