Repository navigation
Make the SSTV decoder work on real off-air audio - #480
Merged
Merged
Conversation
Live HF tests decoded the VIS header but produced an all-white speckled image. Four defects, verified by encoding spec-timed transmissions (leader + VIS + image, as MMSSTV/QSSTV and phone apps send them) and decoding them through the full pipeline: - The VIS reader took 7-bit codes as 8 data bits, so it swallowed the parity bit, read the stop bit as parity, and handed the image decoder its audio one bit (30 ms) late. Every mode decoded shifted by 64-75 pixels, and detection itself only worked when the error-correction fallback happened to flip the phantom eighth bit. - No bandpass before the instantaneous-frequency pixel demodulator. rtl_fm's SSB output carries noise across its whole bandwidth, and the demodulator reads that as a very high frequency, bleaching the image white even when the narrowband Goertzel VIS detector hears the signal clearly. Audio now passes a linear-phase FIR bandpass (400-3000 Hz, group delay compensated) in both the live and file pipelines, and per-sample frequencies are clamped to the SSTV tone range. - Scottie's one-off 9 ms starting sync was never consumed, shifting Scottie images by a further constant amount; Scottie lines never re-sync, so the error could never heal. - Sync search took 'window with the most 1200 Hz energy', which lands anywhere on the pulse's energy plateau. It now finds the trailing edge of the pulse, which also survives the stop-bit tail merging into the first sync. Channel demodulation gets guard samples around each segment so FFT edge artifacts stop blowing out the first and last pixel of fast modes. A synthetic end-to-end matrix (Martin 1/2, Scottie 1/2, Robot 36/72; clean, noisy, and ±150 Hz mistuned) now decodes with mean pixel error 3-13 on clean audio where it previously scored ~120 (noise-level), and stays recognizable below 5 dB broadband SNR. The e2e encoder and the regression tests for the handover, stripe alignment and noise bleaching are in tests/test_sstv_decoder.py. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Live HF SSTV tests (Scottie 2 and Martin 1 transmissions on 2026-11-13) detected the incoming transmission but decoded an all-white speckled image. The ISS SSTV mode shares the same pipeline and was equally affected.
Root causes
Fixes
decode_file(dsp.py, sstv_decoder.py), plus clamping of per-sample frequency to the SSTV tone range.goertzel_batch) and guard-sample channel demodulation (image_decoder.py).Validation
New end-to-end harness encodes spec-timed transmissions (leader + VIS + image) and decodes them through the full pipeline:
The e2e encoder plus regression tests for VIS handover timing, stripe alignment (Martin 2, Scottie 2) and noise bleaching (Robot 36) are added to
tests/test_sstv_decoder.py. All 111 SSTV tests pass; ruff and black clean.🤖 Generated with Claude Code