Added PUSCH CFO estimation

This commit is contained in:
Xavier Arteaga 2020-10-07 16:39:41 +02:00 committed by Xavier Arteaga
parent 248f05bf08
commit f9689ec956
4 changed files with 16 additions and 2 deletions

View File

@ -47,7 +47,7 @@ typedef struct SRSLTE_API {
float epre_dBfs; float epre_dBfs;
float snr; float snr;
float snr_db; float snr_db;
float cfo; float cfo_hz;
float ta_us; float ta_us;
} srslte_chest_ul_res_t; } srslte_chest_ul_res_t;

View File

@ -288,6 +288,15 @@ static void chest_ul_estimate(srslte_chest_ul_t* q,
uint32_t n_prb[SRSLTE_NOF_SLOTS_PER_SF], uint32_t n_prb[SRSLTE_NOF_SLOTS_PER_SF],
srslte_chest_ul_res_t* res) srslte_chest_ul_res_t* res)
{ {
// Calculate CFO
if (nslots == 2) {
float phase = cargf(srslte_vec_dot_prod_conj_ccc(
&q->pilot_estimates[0 * nrefs_sym], &q->pilot_estimates[1 * nrefs_sym], nrefs_sym));
res->cfo_hz = phase / (2.0f * (float)M_PI * 0.0005f);
} else {
res->cfo_hz = NAN;
}
// Calculate time alignment error // Calculate time alignment error
float ta_err = 0.0f; float ta_err = 0.0f;
if (meas_ta_en) { if (meas_ta_en) {

View File

@ -256,7 +256,7 @@ int srslte_dmrs_pucch_format1_estimate(const srslte_pucch_nr_t* q,
} }
// Measure CFO // Measure CFO
res->cfo = NAN; // Not implemented res->cfo_hz = NAN; // Not implemented
// Do averaging here // Do averaging here
// ... Not implemented // ... Not implemented

View File

@ -515,6 +515,11 @@ uint32_t srslte_pusch_rx_info(srslte_pusch_cfg_t* cfg,
len = srslte_print_check(str, str_len, len, ", ta=%.1f us", chest_res->ta_us); len = srslte_print_check(str, str_len, len, ", ta=%.1f us", chest_res->ta_us);
} }
// Append CFO information if available
if (!isnan(chest_res->cfo_hz)) {
len = srslte_print_check(str, str_len, len, ", cfo=%.1f hz", chest_res->cfo_hz);
}
// Append EVM measurement if available // Append EVM measurement if available
if (cfg->meas_evm_en) { if (cfg->meas_evm_en) {
len = srslte_print_check(str, str_len, len, ", evm=%.1f %%", res->evm * 100); len = srslte_print_check(str, str_len, len, ", evm=%.1f %%", res->evm * 100);