From ed55c26a4adb32a10dd1ac675144a4c5f912f2e3 Mon Sep 17 00:00:00 2001 From: Ahmet Inan Date: Mon, 17 Sep 2012 15:33:12 +0200 Subject: [PATCH] also clamp weaker signal in decode.c --- decode.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/decode.c b/decode.c index 62b8798..69659b8 100644 --- a/decode.c +++ b/decode.c @@ -371,6 +371,11 @@ int demodulate(struct pcm *pcm, float *cnt_freq, float *dat_freq, float *drate) *cnt_freq = fclampf(1200.0 + cargf(cnt_q[out] * conjf(cnt_last)) / (2.0 * M_PI * dstep), 1100.0, 1300.0); *dat_freq = fclampf(1900.0 + cargf(dat_q[out] * conjf(dat_last)) / (2.0 * M_PI * dstep), 1500.0, 2300.0); + if (cabsf(cnt_q[out]) > cabsf(dat_q[out])) + *dat_freq = 1500.0; + else + *cnt_freq = 1300.0; + cnt_last = cnt_q[out]; dat_last = dat_q[out];