Fix FM audio noise floor, TX gain, and sample wrapping

The 300-2700 Hz bandpass rounded to integer counts after each stage.
Stage 1 is -14 dB and stage 2 is +13.6 dB, which left a broadband floor
of about 7 counts RMS and a signal-dependent DC offset. It is now one
CFMBandpass class that carries 12 fractional bits between stages, uses
an int64 accumulate, and rounds once at the output. RF and ext-audio
paths both use it.

The ext-audio upsampler now multiplies by 3 to restore the 1/3 lost to
zero stuffing.

The RF/ext audio boost multiplies now saturate instead of wrapping,
and the DAC write clamps to 0..4095 rather than only counting overflow.

Deploy with ExtAudioBoost=1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cort Buffington
2026-10-30 10:23:49 -05:00
co-authored by Claude Opus 5.5
parent e8061763bf
commit 7c736e17ef
5 changed files with 64 additions and 34 deletions
+2 -6
View File
@@ -77,12 +77,8 @@ private:
CFMTimer m_reverseTimer;
CFMTimer m_extGapTimer; // debounce for link-mode ext-audio underrun, see linkStateMachine()
bool m_needReverse;
CFMDirectFormI m_filterStage1;
CFMDirectFormI m_filterStage2;
CFMDirectFormI m_filterStage3;
CFMDirectFormI m_dsFilterStage1; // anti-alias filter for the downsampler, own state
CFMDirectFormI m_dsFilterStage2;
CFMDirectFormI m_dsFilterStage3;
CFMBandpass m_filter;
CFMBandpass m_dsFilter; // anti-alias filter for the downsampler
CFMBlanking m_blanking;
uint8_t m_accessMode;
bool m_linkMode;