spectral leakage using built-in fft
Ältere Kommentare anzeigen
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
Antworten (0)
Kategorien
Mehr zu Get Started with Signal Processing Toolbox finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!