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:
Smittix
2026-02-26 21:05:25 +00:00
parent 2e1b9b27be
commit 33a360b483
2 changed files with 23 additions and 1 deletions

View File

@@ -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: