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

조회 수: 178 (최근 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 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