[feat](trx-rs): add configurable noise blanker for SoapySDR backend
IQ-domain impulse noise blanker using exponential-smoothing RMS tracker. Samples exceeding threshold × running RMS are replaced with the last clean sample. Configurable via [sdr.noise_blanker] in TOML config and runtime via POST /set_sdr_noise_blanker API. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
@@ -43,6 +43,7 @@ pub enum RigCommand {
|
||||
SetSdrLnaGain(f64),
|
||||
SetSdrAgc(bool),
|
||||
SetSdrSquelch { enabled: bool, threshold_db: f64 },
|
||||
SetSdrNoiseBlanker { enabled: bool, threshold: f64 },
|
||||
SetWfmDeemphasis(u32),
|
||||
SetWfmStereo(bool),
|
||||
SetWfmDenoise(WfmDenoiseLevel),
|
||||
|
||||
@@ -525,6 +525,7 @@ pub fn command_from_rig_command(cmd: RigCommand) -> Box<dyn RigCommandHandler> {
|
||||
| RigCommand::SetSdrLnaGain(_)
|
||||
| RigCommand::SetSdrAgc(_)
|
||||
| RigCommand::SetSdrSquelch { .. }
|
||||
| RigCommand::SetSdrNoiseBlanker { .. }
|
||||
| RigCommand::SetWfmDeemphasis(_)
|
||||
| RigCommand::SetWfmStereo(_)
|
||||
| RigCommand::SetWfmDenoise(_)
|
||||
|
||||
@@ -211,6 +211,17 @@ pub trait RigCat: Rig + Send {
|
||||
)))
|
||||
}
|
||||
|
||||
fn set_sdr_noise_blanker<'a>(
|
||||
&'a mut self,
|
||||
_enabled: bool,
|
||||
_threshold: f64,
|
||||
) -> Pin<Box<dyn Future<Output = DynResult<()>> + Send + 'a>> {
|
||||
Box::pin(std::future::ready(Err(
|
||||
Box::new(response::RigError::not_supported("set_sdr_noise_blanker"))
|
||||
as Box<dyn std::error::Error + Send + Sync>,
|
||||
)))
|
||||
}
|
||||
|
||||
fn set_wfm_stereo<'a>(
|
||||
&'a mut self,
|
||||
_enabled: bool,
|
||||
|
||||
@@ -326,6 +326,10 @@ pub struct RigFilterState {
|
||||
pub sdr_squelch_enabled: Option<bool>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub sdr_squelch_threshold_db: Option<f64>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub sdr_nb_enabled: Option<bool>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub sdr_nb_threshold: Option<f64>,
|
||||
#[serde(default = "default_wfm_deemphasis_us")]
|
||||
pub wfm_deemphasis_us: u32,
|
||||
#[serde(default = "default_wfm_stereo")]
|
||||
|
||||
Reference in New Issue
Block a user