TDMUSIC · progress briefing
← Back to briefing
ABILITY · BIOMETRIC SIGNAL PIPELINE · EXPERIMENT PROGRAM · LEARNING ARCHITECTURE

From a measured library to a system that keeps learning.

What has to happen to wearable data before it can be trusted (noise, artefacts, baseline, residuals), how the efficacy experiments are run and analysed, and how the product turns every session into an experiment that improves the sound it plays — the company's engine (demand signal → AI production → measured library) applied inside the product. Wellness-only; nothing here diagnoses or treats.

Source: research/ML_RESEARCH_DESIGN.md · METHODOLOGY_DESIGN.md §4 (identification) · DECISION_MODEL.md (gates)

/ 01Signals · what they can and cannot say

HR steers, HRV is measured, self-report is the construct

HR · bpm
≈ 6% err

accurate on wrist PPG · live 1–5 s → the control signal and co-primary physiological outcome

HRV · RMSSD / SDNN
≈ 29% MAPE

vagal-tone marker (higher = calmer) but noisy and sparse on wrist; Oura overnight only → before/after outcome, never the live loop

Self-report
STAI-6

+ single-item calm 0–10 · the construct measure and the training label

Context
moment

time of day · motion · recent activity · self-tagged moment (acute / wind-down / pre-performance)

SourceWhatRateAccess realityUse
Apple Watch · HealthKitHR1–5 s in a workout/mindfulness sessionuser permission; live via workout session / anchored querylive control · outcome
Apple Watch · HealthKitHRV SDNNopportunistic · lag ≤ 30 minpermissionbefore/after · baseline model
watchOS appbeat-to-beat (heartbeat series)in-sessionpermissionRMSSD in-session — best available on wrist
Oura API v2nightly HRV, HR, sleep, readinessnext morning · 5-minneeds active membershipbaseline · next-day personalisation · sleep-onset outcome
Polar H10RR intervals (ECG-grade)1 msBLE in pilotground truth for calibration
Accelerometermotion50 Hzpermissionartefact masking

Direction check: relaxation raises HRV and lowers HR.

/ 02Signal-processing pipeline · pre-registered rules

Clean → smooth → baseline → residual: "calmer than your usual 10 pm"

Beat-level (RR available: Polar, watch series)
1
Range — drop RR < 300 ms or > 2,000 ms.
2
Artefact / ectopic — flag |RR_t − local median| > 20% (Kubios-style; sensitivity 15/25%).
3
Interpolate flagged beats (cubic spline); > 5% flagged in a 60-s window → window low quality, excluded.
4
Detrend — smoothness priors (λ = 500) before HRV features.
5
Features / 60 s — mean HR, RMSSD, SDNN, pNN50; log-transform HRV.
PPG heart rate (Apple Watch stream)
1
Motion mask — 5-s windows with accel SD > 0.05 g flagged; not used for control or outcome (hold last good value).
2
Outlier — jump > 12 bpm without motion → hold and re-check.
3
Kalman smoothing — process noise tuned on the calibration set (lag < 5 s vs Polar-derived HR, RMSE < 3 bpm); fallback 5-s median.
4
Quality index per session = share of clean windows; < 70% → excluded from outcome analysis (reported).
Baseline normalisation & residualisation — the "what would have happened anyway" model

Per user, on ≥ 14 days of non-session data (HealthKit background / Oura nightly), ridge-shrunk toward population curves so a new user borrows the population baseline:

HR_it = α_i + f_i(time-of-day_t) + g_i(day-of-week_t) + δ_i·activity_t + ρ_i·HR_i,t−1 + e_it r_it = observed_it − predicted_it (residual) Δr_i,session = mean(r_it | last 5 min) − mean(r_it | pre-rest 5 min) (outcome · reward · what the user sees)

Δr is (a) the pilot's physiological outcome, (b) the reward signal for learning, (c) the number shown to the user. Robust within-person z (median/MAD) for display and cross-user comparison. Same for log-RMSSD where available.

Calibration sub-study (E0)

n ≈ 8, Watch + Polar concurrently, 3 sessions each → ICC, MAPE, reliability ratio λ. De-attenuate any model where wrist HRV is a regressor; as an outcome, non-differential error only costs power (documented).

Differential-error check

Compare motion-flag rates across conditions (a beat-driven track may induce tapping); if they differ, sensitivity analysis on clean windows only.

Why residuals, not raw change

Raw pre→post confounds regression to the mean, circadian drift and arrival spikes with the session. The residual is the session's contribution beyond the person's own expected trajectory.

/ 03Experiment program · E0 – E4

Two in the design-thinking phase, three on the roadmap — one learning loop

