FFT faulty results for high frequencies !

4 views (last 30 days)
Ali Moghadam
Ali Moghadam on 27 Aug 2014
Answered: Jacob Capra on 28 Aug 2014
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 Comments
Ali Moghadam
Ali Moghadam on 27 Aug 2014
I have an Idea : it might be because of the number of samples. because I have 10000 samples in each package it is like that I have sampled with 10KHz. as FFT need the sampling fequency of at least 2 times of the highest frequency it causes the faulty results ! am I right ? is there still sth affecting my results ?
Jacob  Capra
Jacob Capra on 28 Aug 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.

Sign in to comment.

Answers (1)

Jacob  Capra
Jacob Capra on 28 Aug 2014
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.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!