Skip to main content

physioKIT, process raw ambulatory bio-signals.

Project description

physioKIT

An AI Development Kit (ADK) for physiological signal processing in Python.

PyPI Python Downloads GitHub Stars License

physioKIT is an open-source Python package designed for processing and analyzing physiological signals commonly acquired from wearable sensors. It provides a comprehensive suite of tools for signal processing, feature extraction, and synthetic signal generation, making it ideal for researchers and developers working in the field of ambulatory health monitoring and wearable technology.

Key Features:

  • Handles a variety of physiological signals including ECG, PPG, RSP, and IMU.
  • Geared towards real-time, noisy wearable sensor data.
  • Provide advanced signal processing and feature extraction methods.
  • Create synthetic signals for testing and benchmarking.

Requirements

Installation

Installing physioKIT can be done using uv or pip.

pip install physiokit
uv add physiokit

Example

In this example, we will generate a synthetic ECG signal, clean it, and compute heart rate and HRV metrics.

import numpy as np
import physiokit as pk

sample_rate = 1000 # Hz
heart_rate = 64 # BPM
signal_length = 8*sample_rate # 8 seconds

# Generate synthetic ECG signal
ecg, segs, fids = pk.ecg.synthesize(
    signal_length=signal_length,
    sample_rate=sample_rate,
    heart_rate=heart_rate,
    leads=1
)
ecg = ecg.squeeze()

# Clean ECG signal
ecg_clean = pk.ecg.clean(ecg, sample_rate=sample_rate)

# Compute heart rate
hr_bpm, _ = pk.ecg.compute_heart_rate(ecg_clean, sample_rate=sample_rate)

# Extract R-peaks and RR-intervals
peaks = pk.ecg.find_peaks(ecg_clean, sample_rate=sample_rate)
rri = pk.ecg.compute_rr_intervals(peaks)
mask = pk.ecg.filter_rr_intervals(rri, sample_rate=sample_rate)

# Re-compute heart rate
hr_bpm = 60 / (np.nanmean(rri[mask == 0]) / sample_rate)

# Compute HRV metrics
hrv_td = pk.hrv.compute_hrv_time(rri[mask == 0], sample_rate=sample_rate)

bands = [(0.04, 0.15), (0.15, 0.4), (0.4, 0.5)]
hrv_fd = pk.hrv.compute_hrv_frequency(
    peaks[mask == 0],
    rri[mask == 0],
    bands=bands,
    sample_rate=sample_rate
)

License

This project is licensed under the terms of BSD 3-Clause.

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

physiokit-0.11.0.tar.gz (50.9 kB view details)

Uploaded Source

Built Distribution

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

physiokit-0.11.0-py3-none-any.whl (60.3 kB view details)

Uploaded Python 3

File details

Details for the file physiokit-0.11.0.tar.gz.

File metadata

  • Download URL: physiokit-0.11.0.tar.gz
  • Upload date:
  • Size: 50.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for physiokit-0.11.0.tar.gz
Algorithm Hash digest
SHA256 cc4732d3efe6c79b2578af65b2b870ca1255e95c88b86940d772a93d69db214f
MD5 9e2ede1e8f1bf2c87172ae51ac23157e
BLAKE2b-256 623f597a62bf7421f8bd4edf2acf416947d8ead5afb9a491570e048408e59f99

See more details on using hashes here.

Provenance

The following attestation bundles were made for physiokit-0.11.0.tar.gz:

Publisher: release.yaml on AmbiqAI/physiokit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file physiokit-0.11.0-py3-none-any.whl.

File metadata

  • Download URL: physiokit-0.11.0-py3-none-any.whl
  • Upload date:
  • Size: 60.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for physiokit-0.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c73d359199c2f8df35b200c736d9c177fe31f91b3bc2c289844e32cb0c6ba2e3
MD5 66a583f32f8538543598bd980a5c5185
BLAKE2b-256 9f61d010b98f82dab102543e467eaeb918c1fdd21756e4961e0f3ddb1520cae8

See more details on using hashes here.

Provenance

The following attestation bundles were made for physiokit-0.11.0-py3-none-any.whl:

Publisher: release.yaml on AmbiqAI/physiokit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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