Understanding FFT Results from Excel Data
조회 수: 7 (최근 30일)
이전 댓글 표시
I am trying to take the FFT of some data I have in excel. However the results that I am getting do not make sense to me. First, below is the plot that is generated when plotting the FFT:
The first indication to me why this does not appear to be correct is that the frequency is 0. There are two reasons why I think this could be the case (possibly both):
1) My initial conditions are incorrect due to wrong assumptions (i.e sampling period and sampling frequency)
Ts = 600; %Sampling period
Fs = 1/Ts; %Sampling frequency
L = 79; %Length of Signal
S = Data_Set; %Array of doubles
The sampling period was calcuated as I know that each point was recorded after 10 minuets for a total of 79 points. I then converted this into seconds resulting in 600. This is an immediate red flag as now my calculated sampling frequency is almost 0. How do I get around this or how do I need to think about this differnely?
2) Error in my code
L2 = 2^nextpow2(L);
ff = fft(plot_Data,L2);
fff = ff(1:L2/2);
xfft = Fs*(0:L2/2-1)/L2;
plot(xfft,abs(fff));
This is the code that I have written to generate the plot that was posted above. Any insight into my questions above would be much appreciated!
댓글 수: 0
채택된 답변
dpb
2020년 6월 11일
It goes through a complete example including computing the associated frequency vector. If you're sampling at 1/10 min, your frequency will be quite low -- 1/10 min --> 1/600 sec --> 1.67 mHz (that's little "m" milli, not big "M" mega) Hz.
The large component at 0 Hz means you also have a nonzero mean -- that's the DC component.
Subtract the mean(S) from S before doing the FFT to remove it...of course you should always plot and examine the time series first...is it stationary or do you need to detrend as well?
What are you measuring at such a slow sample rate? Trying to do frequency analyses of such slow phenomenon is probably not going to work without days of observations, and may not well then depending on just what you're trying to measure (and how).
댓글 수: 4
dpb
2020년 6월 15일
No, that isn't stationary -- there are at least two if not three distinct plateaus and maybe more...
Yes, when you subtract the mean you center the signal. Doesn't matter; the energy is still there everywhere except you've removed DC.
Your sampling frequency is how often you take a measurement -- you know (and can know) nothing about anything faster than that -- if you're trying to measure the process, you have to have some way to collect data that is rapid enough to measure whatever it is that is going on.
Whatever the process, it's not likely this will uncover anything related to mechanical process that you can relate to a given component like a bad bearing or whatever -- those will undoubtedly be frequencies in the 100s to 10s of kHz range that would take that kind of sample rate to isolate.
These kinds of measurements are more akin to what you _might_ be able to track/control with quality control charts and those kinds of methods; particularly if you can control things in the process and observe changes.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 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!