Azzera filtri
Azzera filtri

Understanding FFT Results from Excel Data

9 visualizzazioni (ultimi 30 giorni)
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!

Risposta accettata

dpb
dpb il 11 Giu 2020
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 Commenti
Mitchell Berthelot
Mitchell Berthelot il 15 Giu 2020
Here is my time domain signal that makes up the data_set which have set equal to the variable S:
I do not believe that this would be considered a stationary signal based on what you said and what I have read. Does this mean that is nessary for me to detrend the data points before performing an FFT? Is using a MatLab command such as smoothdata() sufficent?
When you say to subtract the mean from the original signal is this what you are referring too?
S = Data_Set;
avg = mean(Data_Set);
n_S = S - avg;
I am not positive this is correct as my points are now ranging from approximately 0.1 to -0.1.
In regards to my sampling frequency, does it need to match the sampling frequency of my time domain signal? That is the only reason that I am setting my sampling period to 600 resulting in a very low sampling frequency.
I am trying to learn what frequencies are present in the signal in hopes to match them to the frequencies in the other proccess happening before the sensor. The idea is that it would allow me to pinpoint exactly what is affecting the change in thicknesses.
dpb
dpb il 15 Giu 2020
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.

Accedi per commentare.

Più risposte (0)

Tag

Prodotti


Release

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by