LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to plot the transitions within a 2D array?

Solved!
Go to solution

 

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.

Download All
0 Kudos
Message 1 of 5
(2,959 Views)

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

0 Kudos
Message 2 of 5
(2,949 Views)

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

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 5
(2,940 Views)
Solution
Accepted by topic author Ray.R

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.

 

 

Message 4 of 5
(2,933 Views)

 

Go for it Ray!

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 5 of 5
(2,927 Views)