diff --git a/lib/include/srslte/phy/phch/pdsch.h b/lib/include/srslte/phy/phch/pdsch.h index 17dfee175..bd8a5ac6b 100644 --- a/lib/include/srslte/phy/phch/pdsch.h +++ b/lib/include/srslte/phy/phch/pdsch.h @@ -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; diff --git a/lib/src/phy/phch/pdsch.c b/lib/src/phy/phch/pdsch.c index 33e1f1be9..3dee69d76 100644 --- a/lib/src/phy/phch/pdsch.c +++ b/lib/src/phy/phch/pdsch.c @@ -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);