Make PDCCH LLR mean amplitude in function of maximum

This commit is contained in:
Xavier Arteaga 2021-06-01 13:13:45 +02:00 committed by Xavier Arteaga
parent 6de34524e2
commit bbab2cd9ba
1 changed files with 19 additions and 3 deletions

View File

@ -377,12 +377,23 @@ int srsran_pdcch_decode_msg(srsran_pdcch_t* q, srsran_dl_sf_cfg_t* sf, srsran_dc
uint32_t nof_bits = srsran_dci_format_sizeof(&q->cell, sf, dci_cfg, msg->format); uint32_t nof_bits = srsran_dci_format_sizeof(&q->cell, sf, dci_cfg, msg->format);
uint32_t e_bits = PDCCH_FORMAT_NOF_BITS(msg->location.L); uint32_t e_bits = PDCCH_FORMAT_NOF_BITS(msg->location.L);
// Set threshold to 2/3 of absolute LLRs maximum for this candidate if bigger than 0.3. Otherwise set the
// threshold to 0.3.
uint32_t max_i = srsran_vec_max_abs_fi(&q->llr[msg->location.ncce * 72], e_bits);
if (max_i >= e_bits) {
ERROR("The impossible happened %d>=%d", max_i, e_bits);
return SRSRAN_ERROR;
}
double threshold = SRSRAN_MAX(0.3f, (2.0 / 3.0) * fabsf(q->llr[msg->location.ncce * 72 + max_i]));
// Compute Root mean square of the LLRs
double mean = 0; double mean = 0;
for (int i = 0; i < e_bits; i++) { for (int i = 0; i < e_bits; i++) {
mean += fabsf(q->llr[msg->location.ncce * 72 + i]); mean += fabsf(q->llr[msg->location.ncce * 72 + i]);
} }
mean /= e_bits; mean /= e_bits;
if (mean > 0.3) {
if (mean > threshold) {
ret = srsran_pdcch_dci_decode(q, &q->llr[msg->location.ncce * 72], msg->payload, e_bits, nof_bits, &msg->rnti); ret = srsran_pdcch_dci_decode(q, &q->llr[msg->location.ncce * 72], msg->payload, e_bits, nof_bits, &msg->rnti);
if (ret == SRSRAN_SUCCESS) { if (ret == SRSRAN_SUCCESS) {
msg->nof_bits = nof_bits; msg->nof_bits = nof_bits;
@ -401,7 +412,12 @@ int srsran_pdcch_decode_msg(srsran_pdcch_t* q, srsran_dl_sf_cfg_t* sf, srsran_dc
mean, mean,
msg->rnti); msg->rnti);
} else { } else {
INFO("Skipping DCI: nCCE=%d, L=%d, msg_len=%d, mean=%f", msg->location.ncce, msg->location.L, nof_bits, mean); INFO("Skipping DCI: nCCE=%d, L=%d, msg_len=%d, mean=%f, thr=%f",
msg->location.ncce,
msg->location.L,
nof_bits,
mean,
threshold);
} }
} }
} else if (msg != NULL) { } else if (msg != NULL) {