pub struct Ft8StreamDecoder { /* private fields */ }Expand description
Accumulates IQ samples at 12 kHz and decodes FT8 or FT4 frames.
Feed samples incrementally with [feed]. When the internal buffer reaches
frame_len samples, a decode attempt is triggered automatically and the
results are returned. Call [flush] to attempt a decode on whatever is
currently buffered (useful at the end of a session or after a gap). Call
[clear] to discard the buffer without decoding.
The decoder operates at the FT8/FT4 native sample rate of 12 000 Hz. Callers receiving samples at a higher rate (e.g. 48 kHz) must decimate before feeding.
A single CallsignHashTable is maintained across frames so nonstandard
callsigns hashed in earlier frames can be resolved in later ones.
Implementations§
Source§impl Ft8StreamDecoder
impl Ft8StreamDecoder
Sourcepub fn new_ft8(fs: f32, base_hz: f32, max_hz: f32, max_cand: usize) -> Self
pub fn new_ft8(fs: f32, base_hz: f32, max_hz: f32, max_cand: usize) -> Self
Create a decoder for FT8 frames.
fs— sample rate (should be 12 000 Hz)base_hz— lowest tone-0 frequency to search (Hz)max_hz— highest tone-0 frequency to search (Hz)max_cand— maximum sync candidates to score per decode attempt
Sourcepub fn new_ft4(fs: f32, base_hz: f32, max_hz: f32, max_cand: usize) -> Self
pub fn new_ft4(fs: f32, base_hz: f32, max_hz: f32, max_cand: usize) -> Self
Create a decoder for FT4 frames.
Sourcepub fn feed(&mut self, iq: &[C32]) -> Vec<Ft8DecodeResult>
pub fn feed(&mut self, iq: &[C32]) -> Vec<Ft8DecodeResult>
Feed IQ samples into the accumulation buffer.
If the buffer reaches frame_len samples after appending, a decode
attempt is triggered and the results are returned. Otherwise returns
an empty Vec.
Sourcepub fn flush(&mut self) -> Vec<Ft8DecodeResult>
pub fn flush(&mut self) -> Vec<Ft8DecodeResult>
Attempt a decode on whatever is currently in the buffer.
Useful at a gap edge when the caller knows a frame has ended but the
buffer may be shorter than frame_len (e.g. due to signal dropout).
Returns decoded results; does NOT clear the buffer.