A simple EEG signal processing toolbox
Project description
EEG Toolbox
eeg_toolbox is a standardized Python toolkit for processing, analyzing, and visualizing long-term EEG signals. The package allows for the preprocessing of raw EEG data (filtering, resampling), extraction of time-frequency-based features (FFT, STFT), and automatic detection of abnormal brain activity (graphoelements). The algorithms use open-format EDF files as input and provide a transparent, modular way to evaluate clinically relevant patterns derived from EEG data. The methods used for detection (e.g., spectral peak analysis, frequency band-based dominance) enable the temporal localization and classification of slow waves and unusual activities. As a result, the package offers a reliable, customizable, and easily expandable solution for analyzing EEG signals for research and educational purposes.
Documentation: https://scipy-proj.readthedocs.io/en/latest/index.html
Source code: https://github.com/hubakukor/scipy_proj
Installation
pip install eeg_toolbox
Example Usage
Click on the Colab button above to open the demo notebook in Google Colab, or download the example notebook demo.ipynb and the example data file PN00-1.edf from the examples folder in the repository. The notebook can be run in Google Colab after uploading the data file and the notebook.
Description
The following steps are implemented in the EEG processing toolbox:
Loading EEG data
The toolbox supports the loading of EEG signals from .edf (European Data Format) files using the mne library. The raw data is returned in NumPy array format along with the sampling frequency and channel names, enabling further processing and analysis.
Preprocessing
The toolbox includes basic preprocessing methods such as:
- Resampling: EEG data can be resampled to a new target sampling frequency.
- Filtering: Bandpass filtering and notch filtering are supported to remove noise, such as powerline interference and unwanted frequency components.
- Normalization: Z-score, min-max normalization, and mean centering can be applied on a per-channel basis to standardize the signals for analysis.
Spectral Analysis
Using the Fourier transform, the toolbox computes the frequency spectrum of EEG signals. It also calculates the average power spectrum across channels to facilitate interpretation of dominant rhythms and spectral characteristics.
Event Detection
A method is provided to detect graphoelements (distinctive EEG patterns) using short-time Fourier transform (STFT). The detection focuses on elevated energy in the 3–8 Hz band and identifies dominant rhythms (e.g., theta or delta waves) based on energy across predefined frequency bands.
Visualization
Multiple visualization utilities are included:
- EEG overview plotting: Time-domain plots of selected EEG channels.
- FFT spectrum plotting: Visualization of the mean power spectrum.
- Event segment plotting: Graphical display of EEG segments around detected graphoelements, highlighting their temporal and rhythmic context.
Authors: Veronika Szabolcsi, Dorka Kecskés, Huba Kukor
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file eeg_toolbox-0.1.0.tar.gz.
File metadata
- Download URL: eeg_toolbox-0.1.0.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59869e2cf5c0cd0caf0c81f5e2b9b1e57e246455369efc172fdf751251913993
|
|
| MD5 |
0150505a53616c7167f035b59108c72b
|
|
| BLAKE2b-256 |
fd70b52e952f8aa12794e32231ce6afb50fe41d35efe092ddcefc0787b2f0fe3
|
File details
Details for the file eeg_toolbox-0.1.0-py3-none-any.whl.
File metadata
- Download URL: eeg_toolbox-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8b83fa68062795092359e21e366cfde64eb77f653e05bfff7519274529f412b
|
|
| MD5 |
822f9387418b465b0de000623bbfa904
|
|
| BLAKE2b-256 |
2e38e3eda519fc12ae3574c73f39fe8922b5af54662d033461ec0ac6eb171033
|