LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2 non-equidistant XY curves to plot against each other

Solved!
Go to solution

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... 🙂

 

0 Kudos
Message 1 of 11
(3,607 Views)

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

 

0 Kudos
Message 2 of 11
(3,592 Views)
It seems to me that you may be over-thinking this a bit. The whole point of an XY graph in this situation is that the X values don't have to match. To see what I mean, create two datasets that both have y values of (1,2,3), but one has x values of (2,3,4) and the other has x values of (2.5,3.5,4.5). Now plot both datasets on the same XY graph.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 11
(3,575 Views)
Concerning your VI. Please attach it to a post, dropbox is not usable.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 11
(3,572 Views)

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...

 

0 Kudos
Message 5 of 11
(3,565 Views)
Many corporate users are blocked from such websites. Other users just don't trust them. Check your browser's security settings, use a different browser such as Chrome, try attaching as a zip file.
0 Kudos
Message 6 of 11
(3,556 Views)

ah, ok, it makes sense. I try as you adviced next time (i do not have the VI here at home), thanks!

0 Kudos
Message 7 of 11
(3,548 Views)
Solution
Accepted by topic author Blokk

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.

Download All
Message 8 of 11
(3,538 Views)
Thanks Christian, great example. I don't have access to my computer right now.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 9 of 11
(3,506 Views)

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?

0 Kudos
Message 10 of 11
(3,477 Views)