FFT faulty results for high frequencies !
Afficher commentaires plus anciens
Hello all, I have sampled the 50Hz output current of an inverter with sampling frequency of 50 KHz for 1 minute. I am supposed to divide the time to 200ms packages(0.2s or 10 periods of the main signal)and do the FFT on each package. so it means that I have 10000 samples in each package (if not I zero pad or truncate ,that does not make a big difference). and I am supposed to extract the frequency spectrum up to 9 KHz. results are ok for low frequencies ,but I have wrong results (the values are the half of what for high frequency). could you help me to understand what am I doing wrong?!
may be some thing like the code below is hapenning to my fft. just change SF to 10000 and look how the results will be changed !
in this code if you change the SF(sampling frequency) from 30000 to 10000,
the results for high frequncies will be distorted and disordered . why ?
SF = 30000; %sampling frequency
% signal
t = 0:1/SF:1-1/SF; % sample points
wave=15*sin(2*pi*1*t)+1*sin(2*pi*123*t)+2*sin(2*pi*203*t)+3*sin(2*pi*223*t)+4*sin(2*pi*331*t)+5*sin(2*pi*2812*t)+6*sin(2*pi*5752*t)+7*sin(2*pi*7993*t);
wavefft = fft(wave);
L=floor(size(wave,2)/2)+1; % removing the mirror side of spectrum
MagSpec = abs(wavefft(1:L))/(SF/2); %%removing the mirror side of the spectrum
and ranging the domain
plot(MagSpec);
2 commentaires
Ali Moghadam
le 27 Août 2014
Jacob Capra
le 28 Août 2014
You are correct. That is called the Nyquist Condition , and it will affect your results by a factor of 2 in the frequency domain.
Your sampling frequency must be more than twice the highest frequency of the data being sampled.
Réponses (1)
Jacob Capra
le 28 Août 2014
0 votes
I'm not sure if this constitutes an answer, seeing as I also commented about it, but now you may close this I guess.
You are correct, referring to your comment. That is called the Nyquist Condition , and it will affect your results by a factor of 2 in the frequency domain.
Your sampling frequency must be more than twice the highest frequency of the data being sampled.
Catégories
En savoir plus sur Fourier Analysis and Filtering dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!