mirror of https://github.com/PentHertz/srsLTE.git
Added PUSCH CFO estimation
This commit is contained in:
parent
248f05bf08
commit
f9689ec956
|
@ -47,7 +47,7 @@ typedef struct SRSLTE_API {
|
|||
float epre_dBfs;
|
||||
float snr;
|
||||
float snr_db;
|
||||
float cfo;
|
||||
float cfo_hz;
|
||||
float ta_us;
|
||||
} srslte_chest_ul_res_t;
|
||||
|
||||
|
|
|
@ -288,6 +288,15 @@ static void chest_ul_estimate(srslte_chest_ul_t* q,
|
|||
uint32_t n_prb[SRSLTE_NOF_SLOTS_PER_SF],
|
||||
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
|
||||
float ta_err = 0.0f;
|
||||
if (meas_ta_en) {
|
||||
|
|
|
@ -256,7 +256,7 @@ int srslte_dmrs_pucch_format1_estimate(const srslte_pucch_nr_t* q,
|
|||
}
|
||||
|
||||
// Measure CFO
|
||||
res->cfo = NAN; // Not implemented
|
||||
res->cfo_hz = NAN; // Not implemented
|
||||
|
||||
// Do averaging here
|
||||
// ... Not implemented
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
// 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
|
||||
if (cfg->meas_evm_en) {
|
||||
len = srslte_print_check(str, str_len, len, ", evm=%.1f %%", res->evm * 100);
|
||||
|
|
Loading…
Reference in New Issue