feat(trx-core,trx-protocol,trx-backend-soapysdr): add spectrum data pipeline

Add SpectrumData struct (bins, center_hz, sample_rate) to RigState and
RigSnapshot. Add GetSpectrum RigCommand and ClientCommand plumbed through
the protocol layer. SoapySDR DSP pipeline now computes a 1024-bin FFT
(Hann window, FFT-shifted, dBFS) every 4 IQ blocks (~10 Hz update rate)
and exposes it via RigCat::get_spectrum(). The rig_task handles
GetSpectrum without persisting spectrum data in ongoing state.

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-27 21:35:53 +01:00
parent df79f06ff0
commit 76969b5499
10 changed files with 111 additions and 6 deletions
+1
View File
@@ -403,6 +403,7 @@ mod tests {
cw_wpm: 0,
cw_tone_hz: 0,
filter: None,
spectrum: None,
}
}
}
+2
View File
@@ -47,6 +47,7 @@ pub fn client_command_to_rig(cmd: ClientCommand) -> RigCommand {
ClientCommand::ResetWsprDecoder => RigCommand::ResetWsprDecoder,
ClientCommand::SetBandwidth { bandwidth_hz } => RigCommand::SetBandwidth(bandwidth_hz),
ClientCommand::SetFirTaps { taps } => RigCommand::SetFirTaps(taps),
ClientCommand::GetSpectrum => RigCommand::GetSpectrum,
}
}
@@ -86,6 +87,7 @@ pub fn rig_command_to_client(cmd: RigCommand) -> ClientCommand {
RigCommand::ResetWsprDecoder => ClientCommand::ResetWsprDecoder,
RigCommand::SetBandwidth(bandwidth_hz) => ClientCommand::SetBandwidth { bandwidth_hz },
RigCommand::SetFirTaps(taps) => ClientCommand::SetFirTaps { taps },
RigCommand::GetSpectrum => ClientCommand::GetSpectrum,
}
}
+1
View File
@@ -37,6 +37,7 @@ pub enum ClientCommand {
ResetWsprDecoder,
SetBandwidth { bandwidth_hz: u32 },
SetFirTaps { taps: u32 },
GetSpectrum,
}
/// Envelope for client commands with optional authentication token and rig routing.