pdsch: calculate average PDSCH EVM over all decoded codewords

when EVM measurements are enabled, instead of only logging them for
each decoded codeword, we also calculate the average.

this is useful for calibration.
This commit is contained in:
Andre Puschmann 2020-11-23 22:08:54 +01:00
parent cfee074756
commit 504d8fd9f0
2 changed files with 9 additions and 1 deletions

View File

@ -77,6 +77,7 @@ typedef struct SRSLTE_API {
// EVM buffers, one for each codeword (avoid concurrency issue with coworker)
srslte_evm_buffer_t* evm_buffer[SRSLTE_MAX_CODEWORDS];
float avg_evm;
// This is to generate the scrambling seq for multiple CRNTIs
srslte_pdsch_user_t** users;

View File

@ -1064,6 +1064,14 @@ int srslte_pdsch_decode(srslte_pdsch_t* q,
cfg->meas_time_value = t[0].tv_usec;
}
if (cfg->meas_evm_en) {
for (uint32_t i = 0; i < SRSLTE_MAX_CODEWORDS; i++) {
if (cfg->grant.tb[i].enabled && !isnan(data[i].evm)) {
q->avg_evm = SRSLTE_VEC_EMA(data[i].evm, q->avg_evm, 0.1);
}
}
}
return SRSLTE_SUCCESS;
} else {
ERROR("Invalid inputs\n");
@ -1314,7 +1322,6 @@ uint32_t srslte_pdsch_grant_rx_info(srslte_pdsch_grant_t* grant,
uint32_t
srslte_pdsch_rx_info(srslte_pdsch_cfg_t* cfg, srslte_pdsch_res_t res[SRSLTE_MAX_CODEWORDS], char* str, uint32_t str_len)
{
uint32_t len = srslte_print_check(str, str_len, 0, "rnti=0x%x", cfg->rnti);
len += srslte_pdsch_grant_rx_info(&cfg->grant, res, &str[len], str_len - len);