A toolbox for biosignal augmentation written in Python
Project description
BioAug - Biosignal Augmentation in Python
A toolbox for biosignal augmentation written in Python.
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
bio/GaussianNoise.py- class GaussianNoise: Add specified Gaussian noise to biosignals.
bio/LocalJittering.py- class LocalJittering: Add noise of specific length and frequency at random locations in the biosignals.
bio/RandomCutout.py- class RandomCutout: crop a specific length of a biosignals at a random location to simulate signal loss.
bio/ImpedanceVariation.py- class ImpedanceVariation: simulate changes in biosignals during variation in skin impedance.
bio/Distortion.py- class Distortion: simulate biosignals with distortion during real-world use.
bio/Drift.py- class SignalDrift: simulate biosignals with drift during real-world use.
bio/MagnitudeWarping.py- class MagnitudeWarping: apply magnitude warping to biosignals.
bio/TimeWarping.py- class TimeWarping: apply time warping to biosignals.
bio/Permutation.py- class Permutation: apply permutation to biosignals.
bio/Scaling.py- class Scaling: apply scaling to biosignals.
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
- 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bioaug-0.1.4.tar.gz.
File metadata
- Download URL: bioaug-0.1.4.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a013a963bb015e061428b66fcc07e137ba8f203ee6b8778049bd4ab59f933e6
|
|
| MD5 |
4e91f5dcc426a3705ae66f8b13be3471
|
|
| BLAKE2b-256 |
bb376d512ea067ee8e08140ba103d84a434edac069d7c5f4ab5dde565587f755
|
File details
Details for the file bioaug-0.1.4-py3-none-any.whl.
File metadata
- Download URL: bioaug-0.1.4-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1162b0d8972aa0d0db7ea83a9d3f91e0e59af333338e345362d742c476a3f8b
|
|
| MD5 |
9f949131d1854935cebc70529fde423d
|
|
| BLAKE2b-256 |
2bef7acc6558ed3c4fcf447d097a1d7405d49f98f20b86b064072a0ba760a1ab
|