[feat](trx-rs): expose WFM stereo denoise toggle

Add a server-side toggle for the multiband stereo denoiser so it can be
enabled or disabled at runtime without restarting the server.

Backend (trx-backend-soapysdr):
- Add `denoise_enabled: bool` to `WfmStereoDecoder`; gate multiband
  blend behind it (falls back to uniform single-band blend when off)
- Add `set_denoise_enabled()` method on `WfmStereoDecoder`
- Propagate `wfm_denoise: bool` through `ChannelDsp`, `SdrPipeline`,
  and `SoapySdrRig`; add `set_wfm_denoise()` at each layer
- Include `wfm_denoise` in `filter_state()` so it flows into snapshots

Protocol / core (trx-core, trx-protocol, trx-server):
- Add `SetWfmDenoise(bool)` to `RigCommand` and `ClientCommand`
- Add default `set_wfm_denoise()` trait method to `RigCat`
- Handle `SetWfmDenoise` in `rig_task.rs` and update `RigFilterState`
- Add `wfm_denoise: bool` (default `true`) to `RigFilterState`

Frontend (trx-frontend-http):
- Add `POST /toggle_wfm_denoise` endpoint
- Add "Denoise On/Off" button next to the stereo/mono audio picker
- Sync button state from SSE filter snapshot (`update.filter.wfm_denoise`)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
2026-02-28 19:47:36 +01:00
parent ffdc193671
commit 95716a0fc3
14 changed files with 118 additions and 8 deletions
+1
View File
@@ -34,5 +34,6 @@ pub enum RigCommand {
SetBandwidth(u32),
SetFirTaps(u32),
SetWfmDeemphasis(u32),
SetWfmDenoise(bool),
GetSpectrum,
}
@@ -517,6 +517,7 @@ pub fn command_from_rig_command(cmd: RigCommand) -> Box<dyn RigCommandHandler> {
| RigCommand::SetBandwidth(_)
| RigCommand::SetFirTaps(_)
| RigCommand::SetWfmDeemphasis(_)
| RigCommand::SetWfmDenoise(_)
| RigCommand::GetSpectrum => Box::new(GetSnapshotCommand),
}
}
+10
View File
@@ -165,6 +165,16 @@ pub trait RigCat: Rig + Send {
)))
}
fn set_wfm_denoise<'a>(
&'a mut self,
_enabled: bool,
) -> Pin<Box<dyn Future<Output = DynResult<()>> + Send + 'a>> {
Box::pin(std::future::ready(Err(
Box::new(response::RigError::not_supported("set_wfm_denoise"))
as Box<dyn std::error::Error + Send + Sync>,
)))
}
/// Return the current filter state if this backend supports filter controls.
fn filter_state(&self) -> Option<state::RigFilterState> {
None
+6
View File
@@ -271,12 +271,18 @@ pub struct RigFilterState {
pub cw_center_hz: u32,
#[serde(default = "default_wfm_deemphasis_us")]
pub wfm_deemphasis_us: u32,
#[serde(default = "default_wfm_denoise")]
pub wfm_denoise: bool,
}
fn default_wfm_deemphasis_us() -> u32 {
75
}
fn default_wfm_denoise() -> bool {
true
}
/// Spectrum data from SDR backends (FFT magnitude over the full capture bandwidth).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SpectrumData {