Body Position, Actigraphy
& Respiratory Effort
Reference for every metric MotionDex surfaces from Polar inertial streams (H10 chest strap, Verity Sense armband) — body position from the gravity vector, actigraphy from de-gravitated acceleration, and respiratory rate and effort from the chest stream. Definitions, formulas, coverage rules, and the evidence base behind each. Companion to the analyzer; not a substitute for clinical evaluation.
Each 30 s epoch, MotionDex takes the component medians of the epoch’s acceleration samples as the gravity vector, in g. A fixed-threshold, Z-first scheme then names the posture. Position prefers the chest (torso) stream and falls back to the wrist stream. An epoch whose gravity magnitude falls outside 0.4–2.0 g is not static, so it reads unknown; an epoch with no samples at all leaves the dwell denominator entirely — it is neither a posture nor an unknown posture, although the timeline still records it as unknown so the track stays dense.
| Epoch class | Rule (gravity medians, unit vector u) | Read |
|---|---|---|
| supine | |uz| ≥ 0.7 and gz > 0 | Back down, sensor facing up |
| prone | |uz| ≥ 0.7 and gz < 0 | Front down |
| upright | |uy| ≥ 0.55 | Torso vertical — a wake / out-of-bed signal |
| left / right | otherwise, by the sign of gx | Lateral — the X sign is ungrounded in an uncalibrated frame |
| unknown | magnitude outside 0.4–2.0 g | Moving or off-body — counted in the track, never in a dwell share |
The share of covered epochs classified supine — the dwell that positional sleep-apnea management aims to reduce, which is why this is the one posture share the registry promotes to a metric.
Declared in the registry, not implemented. No compute site exists, so this metric reaches no export and no surface. The declaration records the intent: gravity-vector upright dwell as a coarse wake / out-of-bed proxy. The position track above does classify upright epochs; a registered upright share does not exist yet.
Declared in the registry, not implemented. No compute site exists, so this metric reaches no export and no surface. The declaration records the intent: combined left/right gravity-vector dwell. The position track above does classify lateral epochs; a registered lateral share does not exist yet, and the left/right sign it would rest on is ungrounded in the uncalibrated frame.
Actigraphy works on the dynamic part of the signal: a ≈1 s moving-average baseline removes gravity, and what remains is movement. Sampling rate is always the measured native rate (the median inter-sample interval) — never a nominal rate and never count ÷ span. Epochs inside a recorded blanking run (the ACCRUNS sidecar) are excluded, and an uncovered epoch is not recording — its count and its moving flag are both null, never immobile.
The night’s total movement, summed over covered epochs — the raw actigraphic volume the other two actigraphy metrics normalise.
Average activity per covered epoch — the restlessness headline. Lower is more restful.
The share of covered epochs at or below the movement threshold — stillness, stated only where stillness was actually observed.
Breathing lives on the chest stream alone. A 10 s moving average removes drift and gravity while a ≈1.5 s average removes the cardiac component, leaving the 0.1–0.6 Hz effort waveform on whichever axis carries the most respiratory-band variance. Rate is tracked spectrally, not counted from that waveform; the zero-crossing breath count is retained alongside as a cross-check.
Breathing rate from the chest accelerometer: 60 s windows on a 30 s hop, band-passed 0.13–0.5 Hz, tracked as a spectral ridge with Viterbi smoothing (σ 1.2 br/min) and blended with a time-domain estimate. The tracker abstains below a confidence of 0.28, and a window under 80% coverage is not recording — it leaves the coverage denominator, because a sensor that was off is not a sensor that failed to produce a rate.
| Validation (project corpus) | Result |
|---|---|
| Corpus | 49 ACC/CPAP-paired nights · 8,057 epochs, H10 chest ACC vs ResMed CPAP flow |
| MAE | 1.10 br/min (95% CI 0.96–1.27), at 100% coverage |
| Within 2 br/min | 90.8% of epochs (97.2% at 70% coverage, MAE 0.63) |
| Null baseline | Predicting the corpus median scores MAE 1.64 on the same epochs |
How strong the breathing movement is, as the RMS of the effort waveform — a surrogate for thoraco-abdominal effort, in g.
The share of recorded 10 s epochs in which effort is detectable at all — a coverage statement, not an amplitude.
One confidence number summarises how much of the stream is trustworthy. It is computed per stream: when the actigraphy stream’s source differs from the position stream’s, actigraphy carries its own SQI. On export, a placeholder SQI (no data, or a unit that could not be determined) is published as null with its reason — while a measured 0 is a measurement and stays 0.
A 0–1 confidence from three direct detectors over the stream’s magnitude series.
| Detector | Sample rule | Flag at |
|---|---|---|
| clip | |mag| > 7.5 g (impact range) | clipFrac > 2% |
| flatline | successive Δmag < 1e-4 | flatFrac > 50% |
| sensor-off | |mag| < 0.05 g (near-zero) | offFrac > 20% |
Validation refers to the underlying metric’s standing, and does not imply validation of the MotionDex implementation beyond what each row states.
| Metric Category | Status | Basis |
|---|---|---|
| Activity counts, movement index, immobile time | ● Measured | Direct, frame-invariant statistics on the recorded stream |
| Signal quality (SQI) | ● Measured | Direct detector fractions (clip / flatline / sensor-off) |
| Respiratory rate | ◐ Emerging | Validated against CPAP flow: 49 nights, 8,057 epochs, MAE 1.10 br/min — single subject |
| Supine time (body position) | ○ Experimental | Gravity angles measured; posture names an uncalibrated-frame convention |
| Effort amplitude, effort present | ○ Experimental | Accelerometer surrogate; uncalibrated floor and scale |
| Upright time, lateral time | — Declared, not implemented | Registry declarations with no compute site; they reach no export and no surface |
| Tier | Meaning | Examples |
|---|---|---|
| Core | Headline, universally interpretable | Supine time, movement index, immobile time |
| Advanced | Established support, fuller analysis | Activity counts, respiratory rate, signal quality |
| Research | Exploratory / surrogate | Effort amplitude, effort present |
| Metric / Formula | Primary Citation | Category |
|---|---|---|
| Respiratory rate — time-domain blend | Charlton et al. 2016 | Breathing |
| Respiratory rate — spectral ridge + Viterbi tracker | MotionDex internal — validated on the project corpus (49 nights) | Breathing |
| Body-position threshold scheme | After Rocha et al. 2026 (calibrated sternal method; the calibration step is not implemented here) | Position |
| Effort presence floor (0.004 g) | Ryser 2022 scale, as recorded in the DSP source | Breathing |
| Activity counts, movement index, immobile time, SQI, dwell shares | MotionDex internal — direct statistics, no external source | Internal |
| Formula | Source / Author | Year | Reference |
|---|---|---|---|
| Time-domain respiratory-rate blend (weight 0.3) | Charlton, Bonnici et al. | 2016 | Physiol Meas. 37(4):610–626 |
| Spectral ridge + Viterbi rate tracker | MotionDex internal | 2026 | Project corpus validation — 49 nights vs CPAP flow |
| Gravity-threshold position scheme (Z-first) | After Rocha et al. | 2026 | Am J Respir Crit Care Med — as cited in the project build brief; calibration step not implemented |
| Effort presence floor, 0.004 g | Ryser | 2022 | Scale as recorded in motiondex-dsp.js |
| De-gravitated counts; SQI confidence | MotionDex internal | 2026 | No external source — direct statistics |
- The device frame is uncalibrated — posture names are a convention
- The left/right sign has no grounded reference
- Position prefers the chest stream; the wrist fallback reads a different body site
- GYRO and MAGN streams are parsed and counted, not computed on
- No sleep staging or apnea typing in this node — those are Integrator fusions
- Respiratory rate is validated on one subject and one posture
- Effort is a movement surrogate, not airflow or pressure
- Actigraphy has no PSG validation in this project
- Uncovered epochs are absence (null), never stillness or zero
- A clock seam refuses the immobile fraction rather than estimating it
- An undetermined ACC unit refuses every magnitude-derived output, by name
- Sampling rates are measured, never assumed — an unmeasurable rate refuses the stream
- Not FDA cleared or CE marked as a medical device
- Not for clinical diagnosis or treatment decisions
- Personal, research, and wellness use only
- Discuss medical concerns with a qualified clinician
| Method / Metric | Primary Citation | Category |
|---|---|---|
| Respiratory rate — time-domain blend | Charlton PH, Bonnici T, Tarassenko L, Clifton DA, Beale R, Watkinson PJ. An assessment of algorithms to estimate respiratory rate from the electrocardiogram and photoplethysmogram. Physiol Meas. 2016;37(4):610–626. doi: 10.1088/0967-3334/37/4/610 | Breathing |
| Body-position classification scheme | Rocha et al. Sternal-accelerometer position classification. Am J Respir Crit Care Med. 2026. Citation as recorded in the project build brief (per-class F1 0.92–0.95 for the calibrated method); DOI not printed — unverified. MotionDex does not implement the calibration step, and claims none of that accuracy. | Position |
| Effort amplitude scale / presence floor | Ryser et al. 2022 — effort scale as recorded in motiondex-dsp.js. Full citation not verified; no DOI printed. | Breathing |
| Activity counts, movement index, immobile time, signal quality, dwell shares | MotionDex internal — direct statistics on the recorded stream. No external source. | Internal |
Implementation · Validation · UI/UX
Literature synthesis · Reference formatting
Planicka M. MotionDex: Motion / IMU Analysis Node. Version 1.0.0. 2026.