07-11-2014 10:00 AM - edited 07-11-2014 10:19 AM
Hello, I have some recorded XY data points from different sensors. The X values are always time stamps, and the Y values are the different measured sensor values. Roughly all the XY curves start and finish at the same time (plus minus few seconds). Moreover, the curves are not equidistant, I mean the data points are not at the same time stamps. Also, some of them were recorded with 60sec, some others with 1 sec (etc...) sampling rate. Actually this is why I use an XY Graph to present these curves together.
I would like to examine some correlations, so I want to plot two arbitrary XY curve againts each other (so plot their Y values as a new XY graph curve). This procedure is abvious when we have equidistant curves, but here the data points are not at the same time positions, and also the number of them are not equal.
How would you this plotting? I am thinking about that, I could pick the first and last time stamp from the two curves' X values, and I would generate a new equidistant time stamp array to cover the whole range (with some point number which makes sense). After this, I have to make some interpolation on both original XY curves which transforms the original X and Y values to be placeable to the new X positions.
What would be the shortest way to do this in LabView? Or maybe someone has a more simple idea?
thanks for advice!
edit: I guess the "Interpolate 1D VI" is only what I need?
yep, so this is implemented, pls delete me question, this is trivial, i see now... 🙂
Solved! Go to Solution.
07-11-2014 11:00 AM
actually I got some problems using the 1D interpolate VI.
I have attached linked an example VI, with some saved data example. (here I do not care about the fact that the starting and ending time stamps are not totally the same, I just want to get equal number of points, and plot the resulted Y values against each other)
I get not enough memory error...What is wrong?
thanks!
link:
https://dl.dropboxusercontent.com/u/8148153/test1.vi
07-12-2014 08:04 AM
07-12-2014 08:08 AM
07-12-2014 10:11 AM - edited 07-12-2014 10:14 AM
hello,
Lets explain again. I have two XY datasets. X values are time stamps. Y values are some physical quantities. I would like to see how one physical quantity depends on the other one. Of course I can plot them on the same XY graph, actually I do it already. But the second step is to see some basic correlation (as a first approach I do not consider time lag between the effects), so I need to plot their ONLY Y values on a new graph, as X and Y, in order to see how one of the measured parameter correlated to the other.
About the dropbox link: I would be extremly happy, if I could attach VIs to my messages. But since there is a bug (?) in the NI forum, I cannot do this (I get some stupid error msg, like "the content of the file does not match with the extension", or something similar...)
edit: "dropbox is not usable" --> what do you mean, dropbox is not allowed to use in NI forum, or you cannot download the VI? It works for me...
07-12-2014 11:07 AM
07-12-2014 11:31 AM
ah, ok, it makes sense. I try as you adviced next time (i do not have the VI here at home), thanks!
07-12-2014 12:30 PM - edited 07-12-2014 01:02 PM
All you need is create a new (e.g. linear) time ramp that covers both time ranges at sufficient resolution, then interpolate both datasets against it.
Here is a quick draft.
Alternatively, you could also append the original two time arrays, sort them, and remove all duplicates to generate the new time ramp.
07-13-2014 11:54 AM
07-14-2014 04:18 AM
this time ramp function did the trick, thanks 🙂
A short additional question: why you use the complex number creator, instead of the Bundle function before the XYGraph?
Is there a performance gain?