FFT (fast fourier transform) matlab default example (need explanation)

조회 수: 1 (최근 30일)
John Bitzios
John Bitzios 2014년 8월 27일
댓글: Andy L 2014년 8월 28일
I try to figure out how the FFT command works on matlab and I came across this example that matlab central gives out at this link http://www.mathworks.com/help/matlab/ref/fft.html
Can somebody explain to me how this code works?? If not all the code than this part of it
NFFT = 2^nextpow2(L); % Next power of 2 from length of y
Y = fft(y,NFFT)/L;
f = Fs/2*linspace(0,1,NFFT/2+1); %why 2+1 ????
  댓글 수: 2
Yona
Yona 2014년 8월 27일
NFFT/2+1
is equal to
(NFFT/2)+1
in 0:10 you have 11 point because you have the start and stop too. so you need to add another point.
John Bitzios
John Bitzios 2014년 8월 27일
Thanks for the reply Yona! Can you explain the whole thing from top to bottom so I can get the whole picture?? That would help me a lot :)

댓글을 달려면 로그인하십시오.

채택된 답변

Andy L
Andy L 2014년 8월 27일
L is the length of your signal. It is used to determine the time vector t and so on. nextpow2 is used to pad the signal passed to fft - this speeds up it's computation compared to a signal not of that length. Your question RE line 3 was already answered.

추가 답변 (0개)

카테고리

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