Skip to main content

No project description provided

Project description

Run check format lint and unittests

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ep_bandpass_filter_selector-0.0.5.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ep_bandpass_filter_selector-0.0.5-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file ep_bandpass_filter_selector-0.0.5.tar.gz.

File metadata

  • Download URL: ep_bandpass_filter_selector-0.0.5.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.13.1 Linux/6.8.0-1021-azure

File hashes

Hashes for ep_bandpass_filter_selector-0.0.5.tar.gz
Algorithm Hash digest
SHA256 232038bd9d39533c62577974286d20ffcac6e006ca69ea6442225f89f40284d5
MD5 d6b04f3b7ef1645ddf29a73dbed1f3d2
BLAKE2b-256 9d3a28102105433a752f38fed1ab90a43bcf4ece738294ea0278d8458e5ecef3

See more details on using hashes here.

File details

Details for the file ep_bandpass_filter_selector-0.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for ep_bandpass_filter_selector-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 d2f46aef67486fb76e4573ce4e4907a8734567498a2b2e8f24f01805bc7e910b
MD5 fca01160cc5f67ddff46226070e38900
BLAKE2b-256 890e0603504aa567b93e22f6c4b34170a99ea4bd7ebd4e166c0e75864787b1b0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page