From 06695041ba73645c53c94a7b9bf282c3c868dab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Hamal=20Dvo=C5=99=C3=A1k?= Date: Wed, 14 Aug 2024 00:30:02 +0200 Subject: [PATCH] Fix sin/cos --- src/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.c b/src/main.c index abb7eb7..2ce88db 100644 --- a/src/main.c +++ b/src/main.c @@ -64,8 +64,8 @@ static int8_t origin_acc = 0; #define NCO_NUM_PHASES 256 #define NCO_PHASE_BITS 8 #define NCO_PHASE_WORDS (1 << (NCO_PHASE_BITS - 2)) -#define NCO_PHASE_COS (3u << 30) -#define NCO_PHASE_SIN 0 +#define NCO_PHASE_COS 0 +#define NCO_PHASE_SIN (3u << 30) static uint32_t nco_phase[NCO_NUM_PHASES][NCO_PHASE_WORDS] __attribute__((__aligned__(NCO_NUM_PHASES * 4 * NCO_PHASE_WORDS))); @@ -75,7 +75,7 @@ static uint32_t nco_step = 0x80000000; static uint32_t nco_null = 0; /* Bit combinations to output for { I+ Q+ I- Q- } */ -static const uint32_t nco_quadrature[] = { 2, 3, 1, 0 }; +static const uint32_t nco_quadrature[] = { 3, 2, 0, 1 }; /* Sampling and gain */ #define INIT_SAMPLE_RATE 200000