What exactly is the "n-point DFT" that fft() computes?

186 ビュー (過去 30 日間)
Jonathan
Jonathan 2014 年 9 月 23 日
回答済み: Jonathan 2014 年 9 月 23 日
I am trying to understand exactly how matlab is computing the fft when you call fft(myData, N), where N < length(myData).
Is it basically doing something along the lines of FFT pruning, as described by: Pruned FFTs?
In other words, it is computing the "first K outputs of an N point FFT" as detailed in the above link from fftw.org?
Thanks

採用された回答

Jonathan
Jonathan 2014 年 9 月 23 日
I found a site where you can get intelligent answers to your questions: FFT Matlab - What is a N-point FFT?
If you are going to perform a N-point FFT in MATLAB, to get an appropriate answer, the length of your sequence should be lesser than or equal to N. Usually this N is chosen in power of 2, because MATLAB employs a Radix-2 FFT if it is, and a slower algorithm if it is not.
So, if you give a sequence of length 1000 for a 2056 point FFT, MATLAB will pad 1056 zeros after your signal and compute the FFT. Similarly, if your sequence length is 2000, it will pad 56 zeros and perform a 2056 point FFT.
But if you try to compute a 512-point FFT over a sequence of length 1000, MATLAB will take only the first 512 points and truncate the rest. If you try to compare between a 1024 point FFT and a 2056-point FFT over a [1:1000], you will get a similar plot.
So the moral: choose your N to be greater than or equal to the length of the sequence.

その他の回答 (1 件)

Youssef  Khmou
Youssef Khmou 2014 年 9 月 23 日
N is the number of points used to calculate the fft, it does not increase physical resolution but adds more point to the spectrum for more visual resolution, N is arbitrary.
  2 件のコメント
Jonathan
Jonathan 2014 年 9 月 23 日
編集済み: Jonathan 2014 年 9 月 23 日
Yes, I know. But how is it computing this when N<length(data)?
Youssef  Khmou
Youssef Khmou 2014 年 9 月 23 日
編集済み: Youssef Khmou 2014 年 9 月 23 日
for every element of the frequency vector X(f), it is a sum of X(t)*exp(-2*pi*j*t*f) where t lies in [1 M], M is the length of the signal, and f lies in [1 N], and N is the value chosen whether N > M or N< M.

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by