From ff19a05e83ec67ec736eb5033fb5cdc900ffe3f0 Mon Sep 17 00:00:00 2001 From: Felix Erckenbrecht Date: Thu, 24 Mar 2022 22:28:08 +0100 Subject: Bugfix: Dont modulate twice --- src/fl2k_iq.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fl2k_iq.c b/src/fl2k_iq.c index e0f2bc7..db8d7bf 100644 --- a/src/fl2k_iq.c +++ b/src/fl2k_iq.c @@ -267,11 +267,10 @@ static inline void dds_complex(dds_t *dds, int8_t * i, int8_t * q) // get current carrier phase, add phase mod, calculate table index pi_i = (dds->phase - dds->phase_delta) >> TRIG_TABLE_SHIFT; pi_q = (dds->phase + dds->phase_delta) >> TRIG_TABLE_SHIFT; + // advance dds generator dds->phase += dds->phase_step; - - // add some extra phase modulation - dds->phase += dds->phase_delta; + // wrap around properly dds->phase &= 0xffffffff; //amp = 255; @@ -284,6 +283,7 @@ static inline void dds_complex(dds_t *dds, int8_t * i, int8_t * q) *i = (int8_t) (amp_i >> 24); // 0..31 >> 24 => 0..8 *q = (int8_t) (amp_q >> 24); // 0..31 >> 24 => 0..8 + /* advance modulation signal by interpolated input from baseband */ dds->amplitude += dds->ampslope; dds->phase_delta += dds->phase_slope; return; -- cgit v1.2.3