FFT, double sided amplitude spectrum, documentation.
29 ビュー (過去 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!
1 件のコメント
回答 (2 件)
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.
0 件のコメント
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.
1 件のコメント
参考
カテゴリ
Help Center および File Exchange で Fourier Analysis and Filtering についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!