Adjust arrays in ofdm.c
authorokcsampson <okcsampson@01035d8c-6547-0410-b346-abe4f91aad63>
Sat, 17 Jun 2017 03:23:01 +0000 (03:23 +0000)
committerokcsampson <okcsampson@01035d8c-6547-0410-b346-abe4f91aad63>
Sat, 17 Jun 2017 03:23:01 +0000 (03:23 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@3206 01035d8c-6547-0410-b346-abe4f91aad63

codec2-dev/src/ofdm.c
codec2-dev/src/ofdm_internal.h

index d3dba897c239147b2a4b4a3cb6318a83735d1813..b7ef9a3a7128796fe7091941087a0202f2c474a0 100644 (file)
@@ -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 */
index b3f82ac8044eea5ac5db604c77a5559ca7b44d16..1e488438aa4fc6530f9c26270eb9a8fecfb28bab 100644 (file)
@@ -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