Skip to main content

Magnes utility for the removal of artifacts from timeseries.

Project description

Magnes Artifact Removal

Magnes utility for the removal of artifacts from time series.

Installation

Install the package using

    pip install artrem 

Note, might need to be adapted to the final location of the package.

Quick Start

    import numpy as np
    from martrem import clean_with_adaptive_shape_correlation
    from martrem.aux import templating

    # Prepare your signal data
    fs = 250.0  # Sampling frequency
    signal_data = np.array([...])  # Your time series data

    # Create a search template
    psi_n = 25
    psi = templating.mexican(psi_n, fs=fs, bound=3)

    # Clean the signal
    corrected, artifact = clean_with_adaptive_shape_correlation(
        signal_data,
        fs=fs,
        psi=psi,
        tau_n=50,
        fco_hp=0.1,
        xcorr_min_peak_distance=80
    )

Submodules

Autoenc

Autoencoder-based signal filtering/artifact detection.

Auxiliary Tools

Collection of submodules for filtering, scaling, and generating signal templates (shapelets/wavelets).

Cleaning

Main interface of the package. Collection of functions cleaning corrupted time series using a specific method.

Scripts

The package is evaluated using a number of scripts. Scripts can be seen as studies of a specific strategy or a comparison thereof. For example, scripts to evaluate the search-template-based ECG artifact removal strategy from blurred-peak waves are provided, including a single-experiment run scripts/singlerun.py and a parametric sweep scripts/sweep.py.

Due to the folder hierarchy, scripts are to be run from root as modules, i.e. to run the script scripts/foo.py call

uv run -m scripts.foo [ARGS]

Note The scripts are not included in package, but are only available in the full source.

Testing

Testing is performed using pytest. Package tests are defined in tests/, replicating the To run the package unittests, call

uv run -m pytest tests [OPTIONS]

To run the scripts' tests call

uv run -m pytest scripts [OPTIONS]

To run the all tests call

uv run -m pytest [OPTIONS]

All calls are assumed to be made from the project root.

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

magnes_artifact_removal-0.1.0.tar.gz (392.4 kB view details)

Uploaded Source

Built Distribution

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

magnes_artifact_removal-0.1.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file magnes_artifact_removal-0.1.0.tar.gz.

File metadata

File hashes

Hashes for magnes_artifact_removal-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5a807f845d53b17ae7ac2c91b5690606f65777148dfbeb2e8227bfb641a87a4e
MD5 35695fa2f369c5ff4311eab5c078201e
BLAKE2b-256 d4bf56af47b5a0802f97fd2cd448d65cee4c01b905ce4c3b350ddcf12b60f437

See more details on using hashes here.

File details

Details for the file magnes_artifact_removal-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for magnes_artifact_removal-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 723468453e0f2c0d5e263b360bfe9873cf66120537da2815750367d8a158cd06
MD5 c4bcfd5a768018c36495be79e160b8a6
BLAKE2b-256 fe0686373a314967605130e1c36d715002281bbac79a905e146db117a66ba2a0

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