| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Real-time brainwave visualization using Enophone EEG headphones with BrainFlow SDK.
python -m venv venv# Linux/macOS
source venv/bin/activate
# Windows
venv\Scripts\activatepip install -r requirements.txtpython enophone_websocket_server.py --simulateFind your Enophone MAC address:
Start the server with your MAC:
python enophone_websocket_server.py --mac XX:XX:XX:XX:XX:XXpython enophone_http_server.py --mac XX:XX:XX:XX:XX:XX
# Metrics available at http://localhost:8080/metricsEnophone has 4 EEG sensors positioned at standard 10-20 system locations:
| Channel | Position | Description |
|---|---|---|
| A1 | Left ear (mastoid) | Reference electrode |
| C3 | Left motor cortex | Left hemisphere brain activity |
| C4 | Right motor cortex | Right hemisphere brain activity |
| A2 | Right ear (mastoid) | Reference electrode |
The sensors capture brainwave data from the frontal parietal lobe (involved in sustained attention) and can detect all 5 brainwave types:
The raw EEG voltage data from the 4 sensors is processed to extract brainwave band powers:
Raw EEG Signal → FFT (Fast Fourier Transform) → Power Spectral Density (PSD) → Band Powers
| Band | Frequency Range | How It's Calculated |
|---|---|---|
| Delta | 0.5-4 Hz | Sum of PSD from 0.5-4 Hz |
| Theta | 4-8 Hz | Sum of PSD from 4-8 Hz |
| Alpha | 8-13 Hz | Sum of PSD from 8-13 Hz |
| Beta | 13-30 Hz | Sum of PSD from 13-30 Hz |
| Gamma | 30-50 Hz | Sum of PSD from 30-50 Hz |
The focus score is derived from the Beta/Alpha ratio:
Focus Score = (Beta Power / Alpha Power) × 100
Higher Beta (active thinking) relative to Alpha (relaxation) indicates better focus. Values are clamped between 0-100.
| Script | Description |
|---|---|
| enophone_websocket_server.py | WebSocket server for real-time visualization |
| enophone_http_server.py | HTTP API for Grafana/polling |
| enophone_monitor.py | CLI brainwave monitor |
| enophone_monitor_gui.py | GUI visualization with matplotlib |
| enophone_ios_client.py | iOS proxy - connects to remote server and re-broadcasts locally |
| enophone-art.html | WebGL visual art (browser-based) |
# With simulated data (no hardware needed)
python enophone_websocket_server.py --simulate
# With real device (MAC required on Linux)
python enophone_websocket_server.py --mac XX:XX:XX:XX:XX:XX --port 8765python enophone_monitor.py --mac XX:XX:XX:XX:XX:XXpython enophone_monitor_gui.py --mac XX:XX:XX:XX:XX:XX --guiSince BrainFlow requires direct Bluetooth access which doesn't work on iOS/macOS, use this architecture:
Linux machine (has Bluetooth access):
python enophone_websocket_server.py --mac XX:XX:XX:XX:XX:XXiOS/macOS device (runs the proxy):
# Connect to remote Linux server and expose locally
python enophone_ios_client.py --host <linux-ip> --remote-port 8765 --local-port 8765Local apps connect to:
ws://localhost:8765
The proxy receives data from the Linux server and re-broadcasts it locally, allowing any app on iOS/macOS to connect as if the server were local.
The WebGL art (enophone-art.html) displays:
This software is provided "as is", without warranty of any kind, express or implied. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.
This project is for educational and personal use only. It is not a medical device and should not be used for medical diagnosis or treatment. The brainwave data collected by this software may not be accurate or reliable enough for clinical purposes.
| Back | FazBrowse Home | New Git URL |