Add configurable pace-artifact filtering to replace the hardcoded cutoff

Two new Profile settings -- "minimum representative pace" and "minimum
representative time" -- replace the previous hardcoded 20:00/km cutoff. A
stretch of consecutive samples slower than the configured pace is now
dropped from the chart (and its Y-axis scale) only if it lasts no longer
than the configured time; a longer stretch is kept as a real stop or walk
break rather than noise. Defaults to 12:00/km and 3 seconds.

Caught a boundary bug while verifying against real data: a run lasting
exactly the threshold duration survived filtering because the comparison
used strict "<" instead of "<=", contradicting "not lasting more than N
seconds" (which should include exactly N).
This commit is contained in:
2026-07-19 17:38:50 +02:00
parent 619277b0ee
commit 513418123f
7 changed files with 170 additions and 14 deletions

View File

@@ -0,0 +1,9 @@
-- Filters brief pace "artifacts" (e.g. GPS/motion still settling right as
-- recording starts, before the run itself begins) out of the Review
-- Queue's pace chart: a stretch of samples slower than
-- min_representative_pace_sec_per_km is dropped unless it persists for at
-- least min_representative_time_seconds, in which case it's treated as a
-- real stop or walk break, not noise. Defaults match the values used to
-- design this feature (12:00/km, 3 seconds).
ALTER TABLE profile ADD COLUMN min_representative_pace_sec_per_km REAL NOT NULL DEFAULT 720;
ALTER TABLE profile ADD COLUMN min_representative_time_seconds REAL NOT NULL DEFAULT 3;