fft(x), why divide with L?

31 ビュー (過去 30 日間)
도연 원
도연 원 2022 年 10 月 12 日
コメント済み: Star Strider 2022 年 10 月 15 日
Hello, everybody.
Let me just introduce myself, I am kind of newbie of fft world!
Currently reading books and searching thru the internet, but I really can't find out how below things work.
In the help, fft function(->link). there are examples.
the first example, it says;
Fs = 1000; % Sampling frequency
T = 1/Fs; % Sampling period
L = 1500; % Length of signal
t = (0:L-1)*T; % Time vector
S = 0.7*sin(2*pi*50*t) + sin(2*pi*120*t);
X = S + 2*randn(size(t));
and for this signal, do fft.
Y = fft(X);
and
P2 = abs(Y/L);
I really don't know why divide Y with L?
the FFT formula I know, there is no dividing with L.... Why should I divide with L??
Please anyone can kindly tell me...?
Thanks!

採用された回答

Star Strider
Star Strider 2022 年 10 月 12 日
The Fourier transform uses repeated summations of the original vector to create the transform vector. Dividing my the length of the original vector normalises the summations, resulting in an accurate estimate of the various frequency components. This is discussed more completely in the Wikipedia article on the Discrete Fourier transform in the section on Motivation.
  2 件のコメント
도연 원
도연 원 2022 年 10 月 15 日
Okay, let me read it, thanks!
Star Strider
Star Strider 2022 年 10 月 15 日
My pleasure!

サインインしてコメントする。

その他の回答 (1 件)

dpb
dpb 2022 年 10 月 12 日
編集済み: dpb 2022 年 10 月 12 日
The short answer is "Because!" <VBG>
The story behind the answer is in the reference document for the FFTW routine that MATLAB uses to compute the FFT.
The link is in the documentation "References" section and going there will take you to everything (and more) that you could ever possibly want to know about FFTW.
But, the answer to your Q? (which just expounds on "Because!" a little) is in the FAQ list at <FFTW FAQ 3.10>.
Another <conversation> within the last few days also points out that for correct energy conservation do NOT divide by the total N of the FFT but by the L of the input signal when N>L for zero-padding of the FFT for higher resolution/interpolation in the frequency domain.
  1 件のコメント
도연 원
도연 원 2022 年 10 月 15 日
Thanks for the reference, let me give it a check!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeFourier Analysis and Filtering についてさらに検索

タグ

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by