[fix](trx-backend-soapysdr): retune wfm stereo gain

Increase the stereo matrix gain to 1.2 and trim the WFM output gain slightly to rebalance the decoded audio path.

Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
2026-03-01 11:28:30 +01:00
parent d133b9082b
commit cb5467ba34
2 changed files with 2 additions and 2 deletions
@@ -33,7 +33,7 @@ const STEREO_SEPARATION_PHASE_TRIM: f32 = 0.0;
const STEREO_SEPARATION_GAIN: f32 = 1.000; const STEREO_SEPARATION_GAIN: f32 = 1.000;
/// Extra headroom in the stereo matrix to reduce stereo-only clipping/IMD on /// Extra headroom in the stereo matrix to reduce stereo-only clipping/IMD on
/// strong program material. This keeps bass excursions from flattening treble. /// strong program material. This keeps bass excursions from flattening treble.
const STEREO_MATRIX_GAIN: f32 = 1.00; const STEREO_MATRIX_GAIN: f32 = 1.20;
/// Stereo detection runs every N composite samples to reduce CPU. /// Stereo detection runs every N composite samples to reduce CPU.
const STEREO_DETECT_DECIMATION: u32 = 16; const STEREO_DETECT_DECIMATION: u32 = 16;
/// Gentle high-pass memory for the stereo L-R path. /// Gentle high-pass memory for the stereo L-R path.
@@ -869,7 +869,7 @@ impl ChannelDsp {
// WFM: full composite decoder (handles its own DC blocks + deemphasis). // WFM: full composite decoder (handles its own DC blocks + deemphasis).
// No AGC — WFM uses IQ hard limiting + fixed output gain to preserve // No AGC — WFM uses IQ hard limiting + fixed output gain to preserve
// stereo separation and avoid AGC pumping on broadcast audio. // stereo separation and avoid AGC pumping on broadcast audio.
const WFM_OUTPUT_GAIN: f32 = 0.35; const WFM_OUTPUT_GAIN: f32 = 0.32;
let audio = if let Some(decoder) = self.wfm_decoder.as_mut() { let audio = if let Some(decoder) = self.wfm_decoder.as_mut() {
let mut out = decoder.process_iq(decimated); let mut out = decoder.process_iq(decimated);
for sample in &mut out { for sample in &mut out {