Main siteMain site  ForumForum  ForumSearch  Private messageEmail contact  RegisterRegister  Log inLog in 
Topic: OpenBCI and OpenEEG Scalar vs Float
Reply to topic
Author Message
compujohnny



Joined: Feb 2, 2018
Posts: 16

PostPosted: May 20, 2018 7:27 PM    Post subject: OpenBCI and OpenEEG Scalar vs Float

Hi,

I want to ask about the proper data format to use in designs built for OpenBCI and ModEEG_P2 devices, is the values sent scalar or float?

Also if it's scalar and the design received it as float (and vice versa) will the values be wrong?

Thanks for your help
jarek



Joined: Oct 22, 2007
Posts: 605

PostPosted: May 20, 2018 7:34 PM    Post subject:

I recommend using Float elements. They are easier with respect to signal properties (they to not need to scale).

Yes, it is possible to convert between those two, for example by using ScalarToFloat. But make sure the scaling ratio is correct.
compujohnny



Joined: Feb 2, 2018
Posts: 16

PostPosted: May 21, 2018 4:25 AM    Post subject:

Yes, but I am asking about the actual data format sent from the firmware of the devices, is it a scalar value? will reading it as float distort the data?

for example I frequently get a signed value like -125, now I know the values read vary from 0 micro volts to milli volts, where does the - come from? and am I missing a "bit" of the actual data to represent the sign?
jarek



Joined: Oct 22, 2007
Posts: 605

PostPosted: May 21, 2018 9:51 AM    Post subject:

Yes, data sent from the device is in integer format, which is closer to Scalar than Float. Conversion to Float will not distort it, unless you worry about rounding which could only affect the last bit of the integer values.

Data is usually a signed integer, which can be a positive or a negative value.
Reply to topic