From 064d95f37e2df6fcdd7b0ed9ecfa5f2e2e20c632 Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Fri, 1 Sep 2017 18:37:42 +0200 Subject: [PATCH] Fixup: SDR: Show IQ data with three colors Use correct threshold values to display colors --- src/common/display_iq.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/common/display_iq.c b/src/common/display_iq.c index 9df3725..f48d248 100644 --- a/src/common/display_iq.c +++ b/src/common/display_iq.c @@ -184,10 +184,12 @@ void display_iq(float *samples, int length) /* overdrive: * 2 = close to -1..1 or above * 1 = close to -0.5..0.5 or above + * Note: L is square of vector length, + * so we compare with square values. */ - if (L > 0.9) + if (L > 0.9 * 0.9) overdrive[y/2][x] = 2; - else if (L > 0.45 && overdrive[y/2][x] < 1) + else if (L > 0.45 * 0.45 && overdrive[y/2][x] < 1) overdrive[y/2][x] = 1; } if (iq_on == 1)