From 6a9baef11ddfe8d4d4cd18d9424ebb0f728b77ef Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Mon, 19 Jul 2021 15:44:08 +0200 Subject: [PATCH] Limit DMRS PUCCH SNR to void NAN/INF --- lib/src/phy/ch_estimation/dmrs_pucch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/phy/ch_estimation/dmrs_pucch.c b/lib/src/phy/ch_estimation/dmrs_pucch.c index 7a045c325..cae4cac58 100644 --- a/lib/src/phy/ch_estimation/dmrs_pucch.c +++ b/lib/src/phy/ch_estimation/dmrs_pucch.c @@ -238,7 +238,7 @@ int srsran_dmrs_pucch_format1_estimate(const srsran_pucch_nr_t* q, res->rsrp_dBfs = srsran_convert_power_to_dB(rsrp); res->epre = epre; res->epre_dBfs = srsran_convert_power_to_dB(epre); - res->noise_estimate = epre - rsrp; + res->noise_estimate = SRSRAN_MAX(epre - rsrp, 1e-6f); res->noise_estimate_dbm = srsran_convert_power_to_dB(res->noise_estimate); res->snr = rsrp / res->noise_estimate; res->snr_db = srsran_convert_power_to_dB(res->snr); @@ -398,7 +398,7 @@ int srsran_dmrs_pucch_format2_estimate(const srsran_pucch_nr_t* q, res->rsrp_dBfs = srsran_convert_power_to_dB(rsrp); res->epre = epre; res->epre_dBfs = srsran_convert_power_to_dB(epre); - res->noise_estimate = epre - rsrp; + res->noise_estimate = SRSRAN_MAX(epre - rsrp, 1e-6f); res->noise_estimate_dbm = srsran_convert_power_to_dB(res->noise_estimate); res->snr = rsrp / res->noise_estimate; res->snr_db = srsran_convert_power_to_dB(res->snr);