eeg-filters
Package helps you to filter and analyze EEG signals and EP (evoked potentials). Filter based on Chebyshev filter from scipy.signals
You can get data from files exported from NeuroExplorer Vesion 4.4 in ASCII format or from in edf format. Then you can apply a bandpass filter in some bandwidth like [1, 220]. These the lower and upper frequency boundaries in Hz.
Also you can find maximums in one time interval and minimums in another time interval.
Finally you can export data to files. Filtered data could be exported to the ASCII file in the same (NeuroExplorer 4.4) format as the source file. Extremums can be exported to a text file with tab splitted columns.
Requirements
- numpy
- scipy
- matplotlib
Installation.
pip install eeg-filters
Usage
For example:
$python3
>>> from eeg_filters.data_importer import DataImporter
>>> from eeg_filters.filters import show_plot
>>> data_importer = DataImporter('input/data.txt')
>>> bandwidth = [1, 200]
>>> show_plot(data_importer.data, bandwidth, 3, 2, 0.003)
>>> show_plot(data_importer.data, bandwidth, max_region=[0.08,0.104], min_region=[0.105,0.14])
In this example we made a filter in bandwidth = [1, 200]. And in the last line we make show_plot with extremums.
You can use it in scripts like this:
!#/usr/bin/python3
from eeg_filters.data_importer import DataImporter
from eeg_filters.filters import apply_filter, search_max_min
from eeg_filters.export import export_curves, export_extremums
source_file_name = input('input path for source file, please: ')
bandwidths = [[1, 100],[5, 100],[10, 100],[1, 200], [5, 200],[10, 200]]
max_region = [0.01, 0.02]
min_region = [0.04, 0.06]
incoming_data = DataImporter(source_file_name).data
list_name_curves = incoming_data["list_name_curves"]
list_curves = incoming_data["list_curves"]
list_tick_times = incoming_data["list_tick_times"]
sample_rate = incoming_data["sample_rate"]
dict_filtered_data = {}
for bandwidth in bandwidths:
dict_data = {}
dict_extremums = {}
for timestamp, curve in zip(list_name_curves, list_curves):
filtered_data = apply_filter(
curve, bandwidth, sample_rate, order=3, rp=2
)
dict_data.update({timestamp: filtered_data})
dict_extremums.update(
{timestamp:(
search_max_min(
list_tick_times, filtered_data, max_region,'max'
),
search_max_min(
list_tick_times, filtered_data, min_region,'min'
)
)}
)
# export data of filtered EEG signals
export_curves(
source_file_name, './', bandwidth, dict_data
)
# export extremums of filtered EEG signals
export_extremums(
'./', bandwidth, dict_extremums
)
Also you can use any UI for this package. For example you can see this project:
Metadata
Release files for eeg-filters 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| eeg_filters-0.0.8.tar.gz | 6.6 kB | Without provenance | Details for eeg_filters-0.0.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| eeg_filters-0.0.8-py3-none-any.whl | Python 3 | none | any | Details for eeg_filters-0.0.8-py3-none-any.whl |
Total release size: 15.4 kB
Release files / eeg_filters-0.0.8.tar.gz
| Download URL | eeg_filters-0.0.8.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6fba58136aa1c4adaa916f960097ac44faac9e1e534932c1b85006a487ebb96d
|
|
BLAKE2b-256 checksum How to use checksums |
1efa58b1a14d8048fe05413e580c67a5a857db93d5000f21b86942966e4387dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.2 CPython/3.13.1 Linux/6.8.0-1021-azure
|
Release files / eeg_filters-0.0.8-py3-none-any.whl
| Download URL | eeg_filters-0.0.8-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9863635d5c91468e6cdc60ec9dcc9c3bdd24e824de7b2e9d727d9b9f75430354
|
|
BLAKE2b-256 checksum How to use checksums |
78fd592af5be8134ae2826e75392e55c33705f8ef941298a116aee86134e8659
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.2 CPython/3.13.1 Linux/6.8.0-1021-azure
|
Security for eeg-filters 0.0.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.