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.2.tar.gz (10.8 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.2-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bioaug-0.1.2.tar.gz
  • Upload date:
  • Size: 10.8 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.2.tar.gz
Algorithm Hash digest
SHA256 9925a1030e21c14cb8703e7ed3544501e715a2f0dfbf72185e2336ce6272378f
MD5 f9152a58a8b94624f969eae6f691d798
BLAKE2b-256 79b26bfe0abae6576608320f3a252f7bb54c7676039870db7e8306b997a7d0a2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bioaug-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 16.7 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 919efa8250a9914e06276af692dcda82e2cf6d32a2312a4453a35c8d5c2c7303
MD5 a837af9102d396365729bfe5f069eb17
BLAKE2b-256 31a10020d79b467ed025aa13071eeb2ca3cdb4f78594e82abd750e71a71f200e

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