data1/data2 are the actual telemetry content in the payload (it changes
frame to frame, with no known correct answer). The header + callsign
address (144 bits, fixed protocol content, the only segment with a known
correct answer) is used to measure the bit=1/bit=0 signal distribution
asymmetry: bit=1's mean sits close to +A, while bit=0's mean is noticeably
off from -A. This folder applies the fixed offset threshold calibrated from
the header to data1/data2, presented via two scripts:
| Script | Content | Output |
|---|---|---|
03a_data_asymmetry_check.py |
Shows the asymmetry itself: per-point color coding + each group's local moving average, to see whether the asymmetry drifts slowly with position | Figure/03a_frame1.png, 03a_frame2.png, 03a_frame3.png |
03b_data_fixed_offset_threshold.py |
Applies the calibrated fixed offset threshold to data1/data2, overlaying the decision line, and rings every symbol sitting close to that line -- below or above it. The second panel's range is extended past data2 through zero-run2 and FCS, with those boundaries marked | Figure/03b_frame1.png, 03b_frame2.png, 03b_frame3.png |
03c_symbol_sync_timing.py |
digital.symbol_sync_ff, sweeping TED type × loop bandwidth × front-end filter (125 configs) on frame#1, scored by CRC pass > header bit-error count > near-decision-line count |
Figure/03c_frame1.png |
Both scripts' frame detection uses the same method as
01_frame_detection/ (normalized
cross-correlation to find header correlation peaks), outputting one figure
per detected frame (numbered in order of sample position).
★ Bypass method: when locating the data1/data2 sample ranges and when
computing the threshold, both scripts sample the raw y directly at a
fixed rate and destuff it, without going through restore_baseline -- header
alignment was verified to be cleanest this way. restore_baseline is only
used in the frame-start-detection step (it needs y_comp_final to get clean
correlation peaks); the actual threshold calibration and data-segment
analysis both use raw y only.
| Symbol | Meaning |
|---|---|
the raw signal (sample audio_io.read_audio, without baseline compensation) |
|
this frame's start sample (detected by the same method as 01_frame_detection/) |
|
same as 01_frame_detection/: samples per symbol (=5), sampling phase (=2) |
|
| the header+address's known true value for bit |
|
| the sets of symbol-center signal values in the header whose true value is 1 / 0 | |
| a candidate threshold | |
| the calibrated, best fixed offset threshold | |
| symbol |
|
| the data segment's decision result (0 or 1; ★ this is a threshold decision, not ground truth) | |
| amplitude estimate, |
|
| "near the decision line" half-band, |
Exactly the same normalized cross-correlation method as
01_frame_detection/ -- see that folder's README "Algorithm" section for
details, not repeated here.
Take the symbol-center values of the header+address's 144 known bits, and split them into two groups by their true value:
Scan candidate thresholds
This threshold is re-calibrated from this frame's own header, not borrowed from a value computed for another frame.
After skipping the leading 4 flags, sample the raw ../REFERENCE_FRAME.md) known field boundaries (data1 = payload
byte [14,75), data2 = payload byte [158,206)) and convert them back into
sample ranges, giving this frame's own exact data1/data2 sample ranges.
03b extends data2's range one step further, through zero-run2
([206,272)) and FCS ([272,274), the 2-byte CRC-16/X.25 appended after the
272-byte payload) -- so its second panel plots data2+zero-run2+FCS as one
continuous span, with the zero-run2/FCS boundaries marked as vertical dotted
lines. 03a is unaffected and still plots data2 alone.
Use
Two views are drawn: (1) a per-point scatter plot color-coded by
Draw the same $\theta^$ directly as a decision line over the raw waveform, keeping the old threshold's (=0) line for reference. Then ring every symbol whose distance to $\theta^$ falls inside a symmetric half-band, on either side:
This is a different (and broader) set than "symbols whose decision changed
between
The second panel's extended range (data2+zero-run2+FCS) applies 03a was built around. zero-run2 is shaded gray (it's expected all-zero,
not the segment in question) and FCS is tinted cyan, so it's visually
obvious whether the CRC bits themselves have any low-confidence symbols,
without zero-run2's much larger candidate count drowning them out. The
terminal output also prints the near-decision-line count restricted to just
the FCS sub-range.
- The asymmetry reproduces across all three frames, though the calibrated threshold differs (frame#1 +0.151, frame#2 +0.200, frame#3 +0.075) -- the asymmetry's existence is stable, but its exact magnitude varies by frame; it isn't a single global constant.
-
03a's local moving average shows the asymmetry isn't a constant offset, but drifts slowly with position within the segment (the "invisible curve"): the decided-as-0 group's average drifts closer to 0 around the middle of the segment, then back away near both ends, while the decided-as-1 group stays relatively stable. This means a single fixed offset threshold can only correct the mean -- it can't fully remove this position-dependent component. -
03bshows the old-vs-new threshold decision difference is small but nonzero: across the three frames, roughly 2-7% of data1/data2's symbols have their decision changed by switching thresholds; the new threshold pushes the "decided as 0" group's mean further from -A (see 03a's output), but there's no CRC or other independent verification confirming whether this actually improves accuracy. -
The symmetric near-decision-line band (±10%A around
$\theta^*$ ) flags a similar-sized but not identical group: roughly 1.6-6.7% of data1/data2's symbols per segment, across the three frames -- including some that sit just above$\theta^*$ and therefore never showed up in the old-vs-new comparison at all. These are the natural starting point for the "check against an actually-decoded frame" direction in the main README, since they're low-confidence independent of which exact threshold is correct. -
Extending the second panel through zero-run2+FCS roughly doubles the
near-decision-line fraction (from ~2-7% over data2 alone to ~10-14% over
data2+zero-run2+FCS, across the three frames) -- most of the added
low-confidence symbols fall inside zero-run2, consistent with
02_zero_run_baseline/'s finding that the all-zero padding isn't cleanly resolved either (its "isolated 1s" are exactly this same low-confidence population, seen from the other side). - FCS itself looks clean: of the 16 CRC bits, 0/16 (frame#2), 2/16 (frame#1), 2/16 (frame#3) land within the near-decision-line band -- a rate in the same ballpark as data1/data2, not visibly worse. The CRC bits' low-confidence count doesn't stand out from the rest of the frame, which argues against "the CRC itself is unusually hard to slice" as an explanation for the 0-frames-pass-CRC result.
-
Real symbol timing recovery (03c) improves header BER but doesn't fix
CRC: swapping the fixed-rate/fixed-phase sampling for GNU Radio's actual
symbol_sync(best config: Gardner TED, loop_bw=0.08, 0.75x-symbol-rate low-pass front end) drops frame#1's header bit-error count from 5/144 (current fixed-phase method) to 2/144, with a visibly cleaner eye diagram. CRC still fails at the best config, though -- timing recovery alone isn't the whole story.
pip install numpy matplotlib soundfile
python 03a_data_asymmetry_check.py
python 03b_data_fixed_offset_threshold.pyNeeds ../scionx/ (audio_io.py / baseline.py) and ../_style.py, which
live one directory up -- the scripts find them automatically. Running them
saves one new PNG per detected frame into this folder's Figure/ subfolder,
and prints each frame's calibrated threshold, header error count, and
data1/data2 decided-as-1/decided-as-0 statistics to the terminal.
03c_symbol_sync_timing.py is the one exception: it needs a Python with
GNU Radio installed (confirmed working with radioconda's), and only
processes frame#1 (a full 3-frame x 125-config sweep is the point where
GNU Radio's block-scheduling overhead per run starts to matter):
path/to/radioconda/python.exe 03c_symbol_sync_timing.py