From e1b055cf4ff13c295e1b101d9f8e02496607ce25 Mon Sep 17 00:00:00 2001 From: Kamal Mostafa Date: Sat, 18 Aug 2012 19:15:33 -0700 Subject: [PATCH] fsk: AVOID_TRANSIENTS noise limiter re-enabled Algo #5 needs this, just as #3 did. --- src/fsk.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/fsk.c b/src/fsk.c index e00277e..082bbac 100644 --- a/src/fsk.c +++ b/src/fsk.c @@ -238,17 +238,16 @@ fsk_frame_analyze( fsk_plan *fskp, float *samples, float samples_per_bit, } // Note: CONFIDENCE_ALGO 3 does not need AVOID_TRANSIENTS -// #define AVOID_TRANSIENTS 0.7 +#define AVOID_TRANSIENTS 0.7 // #ifdef AVOID_TRANSIENTS /* Compare strength of stop bit and start bit, to avoid detecting * a transient as a start bit, as often results in a single false * character when the mark "leader" tone begins. Require that the * diff between start bit and stop bit strength not be "large". */ - //float i_str = bit_strengths[0]; - float s_str = bit_strengths[1]; - float p_str = bit_strengths[fskp->n_data_bits + 2]; - if ( fabs(s_str-p_str) > (s_str * AVOID_TRANSIENTS) ) { + float s_mag = bit_sig_mags[1]; + float p_mag = bit_sig_mags[fskp->n_data_bits + 2]; + if ( fabs(s_mag-p_mag) > (s_mag * AVOID_TRANSIENTS) ) { debug_log(" avoid transient\n"); return 0.0; }