04-22-2009 01:37 PM
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?
04-22-2009 01:44 PM
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.
04-22-2009 01:46 PM
04-22-2009 01:58 PM - edited 04-22-2009 02:07 PM
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.
04-22-2009 02:36 PM
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?
04-22-2009 02:45 PM
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.
04-22-2009 02:59 PM - edited 04-22-2009 03:02 PM
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?
04-22-2009 03:13 PM - edited 04-22-2009 03:19 PM
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?
04-22-2009 03:36 PM
04-22-2009 03:38 PM