Unicorn Hybrid Black
- class gpype.backend.sources.hybrid_black.HybridBlack[source]
Bases:
AmplifierSourceg.tec Unicorn Hybrid Black amplifier source for EEG acquisition.
Interface to g.tec Unicorn Hybrid Black wireless EEG amplifier using Bluetooth. Supports 8-channel EEG acquisition at 250 Hz, plus optional accelerometer, gyroscope, battery, counter, and validation channels.
- SAMPLING_RATE = 250
Fixed sampling rate for Unicorn Hybrid Black amplifier in Hz
- NUM_EEG_CHANNELS = 8
Number of EEG channels
- NUM_ACCEL_CHANNELS = 3
Number of accelerometer channels (X, Y, Z)
- NUM_GYRO_CHANNELS = 3
Number of gyroscope channels (X, Y, Z)
- TOTAL_ACQUIRED_CHANNELS = 17
Total number of acquired channels (EEG + Accel + Gyro + Battery + Counter + Validation)
- DEVICE_DELAY_MS = 40
Hardware delay compensation in milliseconds (Bluetooth latency)
- NUM_UNDERRUNS_ALLOWED = 5
Maximum allowed consecutive buffer underruns before warning
- WAIT_BEHIND_S = 0.003
Wait interval when behind (GetData < 1ms), in seconds
- WAIT_ON_TIME_S = 0.0039
Wait interval when on time (GetData >= 1ms), in seconds
- BEHIND_THRESHOLD_S = 0.001
Threshold for determining if we’re behind (GetData blocking time)
- class Configuration[source]
Bases:
ConfigurationConfiguration class for Unicorn Hybrid Black specific parameters.
- __init__(serial=None, channel_count=None, frame_size=None, include_accel=None, include_gyro=None, include_aux=None, test_signal=None, **kwargs)[source]
Initialize Unicorn Hybrid Black amplifier source.
- Parameters:
serial (
Optional[str]) – Serial number of target device. Uses first discovered if None.channel_count (
Optional[int]) – Number of EEG channels (1-8). Defaults to 8.include_accel (
Optional[bool]) – Include accelerometer channels (3 channels).include_gyro (
Optional[bool]) – Include gyroscope channels (3 channels).include_aux (
Optional[bool]) – Include auxiliary channels (battery, counter, validation).test_signal (
Optional[bool]) – Enable test signal mode instead of live data.**kwargs – Additional arguments for parent AmplifierSource.
- Raises:
NotImplementedError – If not running on Windows.
- start()[source]
Start Unicorn Hybrid Black amplifier and begin data acquisition.
Establishes Bluetooth connection and starts background thread that acquires data and drives the pipeline via cycle().
- Raises:
ConnectionError – If amplifier connection fails.
RuntimeError – If background thread creation fails.
- Return type:
- setup(data, port_context_in)[source]
Setup output port contexts for Unicorn Hybrid Black data streams.
- stop()[source]
Stop Unicorn Hybrid Black amplifier and clean up resources.
Stops data acquisition, terminates background thread, and disconnects from amplifier hardware.