Signals Overview
PhysioKit bundles end-to-end utilities for common wearable signals—ECG, PPG, respiratory (RSP), inertial (IMU), and derived HRV. Each module ships cleaning, peak detection, metrics, and synthetic data helpers built on a consistent API.
Modules at a Glance
- ECG: Cleaning, R-peak detection, RR intervals, HR/respiration, segmentation, and synthetic ECG.
- PPG: Peak detection, HR/respiration from peaks or FFT, SpO₂ estimation, and PPG synthesis.
- RSP: Respiratory peak detection, rate estimation (FFT/peaks), and dual-band ribcage/abdomen metrics.
- IMU: ENMO, tilt angles, and activity counts for accelerometer data.
- HRV: Time and frequency-domain HRV metrics and supporting dataclasses.
- Signal: Shared filters, resampling, smoothing, noise/distortion helpers, and FFT utilities.
Quickstart Examples
Compute heart rate from ECG peaks
Find PPG peaks and estimate SpO₂
Respiratory rate from RSP using FFT
IMU ENMO and tilt
Signal helpers: filter and FFT
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)
print(freqs[np.argmax(np.abs(sp))])