complex float aframe[OFDM_NS][OFDM_NC + 2];
complex float asymbol[OFDM_M];
complex float asymbol_cp[OFDM_M + OFDM_NCP];
- int i, j, k;
+ int i, j, k, l;
/* initialize aframe to complex zero */
/* OFDM up-convert symbol by symbol so we can add CP */
- for (i = 0, k = 0; i < OFDM_NS; i++, k += (OFDM_M + OFDM_NCP)) {
+ for (i = 0, l = 0; i < OFDM_NS; i++, l += (OFDM_M + OFDM_NCP)) {
matrix_vector_multiply(ofdm, asymbol, aframe[i]);
/* Copy the last Ncp columns to the front */
/* Now move row to the tx reference */
for (j = 0; j < (OFDM_M + OFDM_NCP); j++) {
- tx[k] = asymbol_cp[j];
+ tx[l] = asymbol_cp[j];
}
}
}
* --------------------------------------
*/
-void ofdm_mod(struct OFDM *ofdm, COMP result[OFDM_NS][OFDM_M + OFDM_NCP], int *tx_bits) {
+void ofdm_mod(struct OFDM *ofdm, COMP result[OFDM_SAMPLESPERFRAME], int *tx_bits) {
int length = OFDM_BITSPERFRAME / OFDM_BPS;
- complex float tx[OFDM_NS][OFDM_M + OFDM_NCP];
+ complex float tx[OFDM_SAMPLESPERFRAME];
complex float tx_sym_lin[length];
int dibit[2];
int s, j;
/* convert to comp */
- for (s = 0; s < OFDM_NS; s++) {
- for (j = 0; j < (OFDM_M + OFDM_NCP); j++) {
- result[s][j].real = crealf(tx[s][j]);
- result[s][j].imag = cimagf(tx[s][j]);
- }
+ for (s = 0; s < OFDM_SAMPLESPERFRAME; s++) {
+ result[s].real = crealf(tx[s]);
+ result[s].imag = cimagf(tx[s]);
}
}