From 7a144375f2482cb56515414624737793b3206810 Mon Sep 17 00:00:00 2001 From: Stanislaw Grams Date: Tue, 17 Mar 2026 00:19:35 +0100 Subject: [PATCH] [fix](trx-backend-soapysdr): enforce 9 kHz minimum bandwidth for AMC mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit clamp_bandwidth_for_mode now floors AMC bandwidth at 9 kHz so that both the sum (L+R) and difference (L−R) sidebands are always captured, regardless of what the user or a set_filter call requests. Co-authored-by: Claude Sonnet 4.6 Signed-off-by: Stanislaw Grams --- .../trx-backend/trx-backend-soapysdr/src/dsp/channel.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/trx-server/trx-backend/trx-backend-soapysdr/src/dsp/channel.rs b/src/trx-server/trx-backend/trx-backend-soapysdr/src/dsp/channel.rs index 5ccc518..3594cbd 100644 --- a/src/trx-server/trx-backend/trx-backend-soapysdr/src/dsp/channel.rs +++ b/src/trx-server/trx-backend/trx-backend-soapysdr/src/dsp/channel.rs @@ -217,8 +217,12 @@ pub struct ChannelDsp { impl ChannelDsp { fn clamp_bandwidth_for_mode(mode: &RigMode, bandwidth_hz: u32) -> u32 { - let _ = mode; - bandwidth_hz + match mode { + // C-QUAM requires ≥ 9 kHz to capture both sum (L+R) and difference + // (L−R) sidebands; narrower bandwidths would discard stereo content. + RigMode::AMC => bandwidth_hz.max(9_000), + _ => bandwidth_hz, + } } pub fn set_channel_if_hz(&mut self, channel_if_hz: f64) {