LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"I have two arrays of points, when i plot them there´s an intersection point, but this point doesn´t belong to any arrays. I need to find the both value of this point, X and Y. Thanks."

The problem is that i have two curves of points, and this curves aren´t functions. So the intersection point may not be one of the array points (probable), and thats the problem. My type of acquisition is on real time, so i need a fast method to do that. I am using labview 6i.Thanks.
0 Kudos
Message 1 of 6
(4,262 Views)
You are going to have to get into some serious algebraic equations here.

Unfortunately, LabVIEW does not contain any intersecting points algorithms. Additionally, unless you have a library of good math books, they are quite difficult to find.

I did find a website that had a great number of mathematical algoritms on it but I cannot remember the URL for it, or even a title or other information that may lead to this website. I'm sure you could find it if you did a search for it.

I did create an algorithm for finding the intersection of two points, but as it took my over 10 hours to create, troubleshoot and test, I cannot just give it away. I will say that it was rather difficult, and involved the use of a formula node. Of course, this algorithm was o
nly to find the intersection of two straight lines.

A trick you could use to get around this is to do a search algorithm in your two arrays to find the point between (or at) two points in the arrays where the values would be the same for each axis. It won't be easy, but it can be done. Then, an interpolation method can be applied to find the intersection, but it won't be accurate, as the points would be based on straight lines, not curves. Still, it may be close enough, unless you need higher accuracy.

I hope this helps. Good luck, and let us know how you do. Also, if you find a good website for formulae like this, please post it here.
Message 2 of 6
(4,262 Views)
> "I have two arrays of points, when i plot them there´s an
> intersection point, but this point doesn´t belong to any arrays. I
> need to find the both value of this point, X and Y. Thanks."
>
> The problem is that i have two curves of points, and this curves
> aren´t functions. So the intersection point may not be one of the
> array points (probable), and thats the problem. My type of acquisition
> is on real time, so i need a fast method to do that. I am using
> labview 6i.Thanks.

It sounds like you have two amplitude arrays that share the same X
coordinate. If that is the case, it makes this a much simpler problem.
Let's call one array A, and the other B. You can either loop
through in a simple state machine looking for the pair of points where
A
used to be larger, but now B is, or where B used to be larger but now A
is. Given these two points, you can find an intercept between the two
lines. If you want to try to interpolate some more, include more points
on either side of the intersection, fit a polynomial, and intersect the
polynomials. Obviously the linear case will be much faster.

For simpler coding, you might be able to look at the first points,
compute A-B or B-A, then use Threshold 1D Array with zero as the Y
value. I mention the A-B and B-A because the threshold works to find
upwards crossings only.

Greg McKaskle
0 Kudos
Message 3 of 6
(4,262 Views)
Do you need to use any specific type of interpolation?

E.g. Linear, Quadratic, any other?

Are the Y coordinates the same for both arrays of points?

E.g. are both signales sampled with the same speed, and on the same time?

If the interpolation can be linear, and the Y coordinates of both signals
are the same, it shouldn't be to hard (let us know, then we can come up with
something).

Regards,

Wiebe.


"msbalen" wrote in message
news:506500000008000000DD5B0000-1031838699000@exchange.ni.com...
"I have two arrays of points, when i plot them there´s an
intersection point, but this point doesn´t belong to any arrays. I
need to find the both value of this point, X and Y. Thanks."

The problem is that i have two curves of points, and this curves

aren´t functions. So the intersection point may not be one of the
array points (probable), and thats the problem. My type of acquisition
is on real time, so i need a fast method to do that. I am using
labview 6i.Thanks.
0 Kudos
Message 4 of 6
(4,262 Views)
If the X values are the same, the most straight forward way might really be to compare the difference of the two Y arrays value by value and see, where the the sign changes.
Otherwise you'll probably have to make the values into functions. Labview provides fitting functions for this. Then all you want to do is find the zeros of F1(x)-F2(X)=0; For linear approximation very simple, for Polynoms there are functions as well.

I played around a bit. It's unfinished but you'll see the way.
Gabi
7.1 -- 2013
CLA
0 Kudos
Message 5 of 6
(4,262 Views)
I'm going to assume that you are plotting each 'function' against its index.
So the x-axis goes from 0 to one less than the size of the array. I think I
would first subtract one array from the other. Then find the index of the
point where the result changes sign. Now you have the two indices
surrounding the intersection (that point and the previous one). Calculate
the formula for the line between the two points for each function. Then
find the intersection point for the two lines. voila!
0 Kudos
Message 6 of 6
(4,262 Views)