From 8a60a3b422ad56ea46528a025274c4a1c37da201 Mon Sep 17 00:00:00 2001 From: okcsampson Date: Sat, 17 Jun 2017 03:23:01 +0000 Subject: [PATCH] Adjust arrays in ofdm.c git-svn-id: https://svn.code.sf.net/p/freetel/code@3206 01035d8c-6547-0410-b346-abe4f91aad63 --- codec2-dev/src/ofdm.c | 8 +++----- codec2-dev/src/ofdm_internal.h | 6 +++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/codec2-dev/src/ofdm.c b/codec2-dev/src/ofdm.c index d3dba897..b7ef9a3a 100644 --- a/codec2-dev/src/ofdm.c +++ b/codec2-dev/src/ofdm.c @@ -609,7 +609,7 @@ void ofdm_demod(struct OFDM *ofdm, int *rx_bits, COMP *rxbuf_in) { aphase_est_pilot_rect += vector_sum(symbol, 0, 3); for (j = (i - 1), k = 0; j < (i + 2); j++, k++) { - symbol[k] = ofdm->rx_sym[1 + OFDM_NS][j] * ofdm->pilots[j]; + symbol[k] = ofdm->rx_sym[2 + OFDM_NS][j] * ofdm->pilots[j]; } aphase_est_pilot_rect += vector_sum(symbol, 0, 3); @@ -624,10 +624,6 @@ void ofdm_demod(struct OFDM *ofdm, int *rx_bits, COMP *rxbuf_in) { * frame bit ordering correct */ - for (i = 0; i < (OFDM_NC + 2); i++) { - ofdm->aphase_est_pilot_log[i] = aphase_est_pilot[i]; - } - complex float rx_corr; int abit[2]; int bit_index = 0; @@ -653,6 +649,8 @@ void ofdm_demod(struct OFDM *ofdm, int *rx_bits, COMP *rxbuf_in) { rx_bits[bit_index++] = abit[1]; } } + + ofdm->aphase_est_pilot_log[(rr * OFDM_ROWSPERFRAME) + (i - 1)] = aphase_est_pilot[i]; } /* Adjust nin to take care of sample clock offset */ diff --git a/codec2-dev/src/ofdm_internal.h b/codec2-dev/src/ofdm_internal.h index b3f82ac8..1e488438 100644 --- a/codec2-dev/src/ofdm_internal.h +++ b/codec2-dev/src/ofdm_internal.h @@ -91,9 +91,9 @@ struct OFDM { /* Demodulator data */ complex float rx_sym[OFDM_NS + 3][OFDM_NC + 2]; - complex float rx_np[(OFDM_NS + 3) * OFDM_NC]; - float rx_amp[(OFDM_NS + 3) * OFDM_NC]; - float aphase_est_pilot_log[OFDM_NC + 2]; + complex float rx_np[OFDM_ROWSPERFRAME * OFDM_NC]; + float rx_amp[OFDM_ROWSPERFRAME * OFDM_NC]; + float aphase_est_pilot_log[OFDM_ROWSPERFRAME * OFDM_NC]; }; #ifdef __cplusplus -- 2.25.1