Skip to content

An AI Development Kit (ADK) for physiological signal processing in ambulatory health monitoring and wearable technology.

PyPI Python Downloads GitHub Stars License

Overview

physioKIT is an AI Development Kit (ADK) for physiological signal processing in ambulatory health monitoring and wearable technology. It offers tools to process, analyze, and synthesize signals commonly captured by wearable sensors, including ECG, PPG, RSP, and IMU data. Its modular design and consistent APIs help researchers and developers integrate advanced signal processing and feature extraction into applications, speeding up development and deployment of health monitoring solutions.

Key Features

  • Multi-signal coverage: ECG, PPG, RSP, IMU, and HRV out of the box.
  • End-to-end pipeline: Cleaning, peak detection, intervals, metrics, and synthesis.
  • Shared utilities: Filtering, smoothing, FFT, resampling, distortion/noise.
  • Synthetic data: Generate realistic signals for testing and benchmarking.
  • Realtime-friendly: Functions designed for streaming and incremental use.

Getting Started

Installation

Install physioKIT using uv or pip.

$ uv add physiokit

---> 100%

$ pip install physiokit

---> 100%

Quickstart

import numpy as np
import physiokit as pk

fs = 500
ecg, segs, fids = pk.ecg.synthesize(signal_length=5*fs, sample_rate=fs, heart_rate=70, leads=1)
ecg = ecg.squeeze()

ecg_clean = pk.ecg.clean(ecg, sample_rate=fs)
peaks = pk.ecg.find_peaks(ecg_clean, sample_rate=fs)
rri = pk.ecg.compute_rr_intervals(peaks)
mask = pk.ecg.filter_rr_intervals(rri, sample_rate=fs)

hr_bpm, _ = pk.ecg.compute_heart_rate(ecg_clean, sample_rate=fs)
hrv_td = pk.hrv.compute_hrv_time(rri[mask == 0], sample_rate=fs)
import numpy as np
import physiokit as pk

fs = 100
t = np.arange(0, 10, 1/fs)
ppg = np.sin(2*np.pi*1.1*t)

hr_bpm, qos = pk.ppg.compute_heart_rate(ppg, sample_rate=fs, method="peak")
spo2 = pk.ppg.compute_spo2_in_time(ppg, ppg, sample_rate=fs)
import numpy as np
import physiokit as pk

fs = 25
t = np.arange(0, 40, 1/fs)
rsp = np.sin(2*np.pi*0.2*t)

bpm, qos = pk.rsp.compute_respiratory_rate(rsp, sample_rate=fs, method="peak")
import numpy as np
import physiokit as pk

fs = 100
t = np.arange(0, 5, 1/fs)
sig = np.sin(2*np.pi*2*t) + 0.2*np.random.randn(t.size)

clean = pk.signal.filter_signal(sig, lowcut=0.5, highcut=20, sample_rate=fs)
freqs, sp = pk.signal.compute_fft(clean, sample_rate=fs)

License

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

  • Docs: https://ambiqai.github.io/physiokit
  • Reference: reference/index.md
  • Source: https://github.com/AmbiqAI/physiokit