Sensor data acquired with BITalino and biosignalsplux devices are represented in the digitized sensor values ranging between 0 and 2 (sampling resolution – 1) due to the analog to digital conversion of the acquired sensor signal.
Using OpenSignals, you can export sensor data in their digital value format or convert the signals into their original physical units.
Signals recorded using the PLUX APIs record only the digital sensor values and need to be converted back into their original physical units by applying the sensor’s transfer function, which can be found in your sensor’s user manual or datasheet:
You can find below an example of how to apply the transfer function.
Example: Converting biosignalsplux ECG Signals
From the ECG’s user manual, the sensor’s transfer function is as follows:
We can define the parameters of the transfer function as follows:
# ADC: Digital values of the ECG signal ecg_digital = [...] # n: Sampling resolution of the signal, by default 16-bit sampling_resolution = 16 # VCC: the sensor's operating voltage of 3V vcc = 3 # Gecg: the sensor's gain gain = 1019
Using these parameters, the resulting transfer function to convert the ECG signal back into mV would be as follows:
# Convert ECG signal into mV ecg = (ADC/2**(sampling_resolution-1) - 0.5) * vcc * gain