mirror of
https://github.com/smittix/intercept.git
synced 2026-06-17 01:49:45 -07:00
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:
@@ -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}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user