09-24-2013 05:43 AM
Hi all,
I'm having trouble with splitting my bitstream, my bitstream should be like this:
It is a 1D array of 100Mbit or more of "1" or "0". (coming from a file)
1). First, I need to check if there is "1" (orange) coming after many zeros (yellow).
2). Then, if its there, I need to save the next 1308 bit into 109 different files (12 bit each, converted into an integer value).
3). Then, check again, back to step 1.
It sounds easy, but yet, I still dont get it right.
The other thing is, how should I split my 100Mbit into smaller pieces when I dont really know how many zeros (yellow) is there.
I have a VI with me trying to do it, but it runs very slow to execute 100Mbit.
regards,
Yan.
09-24-2013 07:47 AM
1). First, I need to check if there is "1" (orange) coming after many zeros (yellow).
How many are many? If it's more than 15 it would be the 1st byte with 0's (as the other bits could land in the byte before/after). Would this pose a problem with the 12 bit data, or can they include 8 bits? If it's longer it should be easier.
As for performance it'd probably be efficient to handle data as bytes instead of individual bits.
/Y
09-24-2013 07:57 AM
Hi Y,
this "many" could be variable, thats why im having trouble in splitting the bitstream in the first place.
However they will be there after 1309 bits.
I was thinking to index the file read with 1, but i think it would take too long to read out 100 Mbit and split them into 109 different files.
regards,
Yan.
09-24-2013 09:04 AM
So basically:
open 109 file refs
Loop
- look for 1st byte != 0
- extract 1309 bits
- write to files
End loop
Close files
/Y
09-24-2013 09:09 AM
Exactly! with conversion of each 12 bit into an integer value.
how do you do it in LabVIEW?
regards,
Yan.
09-24-2013 09:12 AM - edited 09-24-2013 09:15 AM
Either logical functions (AND) on a bigger integer to filter out the correct bits (which'd include typecast and stuff), or boolean array to int with 12 elements as a time. The latter is easier, but alot more memory consuming.
But, as they say, first make it run, then make it run fast. 😉
/Y