EBL EEG Developer SDK
Commercial-grade Python SDK and headless runtime library for Elephant Brain Lab® E1 series EEG acquisition hardware. Built for real-time streaming, Riemannian artifact suppression (EL-RAC), online 62.5 Hz electrode impedance telemetry, and signal quality monitoring across scientific, clinical, and neurotechnology applications.
Platform Wheel (.whl) Downloads
Select the pre-compiled Python wheel matching your operating system and CPU architecture from the Download/ folder. All packages include full PEP 561 inline type stubs (.pyi) for instant IDE autocompletion in VS Code and PyCharm without exposing proprietary DSP source code.
ebl_license_activator_gui.py) and EBLLicense.get_machine_id() API to retrieve your workstation's unique 24-character Hardware Machine ID.
Installation Instructions
Install the EBL SDK inside a dedicated Python virtual environment (venv or conda) to isolate scientific dependencies (numpy, scipy, pyserial).
-
Create and Activate a Virtual EnvironmentTerminal / Command Prompt
# Create a clean virtual environment python -m venv ebl_env # Activate on Windows: ebl_env\Scripts\activate # Activate on Linux / macOS: source ebl_env/bin/activate -
Install the Wheel Package for Your Platform
Install the
.whlfile matching your operating system usingpip:Shellpip install --upgrade pip # Windows (x86_64): pip install Download/ebl_sdk-1.0.0-cp310-cp310-win_amd64.whl # Linux (x86_64): pip install Download/ebl_sdk-1.0.0-cp310-cp310-linux_x86_64.whl # macOS (Apple Silicon): pip install Download/ebl_sdk-1.0.0-cp310-cp310-macosx_11_0_arm64.whl -
Verify the SDK InstallationShell
python -c "import ebl; print('EBL SDK Version:', ebl.__version__, ebl.EBLClient)"
Hardware Activation & Offline Licensing
The EBL SDK uses hardware-locked offline licensing (license.lic). Once activated, your workstation requires no internet connection during acquisition or signal processing.
-
Retrieve Your Machine ID
Launch the GUI utility (
python ebl_license_activator_gui.py) or callEBLLicense.get_machine_id()in Python on the target workstation. -
Copy or Save Your Machine ID
Click Copy Machine ID or Save to File (
elephant_machine_id.txt) to capture your 24-character hexadecimal hardware identifier (e.g.,CD7CF82EB0BCAA8AAB586B9E). -
Request Your Signed License
Click Open Pre-Filled Email or email your Machine ID to licensing@elephantbrainlabs.com. You will receive a signed
license.licfile bound to your workstation.
How to Use Your .lic License File
Place the received license.lic file in your project root directory (or any secure local path) and pass its path when initializing EBLClient or validating via EBLLicense / EBLLicenseValidator:
from ebl import EBLClient, EBLLicense, EBLMode
from ebl.licensing.license import EBLLicenseValidator
# Option A: Pass license_path directly to EBLClient (Recommended)
client = EBLClient(license_path="license.lic", virtual=False)
if client.connect(port="COM3", mode=EBLMode.STANDARD):
print("License verified and hardware connected.")
client.disconnect()
# Option B: Retrieve Machine ID and validate a license file explicitly
machine_id = EBLLicense.get_machine_id()
print("Local Machine ID:", machine_id)
validator = EBLLicenseValidator()
print("License Valid:", validator.validate("license.lic"))
virtual=True to generate synthetic 39-channel E1 data streams.
Core Class Reference
All public classes are exported directly from the top-level ebl namespace (from ebl import ...) as well as their respective headless submodules.
| Class | Module | Description |
|---|---|---|
| EBLClient | ebl.client |
Unified developer facade tying hardware transport, DSP cleaning, impedance telemetry, and license validation into a single entry point. |
| EBLAmplifier | ebl.amplifier |
Direct hardware transport manager handling 460,800-baud serial I/O, packet sync verification on channel 38, virtual simulation, and raw packet parsing. |
| EBLMode | ebl.mode |
Enumeration of amplifier excitation modes: STANDARD (0), IMPEDANCE_CONTINUOUS (1), and IMPEDANCE_MULTIPLEXED (2). |
| EBLStream | ebl.stream |
High-level streaming generator yielding raw or cleaned EEG blocks alongside live impedance and SQI telemetry. Supports toggling EL-RAC and referencing. |
| EBLRecorder | ebl.recorder |
Headless session archiver saving multi-channel raw/cleaned EEG streams, timestamps, and channel labels into compressed .npz files. |
| EBLProcessor | ebl.dsp.processor |
Standalone DSP pipeline orchestrator performing despiking, SOS bandpass/notch filtering, Gratton-Coles EOG regression, spatial interpolation, and rREST referencing. |
| EBLELRAC | ebl.dsp.elrac |
Elephant Robust Adaptive Cleaning engine using Riemannian subspace projection with continuous linear operator blending. |
| EBLImpedance | ebl.impedance.extractor |
Goertzel algorithm tuned to 62.5 Hz (fs / 4) resolving injected 6 nA excitation currents into electrode contact impedance in kilo-ohms (kΩ). |
| EBLSQI | ebl.sqi |
Composite Signal Quality Index ([0.0 – 1.0]) evaluating flatlines, amplitude bounds, line noise, high-frequency jitter, and Riemannian covariance distance. |
| EBLLicense | ebl.licensing.license |
Node-locked hardware Machine ID retrieval and cryptographic offline .lic signature verification (EBLLicenseValidator). |
Channel & Hardware Mode Architecture
| Channel Indices | Count | Signal Group | Details |
|---|---|---|---|
0 .. 23 |
24 | Scalp EEG (10-20) | Fp1, Fp2, F7, F3, Fz, F4, F8, FC5, FC6, T7, C3, Cz, C4, T8, CP5, CPz, CP6, P7, P3, Pz, P4, P8, O1, O2 (μV) |
24 .. 31 |
8 | Auxiliary ExG / EOG | ExG-LL, EOG-HL, ExG-HL, EOG-VH, ExG-HR, EOG-HR, ExG-LR, EOG-VL (μV) |
32 .. 38 |
7 | AUX & Sync Telemetry | PPG (Red/IR/Green), EDA (mV), Temperature (°C), Control1 (MUX state), Control2 (24-bit packet counter) |
All Usage Combinations & Code Examples
Depending on your application architecture, you can use the high-level EBLClient facade or compose individual transport, streaming, DSP, and recording classes directly.
Connect directly to the E1 amplifier to stream raw 39-channel hardware blocks (shape: (n_samples, 39)) with zero DSP overhead.
from ebl import EBLAmplifier, EBLMode
# Connect to physical hardware (e.g., port="COM3") or virtual simulator
amp = EBLAmplifier(port="COM3", virtual=False)
amp.connect(mode=EBLMode.STANDARD)
print("Channel Count:", len(amp.channel_names)) # 39 channels
print("Scalp Labels:", amp.scalp_channel_names) # 24 10-20 channels
# Stream raw blocks
for block in amp.stream_raw(duration_s=5.0):
# block shape: (10, 39)
sample_counter = block[-1, 38] # Channel 38 contains the 24-bit incrementing counter
print(f"Received raw chunk. Counter: {sample_counter}")
amp.disconnect()
Switch hardware excitation modes dynamically during an active session between standard EEG (0), continuous 62.5 Hz impedance (1), and multiplexed group cycling (2).
from ebl import EBLAmplifier, EBLMode
amp = EBLAmplifier(virtual=True)
amp.connect(mode=EBLMode.STANDARD)
# Switch to Mode 1: Continuous 62.5 Hz impedance carrier on all channels
amp.set_mode(EBLMode.IMPEDANCE_CONTINUOUS)
print("Current Mode:", amp.get_mode().description)
# Switch to Mode 2: Multiplexed 3-bit group cycling
amp.set_mode(EBLMode.IMPEDANCE_MULTIPLEXED)
amp.disconnect()
Stream real-time artifact-cleaned EEG microvolts (shape: (32, n_samples)) with EL-RAC Riemannian subspace gating calibrated on a clean baseline window.
from ebl import EBLStream, EBLMode
import numpy as np
# Configure stream with EL-RAC enabled and rREST referencing
stream = EBLStream(
virtual=True,
mode=EBLMode.STANDARD,
elrac_enabled=True,
referencing_mode="rrest"
)
stream.start()
# Calibrate EL-RAC on a clean 10-second baseline
stream.calibrate_elrac(duration_s=10.0)
# Yields cleaned EEG of shape (32, n_samples) in microvolts
for eeg_block in stream.stream_cleaned(duration_s=10.0):
scalp_rms = np.sqrt(np.mean(eeg_block[:24, :] ** 2))
print(f"Cleaned 32-ch Block | Scalp RMS: {scalp_rms:.2f} uV | Global SQI: {stream.live_global_sqi*100:.1f}%")
stream.stop()
# To run with EL-RAC disabled:
# stream = EBLStream(virtual=True, elrac_enabled=False)
Stream cleaned EEG blocks while simultaneously reading real-time electrode contact impedance (kΩ) and per-channel Signal Quality Index scores.
from ebl import EBLClient, EBLMode
client = EBLClient(license_path="license.lic", virtual=True)
client.connect(mode=EBLMode.IMPEDANCE_CONTINUOUS)
# Stream with integrated telemetry dictionary
for cleaned_block, telemetry in client.streamer.stream(duration_s=5.0, include_telemetry=True):
impedances = telemetry["impedances_kohm"] # Array of 32 channels in kΩ
sqi_scores = telemetry["sqi_scores"] # Array of 32 channels [0.0 - 1.0]
print(
f"Fz Imp: {impedances[4]:.1f} kΩ | "
f"Cz Imp: {impedances[11]:.1f} kΩ | "
f"Scalp SQI: {telemetry['global_scalp_sqi']*100:.0f}%"
)
client.disconnect()
Record synchronized raw frames, cleaned EEG signals, impedance trajectories, and channel labels into a compressed NumPy .npz archive.
from ebl import EBLRecorder, EBLMode
recorder = EBLRecorder(mode=EBLMode.STANDARD)
recorder.stream.amplifier.virtual = True # Or connect physical hardware on COM port
# Record a 60-second clinical or research session
output_path = "subject_01_baseline.npz"
saved_file = recorder.record_duration(output_path, duration_s=60.0, show_progress=True)
print("Recording saved to:", saved_file)
Apply the complete EBL filtering, EOG regression, EL-RAC subspace correction, interpolation, and rREST re-referencing pipeline to pre-recorded NumPy arrays without active hardware streaming.
import numpy as np
from ebl import EBLProcessor
# Initialize standalone DSP processor
proc = EBLProcessor(
fs=250.0,
elrac_enabled=True,
filters_enabled=True,
eog_regression_enabled=True,
interpolation_enabled=True,
referencing_mode="rrest"
)
# Raw data of shape (32 channels, 2500 samples) in microvolts
raw_eeg_uv = np.random.normal(0, 15.0, (32, 2500))
# Calibrate EL-RAC on the first 1000 samples (24 scalp channels)
proc.calibrate_elrac(raw_eeg_uv[:24, :1000])
# Process subsequent blocks
cleaned_block = proc.process_block(raw_eeg_uv[:, 1000:1050])
print("Processed block shape:", cleaned_block.shape) # (32, 50)
EBLClient)
Recommended production pattern combining offline license verification, hardware connection, cleaned EEG streaming, and on-demand impedance queries in a single client object.
from ebl import EBLClient, EBLMode
# Instantiate with customer license file
client = EBLClient(license_path="license.lic", virtual=False)
# Connect to amplifier
if client.connect(port="COM3", mode=EBLMode.IMPEDANCE_CONTINUOUS):
for cleaned_block in client.stream_cleaned(duration_s=10.0):
print("Live EEG Shape:", cleaned_block.shape)
print("Mean Impedance (kΩ):", client.get_impedances().mean())
client.disconnect()
EBLELRAC, EBLImpedance & EBLSQI
Instantiate the Riemannian artifact cleaner, Goertzel impedance extractor, or SQI evaluator independently on custom buffers:
import numpy as np
from ebl import EBLELRAC, EBLImpedance, EBLSQI
# 1. Standalone Riemannian Subspace Artifact Cleaner (24 scalp channels)
elrac = EBLELRAC(n_channels=24, fs=250.0)
baseline_uv = np.random.normal(0, 12.0, (24, 1500))
elrac.calibrate(baseline_uv)
denoised_scalp = elrac.process_block(baseline_uv[:, :50])
# 2. Standalone 62.5 Hz Goertzel Impedance Extractor (Continuous Mode 1)
imp_extractor = EBLImpedance(fs=250.0, current_inj_a=6e-9)
window_uv = np.random.normal(0, 20.0, (32, 64))
impedances_kohm = imp_extractor.process_continuous(window_uv)
# 3. Standalone Signal Quality Index (0.0 = poor, 1.0 = clean)
sqi_evaluator = EBLSQI(fs=250.0)
channel_sqi = sqi_evaluator.compute(window_uv)
print("Channel SQI Scores:", np.round(channel_sqi, 3))