From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

interleaving arrays

Hi,

 

Simple problem but I just can't wrap my head around it.

 

 

I searched for interleaving arrays I found someone who had done it and suggested that I tranpose the array.  I did but its not interleaving the way I would like.

 

 

Currently my vi will do this:

 

 

A[0], A[1], B[0], B[1] etc.

 

 

Basically it will spit out one array then the other but I would like the fallowing result:

 

 

A[0],B[0],A[1],B[1] and so forth.

 

 

Is there anyway for me to interleave my arrays (which can be more than 3) without completly redoing my vi?

0 Kudos
Message 1 of 16
(3,067 Views)

My first thought:

 

1) Decimate the array (using the decimate array fn):  Now you have A[0], B[0]

2) Now use the Rotate array fn to shift the first element in the array to the last element

3) Decimate the array again.  Now you have A[1], B[1]

4) Concatenate the two arrays.

 

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 2 of 16
(3,063 Views)
man I was afriad of that can you give me or point me to an example using decimation? I tried this with my current vi but I don't get any output on the graph.
0 Kudos
Message 3 of 16
(3,060 Views)

shoot..I tried adding this to the post above sorry.

 


MattBradley wrote:

My first thought:

 

1) Decimate the array (using the decimate array fn):  Now you have A[0], B[0]

2) Now use the Rotate array fn to shift the first element in the array to the last element

3) Decimate the array again.  Now you have A[1], B[1]

4) Concatenate the two arrays.

 


 

Ok maybe I am misunderstanding your procedure. When I decimate the array it gives me two outputs. I assume it does not matter which output I use to rotate the array. The rotate array function requires that I provide n (which i set to zero to rotate starting with n=0 element). I then take the output of this and decimate it again which I then feed into a graph. Corrrect?

 

 

**update***

 Ok I can't add this after I put in the parameters for thearray because each array has 3 elements which make up the array as such I will need to first let the vi build it. Holy hell this is getting complicated.

 

old update

 

man this is confusing. I will need to add this procedure BEFORE i beging to procces everything for the graph. Meaning as soon as the parameters are in place for the arrays I need to do this.

 

Message Edited by MrSafe on 04-22-2009 02:07 PM
0 Kudos
Message 4 of 16
(3,051 Views)

MrSafe,

 

I must admit I'm a bit confused as to what you are trying to accomplish.  The vi you posted creates the two pulse trains defined on the front panel and places them end to end.  Are you trying to create multiple pulse trains that each have their own plot?

0 Kudos
Message 5 of 16
(3,022 Views)

Wayne.C wrote:

MrSafe,

 The vi you posted creates the two pulse trains defined on the front panel and places them end to end.  Are you trying to create multiple pulse trains that each have their own plot?


More like 2 bursts (which contain pluses) which are end to end. I would like to have the vi alternate between each burst for example:

 

Burst One Pluse One, Burst Two Pluse One, Burst One Pluse Two, Burst Two Pluse Two etc.

 

 

 

 

 

 

0 Kudos
Message 6 of 16
(3,011 Views)

You just have to build your array that way.

 

What you are doing technically isn't interleaving as that is a specific term related to to arrays where you truly interleave array A and B as A(0), B(0), A(1), B(1).  You are basically interleaving chunks of arrays.

 

See attached.

 

 

One question is what do you do when you have unequal numbers of pulses.  You have 10 pulses of type 1, and 8 pulses of type 2.  What do you do when once you've create 8 pulses of each?

Message Edited by Ravens Fan on 04-22-2009 04:02 PM
Message 7 of 16
(3,005 Views)

i never really thought of that but the each array will always have the same amount of pluses..but i see your point this could be a problem if i decide to do arrays with differant values.  I am trying your suggestion in your attach image.

 

 

*update*

 I got it! XD it was not a interleave fn sorry. I can be blind at times.

*old*

I am having a hard time understanding why your feed the interleave fn the same signal twice?

Message Edited by MrSafe on 04-22-2009 03:19 PM
0 Kudos
Message 8 of 16
(2,990 Views)
Verify the number of pulses.  You want.  Since it is actually starting with 1 pair of pulses (going into the shift register from the first for loop) and adding 8 pairs to it, you get 9.  It was 8 being added because that was the # of pulses used in the last element of the cluster array.
0 Kudos
Message 9 of 16
(2,982 Views)
whoa..ok so its spitting out an incorrect number of pluses?
0 Kudos
Message 10 of 16
(2,976 Views)