Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/src/control.dart
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,14 @@ RealtimeHr? parseRealtimeHr(Uint8List inner) {
final n = inner.length > 9 ? inner[9] : 0;
if (n > 0 && inner.length >= 12) {
final v = u16(inner, 10);
// 200-2500ms = 24-300bpm; was relaxed to `v>0` without comment, which lets
// corrupted/out-of-range timing noise straight into live RR — reverted.
if (v >= 200 && v <= 2500) rr.add(v);
}
if (n > 1 && inner.length >= 14) {
final v = u16(inner, 12);
// 200-2500ms = 24-300bpm; was relaxed to `v>0` without comment, which lets
// corrupted/out-of-range timing noise straight into live RR — reverted.
if (v >= 200 && v <= 2500) rr.add(v);
}
final wearing = inner.length > 18 ? inner[18] == 1 : true;
Expand Down
10 changes: 10 additions & 0 deletions lib/src/live.dart
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,11 @@ _Motion _r10Motion(ByteData view, int len) {
const activityFloor = 0.05;
if (std < activityFloor || n < 24) return _Motion(activity, 0);

// NOTE: was bumped to 25 without comment/test coverage; reverted — no test
// (parity or otherwise) exercises steps_inc/activity from R10, and ±25
// approaches the 7-40 sample autocorrelation lag range this detrend feeds,
// which risks attenuating genuine step periodicity at slower cadences.
// Re-widen only with a real-capture regression test backing it.
const w = 9;
final x = List<double>.filled(n, 0);
for (int i = 0; i < n; i++) {
Expand Down Expand Up @@ -292,6 +297,11 @@ DecodedSample? decodeRecord(String hex) {
hr: d.hr,
activity: 0,
stepsInc: 0,
// skinContact is contact QUALITY, not wear (see protocol notes) — the
// parity oracle proves it: 28 real v24 records have hr=87-97 (clearly
// worn) with skinContact<=50. hr>0 is the only signal in this fixture
// that agrees with ground truth on every case; keep it even though it's
// always false for v25 (hr deliberately undecoded there — see parseR24).
wristOn: d.hr > 0,
recType: recType,
);
Expand Down
251 changes: 0 additions & 251 deletions ts/live.ts

This file was deleted.

96 changes: 0 additions & 96 deletions ts/records.ts

This file was deleted.

Loading