Add NR-PDSCH-DMRS SNR estimation

This commit is contained in:
Xavier Arteaga 2021-01-19 17:51:39 +01:00 committed by Andre Puschmann
parent 26086252ba
commit f6b4f65f12
1 changed files with 20 additions and 0 deletions

View File

@ -706,6 +706,26 @@ int srslte_dmrs_sch_estimate(srslte_dmrs_sch_t* q,
}
}
float rsrp = 0.0f;
float epre = 0.0f;
for (uint32_t i = 0; i < nof_symbols; i++) {
cf_t corr =
srslte_vec_acc_cc(&q->pilot_estimates[nof_pilots_x_symbol * i], nof_pilots_x_symbol) / nof_pilots_x_symbol;
rsrp += __real__ corr * __real__ corr + __imag__ corr * __imag__ corr;
epre += srslte_vec_avg_power_cf(&q->pilot_estimates[nof_pilots_x_symbol * i], nof_pilots_x_symbol);
}
rsrp /= nof_symbols;
epre /= nof_symbols;
rsrp = SRSLTE_MIN(rsrp, epre);
chest_res->rsrp = rsrp;
chest_res->rsrp_dbm = srslte_convert_power_to_dB(chest_res->rsrp);
chest_res->noise_estimate = epre - rsrp;
chest_res->noise_estimate_dbm = srslte_convert_power_to_dB(chest_res->noise_estimate);
chest_res->snr_db = chest_res->rsrp_dbm - chest_res->noise_estimate_dbm;
// Perform measurements here
// ...