Vital Signs Monitoring
Relevant source files
The following files were used as context for generating this wiki page:
- v2/crates/wifi-densepose-vitals/src/breathing.rs
- v2/crates/wifi-densepose-vitals/src/heartrate.rs
- v2/crates/wifi-densepose-sensing-server/src/vital_signs.rs
- v2/crates/wifi-densepose-vitals/README.md
- ui/mobile/README.md
- examples/medical/vitals_suite.py
- scripts/apnea-detector.js
- plans/phase1-specification/api-spec.md
Vital Signs Monitoring in the RuView project provides contactless extraction of human respiratory and cardiac metrics. The system analyzes perturbations in radio frequency signals—specifically WiFi Channel State Information (CSI) and mmWave radar data—to detect micro-movements caused by chest displacement and heartbeats. This feature serves as a privacy-preserving alternative to camera-based monitoring in healthcare, elderly care, and disaster response scenarios.
The monitoring suite encompasses a multi-stage Rust-based pipeline for real-time processing, a Python-based medical analytics suite, and a cross-platform mobile interface for visualization. It supports the detection of breathing rates (6–30 BPM) and heart rates (40–120 BPM) with integrated anomaly detection for conditions such as apnea or tachycardia.
System Architecture
The vital signs monitoring architecture follows a four-stage signal processing pipeline implemented in the wifi-densepose-vitals crate. This pipeline transforms raw RF data into actionable medical insights.
This diagram illustrates the flow of RF data through the four processing stages to final storage and visualization.
Sources: v2/crates/wifi-densepose-vitals/README.md:16-24, v2/crates/wifi-densepose-vitals/README.md:58-65
Core Processing Stages
- Preprocessing: The
CsiVitalPreprocessoruses Exponential Moving Average (EMA) to suppress static environmental components. This isolates the body-induced signal variations required for analysis. - Breathing Extraction: The
BreathingExtractorapplies a bandpass filter (0.1–0.5 Hz) and performs zero-crossing analysis to estimate the respiratory rate. - Heart Rate Extraction: The
HeartRateExtractorutilizes a bandpass filter (0.8–2.0 Hz) combined with autocorrelation peak detection and inter-subcarrier phase coherence weighting. - Anomaly Detection: The
VitalAnomalyDetectorperforms Z-score analysis using Welford running statistics to identify clinical alerts like apnea or bradycardia.
Sources: v2/crates/wifi-densepose-vitals/README.md:16-24
Medical Metrics and Analysis
The system generates a comprehensive suite of vitals and wellness metrics. These are calculated via the VitalsSuite logic which handles raw buffer management and statistical tracking.
Vital Sign Specifications
| Metric | Range / Unit | Method |
|---|---|---|
| Breathing Rate | 6–30 BPM | 0.1–0.5 Hz Bandpass + Zero-Crossing |
| Heart Rate | 40–120 BPM | 0.8–2.0 Hz Bandpass + Autocorrelation |
| HRV (Stress) | SDNN / RMSSD | Inter-beat interval (RR) variation analysis |
| Sleep Stage | Awake / Light / Deep / REM | BR variability + HR pattern classification |
| Apnea | Duration (s) | Detection of BR < 3.0 for > 10 seconds |
Sources: ui/mobile/README.md:19-33, examples/medical/vitals_suite.py:173-195, scripts/apnea-detector.js:43-52
Sleep and Meditation Scoring
The VitalsSuite classifies sleep stages by analyzing heart rate variability (HRV) and breathing regularity.
- Deep Sleep: Indicated by low HR, low BR, and low variability in both.
- REM: Characterized by moderate HR with high HRV and low BR.
- Meditation Score: Calculated as a coherence score (0-100) based on BR regularity (40%), HR deceleration (30%), and HRV increase (30%).
Sources: examples/medical/vitals_suite.py:173-221
API and Data Integration
Real-time vitals data is exposed through WebSocket and REST interfaces. The wifi-densepose-sensing-server facilitates the streaming of SensingFrame objects which include a VitalSigns payload.
WebSocket Data Flow
Sequence of real-time vitals data delivery from the sensing server to the mobile UI components.
Sources: ui/mobile/README.md:160-179, plans/phase1-specification/api-spec.md:316-328
Vitals Data Model
The VitalsData structure within a SensingFrame contains the following fields:
breathing_bpm: The estimated respiratory rate.hr_proxy_bpm: The estimated heart rate proxy.confidence: A percentage indicating the reliability of the reading.
Sources: ui/mobile/README.md:188-198, plans/phase1-specification/api-spec.md:27-46
Mobile Visualization
The mobile application provides a dedicated Vitals Screen for monitoring detected subjects.
- Arc Gauges: Animated
GaugeArccomponents display current BPM values for breathing and heart rate. - Sparkline Charts: mini-charts showing a 60-sample history to track trends and stability.
- Confidence Indicators: Visual percentage HUDs that inform the user of signal quality.
- Fallback Mode: If the server is unreachable, the
simulation.service.tsgenerates synthetic vitals data to keep the UI functional for demonstration.
Sources: ui/mobile/README.md:19-33, ui/mobile/README.md:231-236
Apnea Detection Engine
A specialized detection script (apnea-detector.js) monitors breathing rate time series to screen for respiratory disorders.
Logical flow for identifying apnea and hypopnea events from a breathing rate stream.
Sources: scripts/apnea-detector.js:77-133
The engine calculates the Apnea-Hypopnea Index (AHI) by dividing total events by the monitoring duration in hours. It classifies severity into "Normal" (<5), "Mild" (5-15), "Moderate" (15-30), and "Severe" (>30).
Sources: scripts/apnea-detector.js:135-150
Implementation Summary
Vital Signs Monitoring in RuView leverages high-frequency CSI sampling (100Hz) and specialized bandpass filtering to achieve contactless medical sensing. By integrating Rust-based edge processing with cross-platform mobile visualization and detailed Python analytics, the system provides a robust framework for health monitoring without the need for cameras or wearable devices. While effective for research and wellness monitoring, the system documentation explicitly states it is not a clinical diagnostic device.