Skip to content
Snippets Groups Projects
Commit 70894b7d authored by Stephen D's avatar Stephen D
Browse files

switch to mask decoder. Seems to work much better

parent 22dee799
No related branches found
No related tags found
1 merge request!2integrate codec2 fsk demodulator.
Pipeline #4480 passed
......@@ -5,7 +5,7 @@ use std::{
const MODE_M_MAX: usize = 4;
const M: i32 = 2;
const N_SYM: i32 = 35;
const N_SYM: i32 = 50;
#[link(name = "fsk", kind = "static")]
extern "C" {
......@@ -33,6 +33,8 @@ extern "C" {
);
fn fsk_set_freq_est_limits(fsk: *mut InternalFsk, f_min: libc::c_int, f_max: libc::c_int);
fn fsk_set_freq_est_alg(fsk: *mut InternalFsk, est_type: libc::c_int);
}
#[repr(C)]
......@@ -147,14 +149,17 @@ impl<I: Iterator<Item = Complex>> Fsk<I> {
const P: i32 = 5;
const FS: i32 = 9600 * P;
let internal = unsafe { fsk_create_hbr(FS, 9600, M, P, N_SYM, -1, 0) };
let internal = unsafe { fsk_create_hbr(FS, 9600, M, P, N_SYM, -1, 9600) };
// Set upper/lower bound on the FSK peaks, from center
// (Hz)
let fsk_lower = -10_000;
let fsk_upper = 10_000;
let fsk_lower = -15_000;
let fsk_upper = 15_000;
unsafe { fsk_set_freq_est_limits(internal, fsk_lower, fsk_upper) };
unsafe {
fsk_set_freq_est_limits(internal, fsk_lower, fsk_upper);
fsk_set_freq_est_alg(internal, 1); // mask estimator
}
Self {
internal,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment