[fix](trx-vdes): make burst detection more permissive

Lower the VDES burst detector thresholds further, shorten the minimum burst and end timing, and add a max-burst timeout so weak or continuous signals are more likely to finalize into diagnostic frames instead of staying invisible.

Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
This commit is contained in:
2026-03-03 01:07:00 +01:00
parent c6af684d6c
commit 5174e1ab73
+19 -6
View File
@@ -20,8 +20,9 @@ use num_complex::Complex;
use trx_core::decode::VdesMessage; use trx_core::decode::VdesMessage;
const VDES_SYMBOL_RATE: f32 = 76_800.0; const VDES_SYMBOL_RATE: f32 = 76_800.0;
const MIN_BURST_MS: f32 = 2.0; const MIN_BURST_MS: f32 = 0.8;
const BURST_END_MS: f32 = 0.4; const BURST_END_MS: f32 = 0.25;
const MAX_BURST_MS: f32 = 45.0;
const MIN_BURST_SYMBOLS: usize = 64; const MIN_BURST_SYMBOLS: usize = 64;
const TER_MCS1_100_BURST_SYMBOLS: usize = 1_984; const TER_MCS1_100_BURST_SYMBOLS: usize = 1_984;
const TER_MCS1_100_RAMP_SYMBOLS: usize = 32; const TER_MCS1_100_RAMP_SYMBOLS: usize = 32;
@@ -35,10 +36,10 @@ const TER_MCS1_100_SYNC_BITS: &[u8; TER_MCS1_100_SYNC_SYMBOLS] = b"1111110011010
const PI4_QPSK_DIBITS: [u8; 4] = [0b00, 0b01, 0b11, 0b10]; const PI4_QPSK_DIBITS: [u8; 4] = [0b00, 0b01, 0b11, 0b10];
const MIN_SYNC_CANDIDATE_SCORE: f32 = 0.20; const MIN_SYNC_CANDIDATE_SCORE: f32 = 0.20;
const MIN_SYNC_PARSE_SCORE: f32 = 0.50; const MIN_SYNC_PARSE_SCORE: f32 = 0.50;
const BURST_TRIGGER_NOISE_MULT: f32 = 4.0; const BURST_TRIGGER_NOISE_MULT: f32 = 1.8;
const BURST_TRIGGER_FLOOR: f32 = 8.0e-5; const BURST_TRIGGER_FLOOR: f32 = 1.0e-6;
const BURST_SUSTAIN_NOISE_MULT: f32 = 1.5; const BURST_SUSTAIN_NOISE_MULT: f32 = 1.02;
const BURST_SUSTAIN_FLOOR: f32 = 5.0e-5; const BURST_SUSTAIN_FLOOR: f32 = 5.0e-7;
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct VdesDecoder { pub struct VdesDecoder {
@@ -73,6 +74,8 @@ impl VdesDecoder {
((self.sample_rate * (MIN_BURST_MS / 1000.0)).round() as usize).max(16); ((self.sample_rate * (MIN_BURST_MS / 1000.0)).round() as usize).max(16);
let quiet_limit = let quiet_limit =
((self.sample_rate * (BURST_END_MS / 1000.0)).round() as u32).max(4); ((self.sample_rate * (BURST_END_MS / 1000.0)).round() as u32).max(4);
let max_burst_samples =
((self.sample_rate * (MAX_BURST_MS / 1000.0)).round() as usize).max(min_burst_samples);
for &sample in samples { for &sample in samples {
let power = sample.norm_sqr(); let power = sample.norm_sqr();
@@ -96,6 +99,16 @@ impl VdesDecoder {
self.quiet_run = 0; self.quiet_run = 0;
} }
if self.burst_samples.len() >= max_burst_samples {
if let Some(msg) = self.finalize_burst(channel) {
out.push(msg);
}
self.in_burst = false;
self.quiet_run = 0;
self.burst_samples.clear();
continue;
}
if self.quiet_run >= quiet_limit { if self.quiet_run >= quiet_limit {
if self.burst_samples.len() >= min_burst_samples { if self.burst_samples.len() >= min_burst_samples {
if let Some(msg) = self.finalize_burst(channel) { if let Some(msg) = self.finalize_burst(channel) {