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:
@@ -403,6 +403,7 @@ mod tests {
|
||||
cw_wpm: 0,
|
||||
cw_tone_hz: 0,
|
||||
filter: None,
|
||||
spectrum: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user