function Ps = Periodogram( Signal )
% Periodogram - Periodogram estimate for PSD of the input signal.
%
% Input:
%   Signal - samples of signal of interest
%
% Output:
%   Ps - estimated PSD
%
% Example:
%   Ps = Periodogram( Signal )

%% compute periodogram
% window eliminates effects due to abrupt onset and end of signal
Window = blackman( length(Signal) )';
Ps = fft( Signal.*Window, length(Signal) );
% swap left and right half, to get freqs from -fs/2 to fs/2
Ps = fftshift( Ps ); 
% return squared magnitude, normalized to account for window
Ps = abs(Ps).^2 / norm(Window)^2;