From 10f5a147dcece45423f288107bd05eb8c88ec451 Mon Sep 17 00:00:00 2001 From: Stan Grams Date: Tue, 3 Mar 2026 01:13:06 +0100 Subject: [PATCH] [fix](trx-vdes): preserve higher SDR iq rate Keep the SoapySDR VDES and MARINE IQ path at a much higher channel sample rate instead of collapsing toward the normal audio rate, so the decoder receives usable complex baseband for the 76.8 ksps VDES signal. Co-authored-by: OpenAI Codex Signed-off-by: Stanislaw Grams --- .../trx-backend-soapysdr/src/dsp/channel.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 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 21af42f..6697187 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 @@ -113,10 +113,10 @@ impl ChannelDsp { return (1, audio_sample_rate.max(1)); } - let target_rate = if *mode == RigMode::WFM { - audio_bandwidth_hz.max(audio_sample_rate.saturating_mul(4)) - } else { - audio_sample_rate.max(1) + let target_rate = match mode { + RigMode::WFM => audio_bandwidth_hz.max(audio_sample_rate.saturating_mul(4)), + RigMode::VDES | RigMode::MARINE => audio_sample_rate.max(96_000), + _ => audio_sample_rate.max(1), }; let decim_factor = (sdr_sample_rate / target_rate.max(1)).max(1) as usize; let channel_sample_rate = (sdr_sample_rate / decim_factor as u32).max(1); @@ -366,7 +366,7 @@ impl ChannelDsp { self.scratch_decimated .reserve(capacity - self.scratch_decimated.capacity()); } - if self.mode == RigMode::VDES && self.iq_tx.receiver_count() > 0 { + if matches!(self.mode, RigMode::VDES | RigMode::MARINE) && self.iq_tx.receiver_count() > 0 { self.scratch_iq_tap.clear(); if self.scratch_iq_tap.capacity() < capacity { self.scratch_iq_tap