Skip to main content

A toolbox for biosignal augmentation written in Python

Project description

BioAug - Biosignal Augmentation in Python

A toolbox for biosignal augmentation written in Python.

模块1

Deep learning models achieve remarkable performance with the aid of massive data. This tool allows you to customly augment your biosignals.

Table of Contents

Installation

We strongly recommend the usage of Anaconda for managing your python environments. Clone repo and install requirements.txt in a Python>=3.8.0 environment, including This set-up was tested under Windows 10 and Ubuntu 20.04.

  $ pip install bioaug

Introduction

jittering

  • bio/LocalJittering.py
    • class LocalJittering: Add noise of specific length and frequency at random locations in the biosignals.

localjittering

  • bio/RandomCutout.py
    • class RandomCutout: crop a specific length of a biosignals at a random location to simulate signal loss.

cutout

  • bio/ImpedanceVariation.py

impedance

  • bio/Distortion.py

distortion

  • bio/Drift.py

drift

magnitude warping

time warping

permutation

permutation

Usage

This library provides a series of data augmentation methods. The following is an example of using the LocalJittering method. The LocalJittering method is used to randomly add local high-frequency jitter to the input time series signal.

Parameters

  • p (float) : Probability of applying jitter, range [0, 1].
  • alpha (float, tuple, list) : Scale factor for the high-frequency noise. Can be a fixed value, a range, or a list.
  • frequency (int, tuple, list) : Frequency of jitter noise. Can be a fixed value, a range, or a list.
  • duration (int, tuple, list) : Duration (in time steps) of each jitter event. Can be a fixed value, a range, or a list.
  • num_jitters (int, tuple, list) : Number of jitter events to add. Can be a fixed value, a range, or a list.

Example Usage

  1. Fixed values, tuples, and lists combination:
from bioaug import LocalJittering

# Example of mixing fixed values, ranges (tuples), and lists
jitter = LocalJittering(
    p=0.8,                  # Probability of applying jitter
    alpha=0.5,              # Fixed alpha value
    frequency=(40, 60),     # Random frequency in the range [40, 60]
    duration=[10, 20, 30],  # Random duration chosen from the list [10, 20, 30]
    num_jitters=2           # Fixed number of jitter events
)

# Assume 'signal' is the input time-series data
augmented_signal = jitter(signal)

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

bioaug-0.1.3.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

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

bioaug-0.1.3-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

Details for the file bioaug-0.1.3.tar.gz.

File metadata

  • Download URL: bioaug-0.1.3.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.0

File hashes

Hashes for bioaug-0.1.3.tar.gz
Algorithm Hash digest
SHA256 703c22ee3ed2c889a65924c90b1dec91c044fa0403156de33a9c7c11a13be02c
MD5 4c28f297e1a47ac3b3c63a55a7c15ab2
BLAKE2b-256 8b4ede11fa6194cbaa372bbb270120be37c845cc11f58475ae8f50a38c1d7042

See more details on using hashes here.

File details

Details for the file bioaug-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: bioaug-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 17.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.0

File hashes

Hashes for bioaug-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5eda1a986cfc61480326a73c4cc7ed50e538274eecfc34d878eb80914341cf8e
MD5 01f06ca26a2714533b22e8e1570a220b
BLAKE2b-256 570e13631dfbf59bed4a854b93975753a086400da1dbfe2b8cfb2cc80e97e44f

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