IDQuestionDesignnAnalysisFeeds
E0 calibrationHow noisy is the wrist vs ECG-grade RR?concurrent Watch + Polar, 3 sessions8ICC · MAPE · λpipeline · A2b measurement LR
E1 efficacy pilot (WoZ)Does a 15-min adaptive session lower STAI-S and residual HR / raise RMSSD vs an active control? Real song vs neutral?within-subject, 3-condition Latin square (T1 neutral · T2 real song · C generic playlist); a human "plays the algorithm" from the rule table20–30 × 3mixed model (ANCOVA form) · Bayesian re-analysis with meta-analytic prior · contrast T1 − T2A2a · A2b · A1a
E2 in-app micro-experimentsWhich parameters/variants settle HR faster, per moment?every session randomly assigns a variant (content type × preset) from an allowed set; moment tag; before/after self-report100+ usershierarchical model of Δr and self-report on variant × moment; sequential Bayesian updating; A/B/nproduct · the measured library
E3 personalisationCan a per-user policy beat the population default?contextual bandit (Thompson sampling) over presets; context = moment, HR z at start, time; hierarchical prior from E2same cohortoff-policy evaluation (IPS / doubly-robust) on logs before switch-on; then online regret vs defaultproduct
E4 self-generating libraryCan generated variants from the AI engine be evaluated and kept automatically?generate N variants per parameter cell; each is an arm with a shrunk prior; promote / retire by posterior thresholds; human listening QA gaterollingbandit + posterior thresholdsthe engine at product scale
E1 rule table — so a human can "be" the algorithm (v0 controller)
Start — tempo/texture target = f(start HR): HR ≥ 90 → 66-bpm pulse, dense→sparse; 75–90 → 60; < 75 → 56. Entrain near the listener's rate, then lead down (Bernardi 2006).
60 s
residual HR fell ≥ 2 bpm → step tempo −2 bpm, brightness one notch down · rose ≥ 3 bpm without motion → hold, remove any transient layer · unchanged → hold.
Guardrails — never below 50 bpm equivalent; no sharp onsets; loudness fixed −16 LUFS; identical rules for T1 and T2; C plays the generic playlist untouched.
Models, in order of introduction
1
v0 controller — the rule table. Ships with the pilot.
2
Hierarchical Bayesian outcome model (E2) — Δr_ijs ~ N(μ + a_variant + b_moment + (ab) + u_i, σ²), partial pooling → population and per-user estimates with honest uncertainty; the same Bayesian idiom as the decision layer.
3
Contextual bandit (E3) — arms = presets; reward = −Δr_HR (standardised) + λ·Δself-report; Thompson sampling with the hierarchical posterior as prior; exploration ≤ 15% of sessions; an arm worse than default by > 0.3 SD is suspended for that user.
4
Generative loop (E4) — AI-engine variants as arms with shrunk priors; promotion / retirement by posterior thresholds; human listening QA before anything enters the acute mode (the "hospital air-conditioning" risk).
5
Later — sequence models on the HR trajectory (state-space / small GRU) to predict "will settle in < 5 min". Not needed for the gates.
/ 04Learning architecture

Signal → baseline → state → policy → sound → log → learn

DEVICEON-DEVICECLOUD · PER USEROFFLINE · POPULATION Watch / ringHR 1–5 s · motionHRV opportunistic Signal layermotion mask · Kalman smoothingquality index · 60-s features Baseline model (per user)time-of-day · activity · HR_t−1residual r_t · robust z State estimatormoment tag · HR z · trend→ context Policy · banditThompson sampling · presetsper-user posterior Audio enginev0 rules → parameterisedtempo · brightness · density Session logvariant · params · HR seriesΔr · self-report · quality Offline learninghierarchical model · off-policy eval (IPS / DR)promote / retire variants (E4) · registry sound → listener → body population prior → policy

Metrics

Primary: mean residual HR change last 5 min vs pre-rest (bpm), by moment. Secondary: RMSSD Δ where available, self-report Δ, completion, D30 retention.

Guardrails

Every policy change evaluated offline (IPS/DR) then online vs a hold-out default cohort; never 100% rollout untested. Never optimise on self-report alone (expectancy) nor HR alone (stillness) — composite reward + quality index.

What the dissertation claims

§1–3 measurement stance and pipeline, E0–E1 design/results, the v0 rule table, and this architecture as the "ability" argument. E2–E4 are the post-PROCEED roadmap.

/ 05Data governance · ethics · safety

Health data without medical claims

Consent & minimisation

Consent per data type; beat-level data processed on-device; only windowed features and session summaries leave the phone; user deletion; regional storage; GDPR consent basis; HealthKit and Oura terms.

Fairness

PPG accuracy varies with skin tone, motion and temperature — quality index and calibration reported by sub-group; no score that penalises a user for sensor noise.

Safety

HR > 130 at rest or a self-tagged panic state → grounding message, no numbers shown; general help-line pointer only; wellness language everywhere ("settle", "unwind" — never "treat").