PSD (Power Spectral Density), and Amplitude Spectrum with adjusted FFT

FFT computes PSD and one sided amplitude spectrum Y[f] of 1d signal


Updated 4 Sep 2013

View License

Function [fy]=FFT(y,Fs)

1)computes the Power spectral density and Amplitude spectrum (P(f),F(f))
of 1d signal y(t) with sample rate Fs (Nyquist rate) which is known% apriori. The results are plotted in 3 figures which correspond to simple
PSD,logarithmic PSD (dB) and Amplitude Specturm respectively.
Ampitude(f) = \/ PSD(f)

2)The usefulness of this function is the adjustment of the frequency axis.

3)The fast Fourier transform is computed with Matlab built-in function
fft, but for signals whose lengths <1000 points, one can use the nested
function y=Fast_Fourier_Transform(X,N) .

Demo :

f=[40 75];
Amp=[4.5 9.22];
N=(sigma/sqrt(2))* (randn(size(t))+j*randn(size(t)));
figure, plot(t,y),xlabel('time (s)'),ylabel('Voltage (v)'),
title(strcat('Signal corrupted with AWGN, \sigma=',num2str(sigma))),

in the M-file Demo_FFT:
1st Part : we compute the spectrum of sinusoidal signal Y(t) with frequency Fc
2nd Part : FFT[Y²(t)]

The demo is adjusted with sample rate Fs>=4*Fc.

Cite As

Youssef Khmou (2023). PSD (Power Spectral Density), and Amplitude Spectrum with adjusted FFT (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2007a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

errata : figure 2 is changed from semilogy(Frequency, Power) to 10*log10(Frequency, 10*log10(Power)) in Decibel .