hil: clock-quality gate in meter_anchored, soak recovers on any failed segment

This commit is contained in:
Lars Nolden
2026-09-01 18:16:03 +02:00
parent 3a38fe3f85
commit 678d3d6ee6
2 changed files with 11 additions and 1 deletions
+7
View File
@@ -98,6 +98,13 @@ def main():
anchors = np.array([r["timestamp_us"] / 1000.0 for r in strong])
span = len(db)
off, matched, err = fit_clock(bursts, anchors, span)
# A broken clock (sample drops, dongle stalls) makes every TX window
# meaningless. Reject rather than emit garbage.
if matched < max(5, len(strong) * 0.6) or err > 5.0:
print(f"clock fit unusable: {matched}/{len(strong)} anchors, "
f"median err {err:.1f} ms -- IQ stream integrity suspect",
file=sys.stderr)
sys.exit(3)
bst = np.array([b[0] for b in bursts], dtype=float)
meter_lv = []