This example shows how to obtain nonparametric power spectral density (PSD) estimates equivalent to the periodogram using fft.
www.mathworks.com