Hi, i am trying to read bdf data in my program, i have not being able to convert the 24 bit data (as described in the BDF format) into integer that makes sense. I did read all the header info right. So, i was wondering if there is an example of conversion anywhere. For example, the 3 bytes i read from the 256 hz sample data provided for channel 1, sample 1, is:
40 190 255 which is (LSB) 00101000 10111110 11111111 (MSB), how to convert this to an integer? Since the gain is 31nv/1uV, what voltage does it represent? From some other packages i have, it is around -526.6251uV, correct?
Thanks.
Dan
BDF Byte Reading c#
-
- Site Admin
- Posts: 1152
- Joined: Fri Mar 26, 2004 7:00 pm
- Location: Amsterdam, Netherlands
- Contact:
The answers is found in the LabVIEW code of the BDF reader. Add an extra least significant (zero) byte to generate an I32. In your example you will then have 00000000 00101000 10111110 11111111, with a value -8580096. Divide this by 8192 (256*32) to convert to uV. So, the first value is -1047.375 uV. (approx -1 mV)
Best regards, Coen (BioSemi)
Best regards, Coen (BioSemi)
-
- Posts: 1
- Joined: Wed Apr 02, 2008 7:41 pm
- Location: UC Davis
Can someone explain in more detail (and perhaps give a general case) how to convert from the integer value to the uV value.
In the previous example, why divide by 8192 or (256*32)? Is the 256 the sample rate and 32 the gain rounded up? If so, why round up? Also, would the duration (assuming it was not one second) effect the calculation?
Thanks!
In the previous example, why divide by 8192 or (256*32)? Is the 256 the sample rate and 32 the gain rounded up? If so, why round up? Also, would the duration (assuming it was not one second) effect the calculation?
Thanks!
-
- Posts: 17
- Joined: Mon Apr 21, 2008 10:58 pm
- Location: Italy
Hi, a question rise from this post.
Status channel data 255 0 28, in binary format
(LSB) 00000000 11111111 00000000 00011100 (MSB) [I32],
if I don't get wrong in the last byte (on the right) I can read that the speed bit 2, CMS and speed bit 3 are high....How can I conclude the speedmode set up in the front panel of Actiview (hardware side)?
Thanks very much!
Status channel data 255 0 28, in binary format
(LSB) 00000000 11111111 00000000 00011100 (MSB) [I32],
if I don't get wrong in the last byte (on the right) I can read that the speed bit 2, CMS and speed bit 3 are high....How can I conclude the speedmode set up in the front panel of Actiview (hardware side)?
Thanks very much!
-
- Posts: 17
- Joined: Mon Apr 21, 2008 10:58 pm
- Location: Italy