Commit 9ae6095a authored by Thomas Schlichter's avatar Thomas Schlichter

nr_ulsim: fix calculation of statistics

parent 54b7fde0
...@@ -1074,6 +1074,7 @@ int main(int argc, char **argv) ...@@ -1074,6 +1074,7 @@ int main(int argc, char **argv)
varArray_t *table_rx=initVarArray(1000,sizeof(double)); varArray_t *table_rx=initVarArray(1000,sizeof(double));
int error_flag = 0; int error_flag = 0;
n_false_positive = 0; n_false_positive = 0;
roundStats[snrRun] = 0;
effRate[snrRun] = 0; effRate[snrRun] = 0;
effTP[snrRun] = 0; effTP[snrRun] = 0;
reset_meas(&gNB->phy_proc_rx); reset_meas(&gNB->phy_proc_rx);
...@@ -1098,7 +1099,6 @@ int main(int argc, char **argv) ...@@ -1098,7 +1099,6 @@ int main(int argc, char **argv)
crc_status = 1; crc_status = 1;
errors_decoding = 0; errors_decoding = 0;
memset((void*)roundStats,0,50*sizeof(roundStats[0]));
while (round<max_rounds && crc_status) { while (round<max_rounds && crc_status) {
round_trials[round][snrRun]++; round_trials[round][snrRun]++;
ulsch_ue->harq_processes[harq_pid]->round = round; ulsch_ue->harq_processes[harq_pid]->round = round;
...@@ -1539,7 +1539,7 @@ int main(int argc, char **argv) ...@@ -1539,7 +1539,7 @@ int main(int argc, char **argv)
effRate[snrRun] /= (double)n_trials; effRate[snrRun] /= (double)n_trials;
printf("*****************************************\n"); printf("*****************************************\n");
printf("SNR %f: n_errors (%d/%d,%d/%d,%d/%d,%d/%d) (negative CRC), false_positive %d/%d, errors_scrambling (%u/%u,%u/%u,%u/%u,%u/%u\n", SNR, n_errors[0][snrRun], round_trials[0][snrRun],n_errors[1][snrRun], round_trials[1][snrRun],n_errors[2][snrRun], round_trials[2][snrRun],n_errors[3][snrRun], round_trials[3][snrRun], n_false_positive, n_trials, errors_scrambling[0][snrRun],available_bits*n_trials,errors_scrambling[1][snrRun],available_bits*n_trials,errors_scrambling[2][snrRun],available_bits*n_trials,errors_scrambling[3][snrRun],available_bits*n_trials); printf("SNR %f: n_errors (%d/%d,%d/%d,%d/%d,%d/%d) (negative CRC), false_positive %d/%d, errors_scrambling (%u/%u,%u/%u,%u/%u,%u/%u\n", SNR, n_errors[0][snrRun], round_trials[0][snrRun],n_errors[1][snrRun], round_trials[1][snrRun],n_errors[2][snrRun], round_trials[2][snrRun],n_errors[3][snrRun], round_trials[3][snrRun], n_false_positive, n_trials, errors_scrambling[0][snrRun],available_bits*round_trials[0][snrRun],errors_scrambling[1][snrRun],available_bits*round_trials[1][snrRun],errors_scrambling[2][snrRun],available_bits*round_trials[2][snrRun],errors_scrambling[3][snrRun],available_bits*round_trials[3][snrRun]);
printf("\n"); printf("\n");
blerStats[0][snrRun] = (double)n_errors[0][snrRun]/round_trials[0][snrRun]; blerStats[0][snrRun] = (double)n_errors[0][snrRun]/round_trials[0][snrRun];
blerStats[1][snrRun] = (double)n_errors[1][snrRun]/round_trials[1][snrRun]; blerStats[1][snrRun] = (double)n_errors[1][snrRun]/round_trials[1][snrRun];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment