From a06b13d42aa3e864685d862972ea264595d28014 Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Sun, 24 Jul 2016 15:05:52 +0100 Subject: [PATCH] Relax the A/C quiet threshold; this seems to pick up a lot more A/C messages. --- demod_2400.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/demod_2400.c b/demod_2400.c index 8f5ace7..e85db98 100644 --- a/demod_2400.c +++ b/demod_2400.c @@ -528,6 +528,7 @@ void demodulate2400AC(struct mag_buf *mag) // ----- X1/X2/X3 average noise float midpoint = sqrtf(x1x2x3_noise * f1f2_signal); // so that signal/midpoint == midpoint/noise + unsigned quiet_threshold = (unsigned) midpoint; unsigned noise_threshold = (unsigned) (midpoint * 0.707107 + 0.5); // -3dB from midpoint unsigned signal_threshold = (unsigned) (midpoint * 1.414214 + 0.5); // +3dB from midpoint @@ -563,8 +564,8 @@ void demodulate2400AC(struct mag_buf *mag) noisy_bits <<= 1; // check for excessive noise in the quiet period - if (m[sample+2] >= noise_threshold) { - //fprintf(stderr, "bit %u was not quiet (%u > %u)\n", bit, m[sample+2], signal_threshold); + if (m[sample+2] >= quiet_threshold) { + //fprintf(stderr, "bit %u was not quiet (%u > %u)\n", bit, m[sample+2], quiet_threshold); noisy_bits |= 1; continue; }