topic Re: How can I get a trustful FFT spectrum from an unevenly spaced time in LabVIEW
https://forums.ni.com/t5/LabVIEW/How-can-I-get-a-trustful-FFT-spectrum-from-an-unevenly-spaced/m-p/3354739#M986423
<P>Thank you Lynn.</P><P>So why do these results not show in the FFT spectrum. I expect to see a single peak corresponding to the periodicity.Why am I getting a broad logarithmic line instead?</P><P>The chaos should appear by comparing to spectra starting from very close points and after a while the 2 signal starts slowly to give very distinct signal without diverging completely (they can cross each other again).</P><P>Thanks,</P><P>Zied</P><P> </P>Wed, 05 Oct 2016 08:43:37 GMTziedhosni2016-10-05T08:43:37ZHow can I get a trustful FFT spectrum from an unevenly spaced time
https://forums.ni.com/t5/LabVIEW/How-can-I-get-a-trustful-FFT-spectrum-from-an-unevenly-spaced/m-p/3354442#M986313
<P>Hello,</P><P>I I trying to find the best frequency spectrum. I used the interpolation function to get evenly spaced time dt. But the frequency spectrum does not give me the right value (that I can get using the peaks detection function. I get an inverse logarithmic curve instead.</P><P>I used also extract tone function but it is not giving the right value too.</P><P>I attached the vi.</P><P>Thanks,</P><P>Zied</P><P> </P>Tue, 04 Oct 2016 16:11:02 GMThttps://forums.ni.com/t5/LabVIEW/How-can-I-get-a-trustful-FFT-spectrum-from-an-unevenly-spaced/m-p/3354442#M986313ziedhosni2016-10-04T16:11:02ZRe: How can I get a trustful FFT spectrum from an unevenly spaced time
https://forums.ni.com/t5/LabVIEW/How-can-I-get-a-trustful-FFT-spectrum-from-an-unevenly-spaced/m-p/3354484#M986329
<P>Zied,</P><P> </P><P>It would help a lot if we had some of your data. Please run your VI again so that the Signal and Time arrays contain typical data. Then from the Edit menu select Make Current Values Default and save the VI. Post that VI.</P><P> </P><P> </P><P>Edit: Please tell us what the "right values: should be and how you determine what they are.</P><P> </P><P>Lynn</P>Tue, 04 Oct 2016 17:27:49 GMThttps://forums.ni.com/t5/LabVIEW/How-can-I-get-a-trustful-FFT-spectrum-from-an-unevenly-spaced/m-p/3354484#M986329johnsold2016-10-04T17:27:49ZRe: How can I get a trustful FFT spectrum from an unevenly spaced time
https://forums.ni.com/t5/LabVIEW/How-can-I-get-a-trustful-FFT-spectrum-from-an-unevenly-spaced/m-p/3354495#M986334
<P>Your raw data is not very periodic. What exactly are you expecting as a result?</P><P> </P><P>Where is the data coming from and <STRONG>what is the FFT supposed to show</STRONG>?</P><P> </P><P>Your inteval is not a multiple of the wavelength, so you have spectral leakage. Also the first ~80 seconds is quite different from the rest.</P>Tue, 04 Oct 2016 18:10:05 GMThttps://forums.ni.com/t5/LabVIEW/How-can-I-get-a-trustful-FFT-spectrum-from-an-unevenly-spaced/m-p/3354495#M986334altenbach2016-10-04T18:10:05ZRe: How can I get a trustful FFT spectrum from an unevenly spaced time
https://forums.ni.com/t5/LabVIEW/How-can-I-get-a-trustful-FFT-spectrum-from-an-unevenly-spaced/m-p/3354540#M986347
<P>You are right. The signal starts not periodic but after certain variable time, it becomes periodic.</P><P>Actually the data comes from the integration of stiff differential equations. This is why the dt is not constant. So, I used the interpolation to overcome this problem.</P><P>The FFT is to show the frequency of the oscillations. I expect a peak corresponding to the frequency.</P><P>These data comes from certain chemical reactions and the imperfections of the periodicity should be normal at certain extend.</P><P>I attached the VI again with some real data as requested.</P><P>I am also wondering if the FFT can be used to compare 2 signal and detect if the phenomenon is chaotic.</P><P> </P><P> </P>Tue, 04 Oct 2016 19:37:56 GMThttps://forums.ni.com/t5/LabVIEW/How-can-I-get-a-trustful-FFT-spectrum-from-an-unevenly-spaced/m-p/3354540#M986347ziedhosni2016-10-04T19:37:56ZRe: How can I get a trustful FFT spectrum from an unevenly spaced time
https://forums.ni.com/t5/LabVIEW/How-can-I-get-a-trustful-FFT-spectrum-from-an-unevenly-spaced/m-p/3354636#M986388
<P>Once you remove the large initial transient, the data is rather periodic. </P><P> </P><P>What I did is rather similar to your approach. I created a time ramp with millisecond resolution (assuming that the times in the Time array are in seconds). Then I interpolated the Time and Signal data at the time points in that ramp. To remove the startup transient Array Subset is used with a threshold time set manually. I found that 110 seconds worked well.</P><P> </P><P>Both spectrum measurments and Extract Tone Information VIs give similar results. The first spectral peak is at 4.7 mHz with significant harmonics as would be expected from the waveform. That is one cycle every 213 seconds. The DC component could be reduced by subtracting the mean before the spectral analysis but it is probalby not worth bothering.</P><P> </P><P>There is some extra code left over from some things I tried and ended up not using. I did not take the time to remove it.</P><P> </P><P>Do you have any idea what the spectrum should look like when the system is chaotic?</P><P> </P><P>Lynn</P>Wed, 05 Oct 2016 00:26:32 GMThttps://forums.ni.com/t5/LabVIEW/How-can-I-get-a-trustful-FFT-spectrum-from-an-unevenly-spaced/m-p/3354636#M986388johnsold2016-10-05T00:26:32ZRe: How can I get a trustful FFT spectrum from an unevenly spaced time
https://forums.ni.com/t5/LabVIEW/How-can-I-get-a-trustful-FFT-spectrum-from-an-unevenly-spaced/m-p/3354739#M986423
<P>Thank you Lynn.</P><P>So why do these results not show in the FFT spectrum. I expect to see a single peak corresponding to the periodicity.Why am I getting a broad logarithmic line instead?</P><P>The chaos should appear by comparing to spectra starting from very close points and after a while the 2 signal starts slowly to give very distinct signal without diverging completely (they can cross each other again).</P><P>Thanks,</P><P>Zied</P><P> </P>Wed, 05 Oct 2016 08:43:37 GMThttps://forums.ni.com/t5/LabVIEW/How-can-I-get-a-trustful-FFT-spectrum-from-an-unevenly-spaced/m-p/3354739#M986423ziedhosni2016-10-05T08:43:37ZRe: How can I get a trustful FFT spectrum from an unevenly spaced time
https://forums.ni.com/t5/LabVIEW/How-can-I-get-a-trustful-FFT-spectrum-from-an-unevenly-spaced/m-p/3354846#M986461
<BLOCKQUOTE><HR /><LI-USER uid="249458"></LI-USER> wrote:<P>So why do these results not show in the FFT spectrum. I expect to see a single peak corresponding to the periodicity.Why am I getting a broad logarithmic line instead?</P><P> </P><HR /></BLOCKQUOTE><P>You only get a single peak if the signal is sinusoidal. Your signal is not. To get the complicate shape of each period you need a significant amount of higher harmonics, i.e. other frequencies.</P><P> </P><P>Overall, I don't think FFT is the right way to analyze your data.</P>Wed, 05 Oct 2016 14:19:48 GMThttps://forums.ni.com/t5/LabVIEW/How-can-I-get-a-trustful-FFT-spectrum-from-an-unevenly-spaced/m-p/3354846#M986461altenbach2016-10-05T14:19:48ZRe: How can I get a trustful FFT spectrum from an unevenly spaced time
https://forums.ni.com/t5/LabVIEW/How-can-I-get-a-trustful-FFT-spectrum-from-an-unevenly-spaced/m-p/3354945#M986508
<P>Thank you Altenbach.</P><P>If the FFT is not the right way to analyse this type of signal, do you suggest any other technique?</P><P>What do you think Labview can do for me to analyse this signal?</P><P>Cheers</P><P>Zied</P><P> </P>Wed, 05 Oct 2016 16:15:59 GMThttps://forums.ni.com/t5/LabVIEW/How-can-I-get-a-trustful-FFT-spectrum-from-an-unevenly-spaced/m-p/3354945#M986508ziedhosni2016-10-05T16:15:59ZRe: How can I get a trustful FFT spectrum from an unevenly spaced time
https://forums.ni.com/t5/LabVIEW/How-can-I-get-a-trustful-FFT-spectrum-from-an-unevenly-spaced/m-p/3354950#M986511
<P>This is not a LabVIEW problem, but an analysis problem independent of the programming language used.</P><P> </P><P>Do you have collection of real or simulated datasets that show the various states that you need to distiguish? How variable is the atomic shape of a single period? What is the possible range of the fundamental frequency? can you measure for a longer time, e.g. more periods?</P><P> </P><P>Does the system go from normal to chaotic in a single trace or is every trace either one or the other?</P><P> </P><P> </P>Wed, 05 Oct 2016 16:23:51 GMThttps://forums.ni.com/t5/LabVIEW/How-can-I-get-a-trustful-FFT-spectrum-from-an-unevenly-spaced/m-p/3354950#M986511altenbach2016-10-05T16:23:51ZRe: How can I get a trustful FFT spectrum from an unevenly spaced time
https://forums.ni.com/t5/LabVIEW/How-can-I-get-a-trustful-FFT-spectrum-from-an-unevenly-spaced/m-p/3354981#M986521
<P>Actually Have hundreds of datasets of these oscillations with various amplitude and frequency.</P><P>I think the shape of the period can change slightly among the datasets.</P><P>My objective is actually to evaluate how broad is the range of frequency.</P><P>Indeed, I can measure for much longer time the oscillations.</P><P>The last question is tricky and I think that both phenomena can happen as the signal can start steady then periodic then chaotic then periodic...and obviously, this behaviour change from one signal to the other.</P><P> </P>Wed, 05 Oct 2016 17:54:55 GMThttps://forums.ni.com/t5/LabVIEW/How-can-I-get-a-trustful-FFT-spectrum-from-an-unevenly-spaced/m-p/3354981#M986521ziedhosni2016-10-05T17:54:55ZRe: How can I get a trustful FFT spectrum from an unevenly spaced time
https://forums.ni.com/t5/LabVIEW/How-can-I-get-a-trustful-FFT-spectrum-from-an-unevenly-spaced/m-p/3355149#M986577
<P>I didn't had a look on your data, but from what is told, I'm with altenbach: I don't think that FFT is the golden tool for you.</P><P>Uneven datapoints .. my fist idea was a sine fit , or more general: create a function with a sine a linear part, slice your data into parts with about 2 or 3 expected periodes, feed them into a LM-fit , ....</P><P> </P>Thu, 06 Oct 2016 06:23:47 GMThttps://forums.ni.com/t5/LabVIEW/How-can-I-get-a-trustful-FFT-spectrum-from-an-unevenly-spaced/m-p/3355149#M986577Henrik_Volkers2016-10-06T06:23:47Z