mirror of
https://github.com/smittix/intercept.git
synced 2026-05-29 22:49:28 -07:00
morse: fix startup race and stuck noise floor in Goertzel decoder
Filter decoder-thread 'stopped' status events that race with the route lifecycle, causing the frontend to drop back to idle on first start. Pull noise floor upward using adjacent-frequency Goertzel reference when warmup calibration runs before AGC converges, preventing permanent tone-on with zero character decodes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -433,6 +433,11 @@ class MorseDecoder:
|
||||
|
||||
self._signal_peak = max(self._signal_peak, self._noise_floor * 1.05)
|
||||
|
||||
# Prevent noise floor from staying stuck below actual ambient noise
|
||||
# (occurs when warmup calibration runs before AGC converges)
|
||||
if noise_ref > self._noise_floor * 1.5:
|
||||
self._noise_floor += settle_alpha * 0.5 * (noise_ref - self._noise_floor)
|
||||
|
||||
if self.threshold_mode == 'manual':
|
||||
self._threshold = max(0.0, self.manual_threshold)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user