The EP Bandpass Filter Selector package cycles through various combinations of high- and low-pass cutoffs of the bandpass frequency filter within user-specified limits and selects the optimal filtering option. Optimization is carried out basing on the ratio of the EP interpeak amplitude to the EP curves variability coefficient.
Project description
ep-bandpass-filter-selector
The EP Bandpass Filter Selector package cycles through various combinations of high- and low-pass cutoffs of the bandpass frequency filter within user-specified limits and selects the optimal filtering option. Optimization is carried out basing on the ratio of the EP interpeak amplitude to the EP curves variability coefficient.
Requirements
Package require python >= 3.8. For development require python3-venv. Tested on Ubuntu 20.04.
Installation
For usual using:
$ pip install ep_bandpass_filter_selector
For development:
$ git clone https://github.com/yaricp/ep-bandpass-filter-selector.git
$ cd ep-bandpass-filter-selector/
$ cd scripts/
$ ./install.sh
install.sh
will download and set up the necessary packages in the .venv folder.
Usage
This package can be imported as a separated module:
$ python3
>>> from eeg_filters.upload import prepare_data
>>> from ep_bandpass_filter_selector import PassbandSelector
>>> (
sample_rate, list_times, list_ticks, list_out
) = prepare_data("file_data_path.dat")
>>> pbs = PassbandSelector(
curves=list_out,
tick_times=list_ticks,
fsr=sample_rate,
max_search_range: (0.016, 0.023),
min_search_range: (0.022, 0.028)
)
>>> result = pbs.start()
>>> print(result[0])
20,200
In this example, all curves from the file_data_path.dat were used for selecting the passband filter. Also, additional parameters were used with the default values. Their values are listed here:
filter_low_limit_range = 1, 30 step_low_filter = 1 filter_high_limit_range = 100, 500 step_high_filter = 10
You can declare them when creating an item of PassbandSelector. For example:
>>> pbs = PassbandSelector(
curves=list_out,
tick_times=list_ticks,
fsr=sample_rate,
max_search_range=(0.016, 0.023),
min_search_range=(0.022, 0.028),
filter_low_limit_range=[5, 20],
step_low_filter=5,
filter_high_limit_range=[100, 300],
step_high_filter=50,
type_mean="average",
cheb_filter_order=3,
cheb_ripple=3
)
Another notation is also possible for declaring parameters. For example:
>>> pbs = PassbandSelector(
curves=list_out,
tick_times=list_ticks,
fsr=sample_rate,
max_search_range=(0.016, 0.023),
min_search_range=(0.022, 0.028),
fllr=[5, 20],
slf=5,
fhlr=[100, 300],
shf=50,
tm="average",
chfo=3,
chr=3
)
Export data
On this moment there is only export to CSV format.
>>> from ep_bandpass_filter_selector import export_data
>>> export_data(
"filepath_for_export.csv",
list(result[0]),
result[1]
)
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
File details
Details for the file ep_bandpass_filter_selector-0.0.4.tar.gz
.
File metadata
- Download URL: ep_bandpass_filter_selector-0.0.4.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.5 Darwin/23.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05f7951b9c96a37bcf72a6c0dc3c50cecaa9cb165442523caa2dc962c4527cf9 |
|
MD5 | 95250bf98ae601b764de728f474e824f |
|
BLAKE2b-256 | fc1c06a60afd0b09c0945fec2832890b2a3b8e7efb55b82fff1a6528665ed822 |
File details
Details for the file ep_bandpass_filter_selector-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: ep_bandpass_filter_selector-0.0.4-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.5 Darwin/23.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c377db76848fd4c595899de8bc7e472f532f7150f65227c79da7ece2a992d294 |
|
MD5 | af08ed8a03c754925c6897b1d31721b8 |
|
BLAKE2b-256 | cfa7f9bd6422d46ca0441f0c5a71baa4f037d464d64fae7ac9a4e1a60a82ba08 |