wifi-densepose-vitals
ESP32 CSI-grade vital sign extraction: heart rate and respiratory rate from WiFi Channel State Information (ADR-021).
Overview
wifi-densepose-vitals implements a four-stage pipeline that extracts respiratory rate and heart
rate from multi-subcarrier CSI amplitude and phase data. The crate has zero external dependencies
beyond tracing (and optional serde), uses #[forbid(unsafe_code)], and is designed for
resource-constrained edge deployments alongside ESP32 hardware.
Pipeline Stages
- Preprocessing (
CsiVitalPreprocessor) -- EMA-based static component suppression, producing per-subcarrier residuals that isolate body-induced signal variation. - Breathing extraction (
BreathingExtractor) -- Bandpass filtering at 0.1--0.5 Hz with zero-crossing analysis for respiratory rate estimation. - Heart rate extraction (
HeartRateExtractor) -- Bandpass filtering at 0.8--2.0 Hz with autocorrelation peak detection and inter-subcarrier phase coherence weighting. - Anomaly detection (
VitalAnomalyDetector) -- Z-score analysis using Welford running statistics for real-time clinical alerts (apnea, tachycardia, bradycardia).
Results are stored in a VitalSignStore with configurable retention for historical trend
analysis.
Feature flags
| Flag | Default | Description |
|---|---|---|
serde |
yes | Serialization for vital sign types |
Quick Start
use ;
let mut preprocessor = new;
let mut breathing = new;
let mut heartrate = new;
let mut anomaly = default_config;
let mut store = new;
// Process a CSI frame
let frame = CsiFrame ;
if let Some = preprocessor.process
Architecture
wifi-densepose-vitals/src/
lib.rs -- Re-exports, module declarations
types.rs -- CsiFrame, VitalReading, VitalEstimate, VitalStatus
preprocessor.rs -- CsiVitalPreprocessor (EMA static suppression)
breathing.rs -- BreathingExtractor (0.1-0.5 Hz bandpass)
heartrate.rs -- HeartRateExtractor (0.8-2.0 Hz autocorrelation)
anomaly.rs -- VitalAnomalyDetector (Z-score, Welford stats)
store.rs -- VitalSignStore, VitalStats (historical retention)
Related Crates
| Crate | Role |
|---|---|
wifi-densepose-hardware |
Provides raw CSI frames from ESP32 |
wifi-densepose-mat |
Uses vital signs for survivor triage |
wifi-densepose-signal |
Advanced signal processing algorithms |
License
MIT OR Apache-2.0