How sushantaman108durgadas/weartwin works
WearTwin is a simulation-led wearable physiology prototype, not yet a complete digital-twin application. Its demonstrated path is simulated ECG and embedded ECG sampling/analysis, alongside an MPU6050 orientation path using a Kalman filter. The README also describes planned multimodal feature extraction, state estimation, gateway, and operational decision uses; these are shown as documented future branches, not implemented services. The tree contains two firmware variants and separate ECG-processing experiments. Several links rely on README architecture statements because the sketch and many processing files were not excerpted.
Main entry points: src.ino Firmware Sketch · InertialState.cpp Inertial Processing · WearTwin_FreeRTOS.ino RTOS Firmware Sketch · CardialState.cpp ECG Analysis
Components 22
Signal Simulation
- ECG Simulator
src/ecgsim.chip.c - Wokwi API
src/wokwi-api.h - ECG Simulator
WearTwin_FreeRTOS/ecgsim.chip.c - Wokwi API
WearTwin_FreeRTOS/wokwi-api.h
Embedded Firmware
- Firmware Sketch
src/src.ino - ECG Analysis
src/CardialState.cpp - Inertial Processing
src/InertialState.cpp - Kalman Filter
src/KalmanFilter.cpp - RTOS Firmware Sketch
WearTwin_FreeRTOS/WearTwin_FreeRTOS.ino - RTOS ECG Analysis
WearTwin_FreeRTOS/CardialState.cpp - RTOS Inertial Processing
WearTwin_FreeRTOS/InertialState.cpp - RTOS Kalman Filter
WearTwin_FreeRTOS/KalmanFilter.cpp
ECG Processing
- Peak Detection
ECG_processing/cscripts/derivative_peak_detection.c - BPM Pipeline
ECG_processing/cscripts/peak_detection_bpm_pipeline.c - ECG Queue Tool
ECG_processing/cscripts/dequeue.c - Filter Experiments
ECG_processing/octavescripts/FIR_pipeline.m
Twin Architecture
- Feature Extraction
- State Estimation
- Digital Twin State
- Decision Layer
Other components
- Wearable Sensors
- Medic / Commander
Connections 17
- ECG Simulator → Wokwi API: writes simulated signal
src/ecgsim.chip.c - ECG Simulator → Wokwi API: writes simulated signal
WearTwin_FreeRTOS/ecgsim.chip.c - Wearable Sensors → Firmware Sketch: provides sensor data
README.md - Firmware Sketch → ECG Analysis: routes ECG samples
README.md - Firmware Sketch → Inertial Processing: routes IMU readings
README.md - Inertial Processing → Kalman Filter: uses filter
- Wearable Sensors → RTOS Firmware Sketch: provides sensor data
README.md - RTOS Firmware Sketch → RTOS ECG Analysis: routes ECG samples
README.md - RTOS Firmware Sketch → RTOS Inertial Processing: routes IMU readings
README.md - RTOS Inertial Processing → RTOS Kalman Filter: uses filter
- ECG Analysis → Feature Extraction: yields ECG metrics
README.md - Inertial Processing → Feature Extraction: yields orientation
README.md - Feature Extraction → State Estimation: feeds features
README.md - State Estimation → Digital Twin State: updates state
README.md - Digital Twin State → Decision Layer: informs decisions
README.md - Decision Layer → Medic / Commander: presents triage
README.md - Peak Detection → BPM Pipeline: supports BPM analysis