Browse Source

libchirpmodem: no failure report for a sync on the tail of a decoded frame

A strong frame's last pilot is an up-chirp. The detector and sync can lock
onto it again within a symbol of the frame's end, the time shift showing
as a large frequency offset; nothing follows, so the header fails and a
"preamble found, header fail" was reported. Seen once in SDRangel at
+17 dB (sync 55 chips before the end, offset -22.8 kHz) and reproduced
from the recording at 150 kS/s: two such reports, syncs at -55 and +341
chips from the frame end. The existing check only dropped syncs more than
M/2 before the end.

A failed candidate whose sync starts before one symbol after the end of
the frame just decoded is now a false alarm: not counted, not reported.
Candidates there are still tried, so a real frame starting back to back is
delivered as before.

Decoded frames are identical on all captures; back-to-back frames (gap 0,
SF9 and SF7 coherent, clean to -8 dB) decode 6/6 with old and new. make
test and tools/check_c.py pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
master
Daniel Peter Chokola 2 weeks ago
parent
commit
0e8e1d1b9d
  1. 7
      c/src/cm_stream.c

7
c/src/cm_stream.c

@ -480,6 +480,13 @@ static void service(stream_t *s)
s->busy_until = (long)start + r.frame_chips; s->busy_until = (long)start + r.frame_chips;
deliver(s, &r, t); deliver(s, &r, t);
} else { } else {
/* A strong frame's last pilot (an up-chirp) can sync again just
* around its end, the time shift showing as a frequency offset.
* Nothing follows it, so its header fails. A real frame starting
* there, back to back, is still tried above and delivered if it
* decodes; only the failure is treated as the false alarm it is. */
if (s->n_ok > 0 && start < s->busy_until + M)
continue;
s->n_fail++; s->n_fail++;
if (s->cfg.report_failures) if (s->cfg.report_failures)
deliver(s, &r, t); deliver(s, &r, t);

Loading…
Cancel
Save