FFT, double sided amplitude spectrum, documentation.

28 次查看(过去 30 天)
Hi,
Here is the link to the FFT documentation I am referring to: http://www.mathworks.com/help/matlab/ref/fft.html
In the very first example titled 'Noisy Signal'
The part where they find the FFT of the time domain signal, and in order to find the double sided amplitude spectra, why are they dividing the Fourier transform of the signal by 'L' which is the length of the signal. Is it some kind of normalization?
And then why is the single sided amplitude spectra scaled by 2. Following is the code I am referring to from the documentation (also see the documentation in the link provided):
% code
Y = fft(S);
P2 = abs(Y/L); % <--- Why divide by L????? L is defined as the length. See link.
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1); % <--- Why scale by 2??????
Thanks!

回答(2 个)

Aaron Marks
Aaron Marks 2017-5-25
编辑:Aaron Marks 2017-5-25
It seems to me that you take the absolute value to convert the value returned by the transform (a complex number as FFT performs a complex Fourier transform) to its complex modulus (magnitude).
You divide by L to scale the magnitude of the amplitude down. The FFT returns L amplitudes corresponding to L sinusoidals. In our case, all L of them are the same, so when we plot the power, all of the amplitudes add. If we took the FFT of one point on the same sinusoidal line, it would be the correct amplitude (since there is no other to add/ averaging by L, in this case, is equivalent to doing nothing). With L samples and L amplitudes, we need to essentially take the average of all of the L amplitudes to find the correctly scaled amplitude at each frequency.
We multiply by 2 again to scale the power. By definition, the area underneath the curve is the total power or variance of the function (depending on your domain). This is true whether you are looking at the double-sided or single-sided amplitude. The single-sided amplitude is the positive half of the double-sided one. If we are only looking at one-half of that curve but the total area under the curve must be equal to the entire curve (and they are symmetrical), we must scale up by a factor of 2.

Xu LinaM
Xu LinaM 2017-3-1
Hello,today I find some questions like yours, e.g.why must use fftshift when plot double-side Amplitude Spectrum ? where is the negative frequency after fft? About your question,first,I think the same to you,but it isn't obsolutely normalization,because the second higher height is bigger than one. Second,double-side Amplitude is twice as big as double-side Amplitude. Thank you.

类别

Help CenterFile Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by