11-29-2011 08:45 AM - edited 11-29-2011 08:49 AM
I need to overlay the Eye Diagrams over graph.
Each loop iteration (in response to an event) will bring new 2D data which looks like the following:
1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 0 1 1 1 1 1
1 1 1 0 0 0 0 0 1 1 1
1 1 0 0 0 0 0 0 0 1 1
1 1 1 0 0 0 0 0 1 1 1
1 1 1 1 1 0 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1
I need to find each where the transitions occur on both the x & y-axis.
In other words, where the 1's turn to 0's.
The graph would look like this:
In the next iteration, the 2D array could look like this:
1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 0 0 0 1 1 1 1
1 1 0 0 0 0 0 0 0 1 1
1 1 0 0 0 0 0 0 0 1 1
1 1 0 0 0 0 0 0 0 1 1
1 1 1 1 0 0 0 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1
Which would result in the following overlay in the graph:
And a third iteration could have the following 2D array:
1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 0 1 1 1 1 1
1 1 0 0 0 0 0 0 0 1 1
1 1 0 0 0 0 0 0 0 1 1
1 0 0 0 0 0 0 0 0 0 1
1 1 0 0 0 0 0 0 0 1 1
1 1 0 0 0 0 0 0 0 1 1
1 1 1 1 0 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1
Producing this third overlay:
... and so on...
What I came up with seems to be overly complex and consisted of two For loops... I didn't finish coding it yet as I figured there may be a better way using matrices. My matrix / calculus days are far from my memory..
Finding the transition point for a given 2D array would be great.
In the meantime, I will see if I can improve / complete what I started.
Solved! Go to Solution.
11-29-2011 09:00 AM
Well... as I feared... My solution is close, but has a few missing points.
Basically I have 2 For Loops. I X-OR within the inner loop the two sequential elements.
The problem is that when the values are the same, ie: 0 0 0, I only get the first transition.
So there are blank spaces.
So I figured I could transpose the array and do the same but from a column point of view.. Transpose that result and then AND the two resulting arrays.. (what a mess).
I could post what I have thus far and you could see, but if you know the solution, you already know what I am talking about.. 😉
11-29-2011 10:00 AM
That sounds like the absolute value of a 2d derivative where all non zero values are force to "1".
For small sample sets you could just present the 2D array to a For loop that does the derivative on each row.
Transpose the orignal array and do the same thing.
Transpose the second then add it to the first.
Add the two arrays.
Ben
11-29-2011 10:54 AM - edited 11-29-2011 10:55 AM
Hi Ben,
I knew you'd suggest something 🙂
This is what I came up with. It does not look at Rubby as I initially thought it would.
I wanted to avoid a Rube G at all cost. 😄
There probably is a better way of doing this.. But for now, it's ok.

11-29-2011 11:13 AM
Go for it Ray!
Ben