MATLAB: Obtaining amplitude values from an FFT

amlitudefft

Hi there, I have made a single-sided spectrum using FFT of a time-domain signal. From that FFT, I would like to somehow get the amplitude at each of the frequencies from the signal.
If I am outputting an FFT that looks like the attached plot, which has about 4 distinct peaks, what should I do with this plot to get amplitude? I got it using
S = fft(eta)
P2 = abs(S/nFFT);
Where nFFT is the number of sampling points and eta is a time-domain signal.

Best Answer

To get the _correct) amplitudes for a one-sided fft, you need to change your code to:
S = fft(eta)/nFFT;
P2 = abs(S)*2;
Then plot ‘P2’.
The reason is that the total energy in the signal is conserved in the total fft, that, because it is symmetric, will have half the energy at the positive frequency and half at the negative. You have to multiply the amplitudes of the one-sided fft by 2 to plot the correct amplitudes.
The units of the Fourier-transformed amplitudes (using the code I changed) are the same units as the original signal.
For a full discussion, see the R2015a documentation for fft (link).