From ff6001b0da06b3a7fb5459ad5159dc5c33c0aea3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Hamal=20Dvo=C5=99=C3=A1k?= Date: Tue, 2 Jul 2024 13:04:39 +0200 Subject: [PATCH] Fix DC offset error --- src/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.c b/src/main.c index 3b39512..4a457d1 100644 --- a/src/main.c +++ b/src/main.c @@ -543,6 +543,7 @@ static void rf_rx(void) int64_t Q = sQ; I *= gain; + I -= (max_amplitude * 181) / 256; I /= max_amplitude; if (I > 127) @@ -553,6 +554,7 @@ static void rf_rx(void) *blockptr++ = (uint8_t)I + 128; Q *= gain; + Q -= (max_amplitude * 181) / 256; Q /= max_amplitude; if (Q > 127)