fix: Correct SSTV VIS codes and replace Goertzel pixel decoder with Hilbert transform

Fix wrong VIS codes for PD90 (96→99), PD120 (93→95), PD180 (95→97),
PD240 (113→96), and ScottieDX (55→76). This caused PD180 to be detected
as PD90 and PD120 to fail entirely.

Replace batch Goertzel pixel decoding with analytic signal (Hilbert
transform) FM demodulation. The Goertzel approach used 96-sample windows
with ~500 Hz resolution — wider than the 800 Hz pixel frequency range —
making accurate pixel decoding impossible for fast modes like Martin2
and Scottie2. The Hilbert method computes per-sample instantaneous
frequency, matching the approach used by QSSTV and other professional
SSTV decoders.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Smittix
2026-02-19 09:23:15 +00:00
parent 481651c88d
commit 17f6947648
4 changed files with 55 additions and 50 deletions
+4 -4
View File
@@ -354,15 +354,15 @@ class TestVISDetector:
assert mode_name == 'Scottie1'
def test_detect_pd120(self):
"""Should detect PD120 VIS code (93)."""
"""Should detect PD120 VIS code (95)."""
detector = VISDetector()
header = generate_vis_header(93) # PD120
header = generate_vis_header(95) # PD120
audio = np.concatenate([np.zeros(2400), header, np.zeros(2400)])
result = detector.feed(audio)
assert result is not None
vis_code, mode_name = result
assert vis_code == 93
assert vis_code == 95
assert mode_name == 'PD120'
def test_noise_rejection(self):
@@ -520,7 +520,7 @@ class TestModes:
def test_all_vis_codes_have_modes(self):
"""All defined VIS codes should have matching mode specs."""
for vis_code in [8, 12, 44, 40, 60, 56, 93, 95, 96, 98, 113, 55]:
for vis_code in [8, 12, 44, 40, 60, 56, 95, 97, 99, 98, 96, 76]:
mode = get_mode(vis_code)
assert mode is not None, f"No mode for VIS code {vis_code}"