ba9881ff62
Add SoftAgc — a fast-attack/slow-release envelope AGC with a max-gain cap
— to all demodulated audio paths so that switching between modes (WFM, AM,
SSB, CW, FM) no longer produces large volume jumps. AGC is applied after
every demodulator, including WFM, with a shared target level of 0.5.
Add per-mode DC blocking (DcBlocker) for USB/LSB/AM/FM/DIG paths to remove
carrier frequency-offset DC from the FM discriminator and LO bleedthrough in
SSB. CW is excluded because high-passing a non-negative envelope creates
negative-going artifacts on each key release; WFM already has internal DC
blockers on each output channel.
AGC time constants are tuned per mode:
CW/CWR – 1 ms attack / 50 ms release (follows individual dots/dashes)
AM – 5 ms attack / 200 ms release (tracks fading carriers)
all else– 5 ms attack / 500 ms release (suits voice and data)
Simplify demod_am and demod_cw: remove per-block peak normalisation and DC
removal that caused block-boundary level discontinuities ("pumping"). Both
now return raw magnitudes and rely on the downstream DC blocker and AGC for
normalisation.
DIG is already wired as Passthrough (identical to USB); no change needed.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>