spectral leakage using built-in fft
이전 댓글 표시
Hi,
I've been using matlab's built-in fft(), and spectral leakage has been a problem. However, my colleague, who's been using FORTRAN code straight out of Numerical Recipes in FORTRAN 77, did not get any spectral leakage whatsoever. I've checked, and his code does not apply any windowing. Without access to the actual code of the built-in function it's hard for me to determine the reason for this difference. What do you think it is?
My code, which is sampled almost directly from an example on the mathworks website
%FOR ALL i FILES IN THE FILE LIST temp=importdata([workdir, files(i).name]); file=temp.data;
time = file(:,1);
U=file(:,2);
npoints=length(time);
f = FS/2*linspace(0,1,NFFT/2+1);
fftu= fft(U,NFFT)/npoints;
NFFT=2^nextpow2(npoints);
Uf=2*abs(fftu(1:NFFT/2+1));
%PLOT Uf as function of f
Thanks! Tale
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Get Started with Signal Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!