Fixed number of iterations lower than 1 in metrics

master
Ismael Gomez 7 years ago
parent 326f987a14
commit bd4e1c9690

@ -930,7 +930,19 @@ void srslte_pdsch_set_max_noi(srslte_pdsch_t *q, uint32_t max_iter) {
}
float srslte_pdsch_last_noi(srslte_pdsch_t *q) {
return srslte_pdsch_last_noi_cw(q, 0);
float niters = 0;
int active_cw = 0;
for (int i=0;i<SRSLTE_MAX_CODEWORDS;i++) {
if (q->last_nof_iterations[i]) {
niters += q->last_nof_iterations[i];
active_cw++;
}
}
if (active_cw) {
return niters/active_cw;
} else {
return 0;
}
}
uint32_t srslte_pdsch_last_noi_cw(srslte_pdsch_t *q, uint32_t cw_idx) {

@ -815,6 +815,10 @@ int phch_worker::decode_pdsch(srslte_ra_dl_grant_t *grant, uint8_t *payload[SRSL
// Store metrics
dl_metrics.mcs = grant->mcs[0].idx;
float niters = srslte_pdsch_last_noi(&ue_dl.pdsch);
if (niters) {
dl_metrics.turbo_iters = niters;
}
} else {
Warning("Received grant for TBS=0\n");
}
@ -1632,7 +1636,6 @@ void phch_worker::update_measurements()
dl_metrics.rssi = phy->avg_rssi_dbm;
dl_metrics.pathloss = phy->pathloss;
dl_metrics.sinr = phy->avg_snr_db_cqi;
dl_metrics.turbo_iters = srslte_pdsch_last_noi(&ue_dl.pdsch);
phy->set_dl_metrics(dl_metrics);
}

Loading…
Cancel
Save