Data acquisition modes
Versatile Plus devices provide several acquisition modes that allow users to balance wireless mobility, acquisition latency, sampling rate requirements and data storage options. Depending on the selected configuration, data can be transmitted via Bluetooth or USB connection:
- USB: the sampling rate is configurable to 256, 512, or 1024 Hz. Data cannot be stored on the internal SD card.
- Bluetooth: the streamed data is sampled at 256 Hz. Data can be optionally stored on the internal SD card at a separately configurable sampling rate (256, 512, 1024, or 2048 Hz), or storage can be disabled entirely.
- These sampling-rate properties apply to EEG, EXG, Photodiode, and DIO signals and are configured via the sampling_rate parameter. IMU is acquired at 32 Hz (not configurable) and, if enabled, stored in the SD card at 128 Hz. See signal types here bbt_device_signal_type_t
- For EEG signals, the Versatile Plus 32 can be configured for 32 channels (two sets of 16-channel sensors) or 16 channels (the first set only). In case you want the Versatile Plus 32 to record using only 16 channels you need to call the bbt_device_new_versatile_plus_16 function
Three concepts are introduced below to explain the differences between USB and Bluetooth:
- sampling rate (SR): how many samples per second the signal is acquired at.
- transfer rate: how often a packet is streamed to the computer (via USB or Bluetooth) or stored in the SD card.
- samples per block: the group of samples carried per packet. samples per block = sampling rate / transfer rate
USB mode
- The amplifier transfers packets to the computer at a fixed frequency of 128 Hz.
- The sequence number is 16 bits and increases by 1 with every new packet.
- It overflows (wraps to 0) every 65536 / 128 = 512 s (8.53 min).
| Connection | SR (Hz) | Samples per block | Seq increment |
| USB | 256 | 2 | 1 |
| USB | 512 | 4 | 1 |
| USB | 1024 | 8 | 1 |
Bluetooth mode
- The amplifier transfers packets to the computer at a fixed frequency of 32 Hz (streaming), while the packets written on the SD card are saved at 128 Hz.
- The sequence number is 16 bits in both streams, and both count the same 128 Hz clock.
- Therefore:
- Streamed packets increment 4 by 4 per packet (e.g. 0, 4, 8, ...), always a multiple of 4.
- Imported SD-card packets increment 1 by 1.
- Both overflow every 512 s (8.53 min).
| Connection | Streaming - SR (Hz) | Streaming - samples per block | Streaming - seq inc | SD card - SR (Hz) | SD card - samples per block | SD card - seq inc |
| Bluetooth | 256 | 8 | 4 | 2048 | 16 | 1 |
| Bluetooth | 256 | 8 | 4 | 1024 | 8 | 1 |
| Bluetooth | 256 | 8 | 4 | 512 | 4 | 1 |
| Bluetooth | 256 | 8 | 4 | 256 | 2 | 1 |
Digital I/O (DIO) port
Versatile Plus EEG devices include a configurable Digital Input/Output (DIO) port that enables event marking and synchronization with other devices. The port can operate either as digital input or as digital output, depending on whether Versatile Plus receives synchronization signals from external equipment or acts as the source of them.
- Digital input: the port receives trigger signals from compatible accessories and external equipment (a button box, a pedal, a TTL cable, etc.). This can be configured setting the signal mode to DIGITAL_INPUT.
- Digital output: the port generates TTL pulses that can be received by the digital input of another device using a TTL cable, to synchronize with other Bitbrain devices or external acquisition systems at sample level. The DOUT sends a pulse every 30 s, each one randomly either short (125 ms) or long (250 ms). This can be configured setting the signal mode to DIGITAL_OUTPUT.
Enabling the DIO port
The DIO port is exposed as a signal of type Digital_Input_Output. Because it is directional, bbt_device_enable_signal is not enough: select the direction with bbt_device_set_signal_mode, passing a value of bbt_device_versatile_plus_dio_mode.
unsigned short count = 0;
for (unsigned short i = 0; i < count; ++i)
{
{
break;
}
}
BBT_SDK_API int bbt_device_start(bbt_device_t *device)
Sets the device into acquisition mode.
BBT_SDK_API int bbt_device_get_signals(const bbt_device_t *device, unsigned short *n, const struct bbt_device_signal_t **device_signals)
Get the list of signals available in the device.
BBT_SDK_API int bbt_device_set_signal_mode(bbt_device_t *device, unsigned short n, int mode)
Sets the mode to a specific value.
@ DIGITAL_INPUT
Definition bbt_device.h:536
@ Digital_Input_Output
Definition bbt_device.h:457
The bbt_device_signal_t class.
Definition bbt_device.h:565
enum bbt_device_signal_type_t type
Definition bbt_device.h:567
Use DISABLED (or bbt_device_disable_signal) to turn the port off.
Versatile Plus in Linux
On Linux the device is identified by its MAC address rather than by its name. Retrieve it with bluetoothctl (scan first if the device has not been seen on this machine before):
bluetoothctl scan on # wait for BBT-VP2-xxxxxx to appear, then Ctrl-C
bluetoothctl devices | grep BBT-VP2-AAA001
Pass that address as the device_name argument:
struct bbt_device_s bbt_device_t
bbt_device_t is an opaque type that identifies a connection to a device
Definition bbt_device.h:114
BBT_SDK_API bbt_device_t * bbt_device_new_versatile_plus_32(const char *device_name, const char *connection_type, unsigned short sampling_rate)
Creates an instance of a handler to a versatile plus type device with 32 channels.