LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

1D binairy array (I16) to 2D array

Hi,
I aquired 8 channels data with a samplerate of 500Hz, i made an edf data
format and want to read it again, my data is in data blocks of 500
samples each; so like this: ch1 -> 500 samples....ch2 -> 500 samples...
ch3 -> 500 samples... and so on till ch8 and then again ch1-> 500
samples (i have 4 seconds of data (4 x 8 data blocks of 500 samples))
now i want to display my data in a waveform graph, so i need to make a
2D array where there are 8 rows with each 2000 colums. But i do't know
how to make it!

Thijs
0 Kudos
Message 1 of 3
(2,598 Views)
There's not enough information here. The problem breaks down into two steps;
decoding a single datapoint from the incoming datastream and determining
which column (or row, in your strangely transposed case) to add that to. The
first depends on exactly how your data is arranged which you don't specify-
unless "edf" refers to a well defined standard of which I'm not aware.

For the second, I'd use a simple state machine. You have a while loop with a
case structure inside and two variables that propagate through shift
registers- one for the current channel and one for the current datapoint
within that channel. On each iteration of the loop you retrieve a single
datapoint and increment the datapoint counter. If the datapoint counter is
less than or equal to 500, then add the datapoint to the row for the channel
indicated in the "channel" variable, else increment the channel variable,
checking to see if it should wrap back to channel 1, and add the data to
that column. For efficiency pre-allocate an array of the required size,
initialise all the elements with "NaN" or "Inf" so bugs are more obvious and
use replace array element. Or replace array subset if you're in LV6 (which
makes my own carefully crafted "Replace array subset" redundant- the
drawbacks of progress)

There may be more efficient ways than the above depending on the details of
the data format.

Thijs Boeree wrote in message
news:3A24C37C.FBA9A22A@amc.uva.nl...
> Hi,
> I aquired 8 channels data with a samplerate of 500Hz, i made an edf data
> format and want to read it again, my data is in data blocks of 500
> samples each; so like this: ch1 -> 500 samples....ch2 -> 500 samples...
> ch3 -> 500 samples... and so on till ch8 and then again ch1-> 500
> samples (i have 4 seconds of data (4 x 8 data blocks of 500 samples))
> now i want to display my data in a waveform graph, so i need to make a
> 2D array where there are 8 rows with each 2000 colums. But i do't know
> how to make it!
>
> Thijs
>
0 Kudos
Message 2 of 3
(2,598 Views)
Thijs Boeree wrote:
>
> Hi,
> I aquired 8 channels data with a samplerate of 500Hz, i made an edf data
> format and want to read it again, my data is in data blocks of 500
> samples each; so like this: ch1 -> 500 samples....ch2 -> 500 samples...
> ch3 -> 500 samples... and so on till ch8 and then again ch1-> 500
> samples (i have 4 seconds of data (4 x 8 data blocks of 500 samples))
> now i want to display my data in a waveform graph, so i need to make a
> 2D array where there are 8 rows with each 2000 colums. But i do't know
> how to make it!
>
> Thijs

Hello,
in my opinion "reshape array" should do the trick. Its in the
functions:array palette
--
Pierre Meyer                        
0 Kudos
Message 3 of 3
(2,598 Views)