pub struct SweepParams {
pub sample_rate_hz: u32,
pub freq_mhz: Vec<(u16, u16)>,
pub blocks_per_tuning: u16,
pub step_width_hz: u32,
pub offset_hz: u32,
pub mode: SweepMode,
}Expand description
Configuration settings for a receive sweep across multiple frequencies.
The easiest way to configure this is to call
SweepParams::init_sample_rate, then to add the desired
frequency pairs to sweep over. There shouldn’t be more than 10 pairs.
The recommended usage adds an offset to the center frequency, such that the lower edge of the baseband filter aligns with the lower limit of the sweep. The step width is then 4/3 of the baseband filter.
The blocks_per_tuning parameter determines how many SweepBuf blocks at
a tuned frequency come out in a row. The blocks are not consecutive
samples; the HackRF briefly turns off between sample blocks.
It’s really best to think of this is a tool for spectrum sensing, not active demodulation.
Fields§
§sample_rate_hz: u32Sample rate to operate at.
freq_mhz: Vec<(u16, u16)>List of frequency pairs to sweep over, in MHz. There can be up to 10.
blocks_per_tuning: u16Number of blocks to capture per tuning. Each block is 16384 bytes, or 8192 samples.
step_width_hz: u32Width of each tuning step, in Hz. sample_rate is a good value, in
general.
offset_hz: u32Frequency offset added to tuned frequencies. Sample_rate*3/8 is a good
value for Interleaved sweep mode.
mode: SweepModeSweep mode.
Implementations§
Source§impl SweepParams
impl SweepParams
Sourcepub fn init_sample_rate(sample_rate_hz: u32) -> Self
pub fn init_sample_rate(sample_rate_hz: u32) -> Self
Initialize the sweep parameters with some sane defaults, given a sample rate.
See the main SweepParams documentation for more info.