/* loop filter made up of 1st order IIR plus integrator. Integerator
was found to be reqd */
- fdmdv->filt = (1.0-beta)*fdmdv->filt + beta*atan2(mod_strip.imag, mod_strip.real);
- //printf("filt: %f angle: %f\n", fdmdv->filt, atan2(mod_strip.imag, mod_strip.real));
- *f_est += g*fdmdv->filt;
+ fdmdv->foff_filt = (1.0-beta)*fdmdv->foff_filt + beta*atan2(mod_strip.imag, mod_strip.real);
+ //printf("foff_filt: %f angle: %f\n", fdmdv->foff_filt, atan2(mod_strip.imag, mod_strip.real));
+ *f_est += g*fdmdv->foff_filt;
}
/* Optional logging used for testing against Octave version */
}
f->sig_pwr_av = 0.0;
+ f->foff_filt = 0.0;
return f;
}
P/4 part was adjusted by experiment, I know not why.... */
norm_rx_timing = atan2f(x.imag, x.real)/(2*PI);
+ assert(fabsf(norm_rx_timing) < 1.0);
+ //fprintf(stderr,"%f %f norm_rx_timing: %f\n", x.real, x.imag, norm_rx_timing);
rx_timing = norm_rx_timing*P + P/4;
if (rx_timing > P)