result[row] = 0.0f + 0.0f * I;
for (col = 0; col < (OFDM_NC + 2); col++) {
- result[row] += (vector[col] * (ofdm->W[row][col] / (float) OFDM_M)); /* complex result */
+ result[row] += (vector[col] * (ofdm->W[col][row] / (float) OFDM_M)); /* complex result */
}
}
}
ofdm->w[i] = j * TAU * OFDM_RS / OFDM_FS;
}
- for (i = 0; i < OFDM_M; i++) {
- for (j = 0; j < (OFDM_NC + 2); j++) {
- ofdm->W[i][j] = cexpf(I * ofdm->w[j] * i);
+ for (i = 0; i < (OFDM_NC + 2); i++) {
+ for (j = 0; j < OFDM_M; j++) {
+ ofdm->W[i][j] = cexpf(I * ofdm->w[i] * j);
}
}
bool phase_est_en;
complex float rate_fs_pilot_samples[OFDM_M + OFDM_NCP];
- complex float W[OFDM_M][OFDM_NC + 2];
+ complex float W[OFDM_NC + 2][OFDM_M];
complex float rxbuf[OFDM_RXBUF];
complex float pilots[OFDM_NC + 2];
float w[OFDM_NC + 2];
fout = fopen("tofdm_out.txt","wt");
assert(fout != NULL);
fprintf(fout, "# Created by tofdm.c\n");
- octave_save_complex(fout, "W_c", (COMP*)ofdm->W, OFDM_M, OFDM_NC + 2, OFDM_NC + 2);
+ octave_save_complex(fout, "W_c", (COMP*)ofdm->W, OFDM_NC + 2, OFDM_M, OFDM_M);
octave_save_int(fout, "tx_bits_log_c", tx_bits_log, 1, OFDM_BITSPERFRAME*FRAMES);
octave_save_complex(fout, "tx_log_c", (COMP*)tx_log, 1, OFDM_SAMPLESPERFRAME*FRAMES, OFDM_SAMPLESPERFRAME*FRAMES);
fclose(fout);