05-31-2014 08:03 AM
Hello,
I have a signal composed of 50.000 elements on my RT cRIO and i want to split this signal into 97 signals of 512 elements each. Is there a way to implement this using Labview Blocks? So far I implemented it using a MathScript and a for loop but the program is working very slow because of that.
Thx,
Valentina
Solved! Go to Solution.
06-02-2014 03:16 AM
What data type is your signal in at the moment (waveform? 1D array?)
How do you want to split the 50 000 points - do you want the first 512, then the next 512, or is your data interleaved somehow so that you want (0, 97, 194...), (1, 98, 195...) or something else?
What data type do you want the 97 signals to be when you've split them - 2D array (97 x 512), 1D array of waveforms, something else?
06-02-2014 03:33 AM - edited 06-02-2014 03:38 AM
My data type at the moment is 1D array. I want to split this signal into 97 signals, each of 512 elements. My data is not interleaved, i just want to take the first 512 elements and make a separate array with them, then the next 512 and so on. The data type i want to have for the splitted signals is also 1D array.
06-02-2014 05:33 AM
Here's a snippet with two ways of doing this - assuming you want to operate on your 97 subarrays one after another and not break them out into 97 different wires on the same diagram, which would be unwieldy to say the least!
The first one uses Split 1D Array in a while loop with a shift register, and Empty Array? from the comparison palette to determine when to exit the loop. The second one uses Reshape Array and a For loop with auto-indexing enabled - I'm not expert on this but I think the compiler might be able to paralellise that better, if performance is an issue.
Note that if your input array is not an exact multiple of 512 points then the first solution will give you a short array at the end while the second one as it stands will ignore the last <512 points - you'll need to modify whichever one you use if that isn't what you want.
06-02-2014 06:04 AM
Thank you very much