Python Examples

Python Installation

See the getting started repo for full scripts. For python, we use 3.8.5, but any later 3+ version will probably work. Create a virtualenv from that repo:

pip install venv
python3 -m venv eeg_venv
# activate the venv according to your OS
# Windows example:
. ./eeg_venv/scripts/Activate
pip install -r requirements.txt

Script Examples

This script receives an LSL EEG stream and prints it to the console.

python -n SimulatedEEGStream
python -n PetalStream_gyroscope
python -n PetalStream_ppg
python -n PetalStream_telemetry
python -n PetalStream_eeg
python -n PetalStream_acceleration
python -n PetalStream_connection_status

This script streams 4 channels of EEG data at a selected sample rate. It can stream randomly generated data, or from a CSV file with any header where the first 4 columns represent channels 1-4.

  • Random EEG data at 256Hz:

python -s 256
  • From a CSV file at 256Hz:

python -s 256 -f ../example_data.csv

Last updated