What we built
The math is a library. The app only feeds it frames.
All signal processing lives in SignalCore, a Swift package that depends only on Foundation. It has no camera, no UI and no phone, so every stage is unit-tested on Linux and macOS. The iOS app owns the camera, torch, motion sensor, history and screens, and never does math of its own.
PACKAGESignalCore
Filter, peak detection, robust BPM, quality scoring and the completion policy. Every constant in one config file.
Depends on Foundation onlyTested 25 unit tests, Linux and macOS
Never clamps a value into a “normal” range
SERVICECameraService
Rear wide camera plus torch. Reduces each frame to one mean color and fingertip coverage.
Feeds optical samplesStops synchronously on every exit
Never stores or sends a frame
SESSIONMeasurementSession
Coordinates the flow: prepare, acquire, result or signal lost, with haptics and hardware lifecycle.
Owns workflow stateAsks SignalCore for every decision
Owns no math and no pixels
STOREMeasurementStore
SwiftData on the device, keeps the latest 500 readings for history and a Swift Charts trend.
Shows SAVED or NOT SAVED, honestlyTested compiled and run in CI
No cloud, no account
DEBUGSession analysis
Hidden view behind a long press: raw and filtered signal, detected peaks, intervals, every quality input, CSV export.
For evidence on a real deviceExports one CSV per session
Not part of the normal flow
SIMULATORSynthetic source
In the Simulator, a deterministic fingertip session replaces the camera, so the full flow and screenshots run without a phone.
Scenarios good and signal-lostUsed by tests and CI screenshots
Never active on a real device run