From 002a68e183ee15979a2b8076a17b8f27ef974a8e Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Mon, 9 Mar 2020 15:09:28 +0100 Subject: [PATCH] SRSENB: hard-coded parametrized PUCCH DMRS correlation threshold --- lib/include/srslte/phy/phch/pucch.h | 1 + lib/include/srslte/phy/phch/pucch_cfg.h | 1 + lib/src/phy/phch/pucch.c | 4 ++-- srsenb/src/phy/phy_ue_db.cc | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/include/srslte/phy/phch/pucch.h b/lib/include/srslte/phy/phch/pucch.h index 175b1f672..2711dbe7a 100644 --- a/lib/include/srslte/phy/phch/pucch.h +++ b/lib/include/srslte/phy/phch/pucch.h @@ -56,6 +56,7 @@ #define SRSLTE_PUCCH_DEFAULT_THRESHOLD_FORMAT1 (0.2f) #define SRSLTE_PUCCH_DEFAULT_THRESHOLD_FORMAT1A (0.2f) #define SRSLTE_PUCCH_DEFAULT_THRESHOLD_FORMAT2 (0.2f) +#define SRSLTE_PUCCH_DEFAULT_THRESHOLD_DMRS (0.2f) typedef struct { srslte_sequence_t seq_f2[SRSLTE_NOF_SF_X_FRAME]; diff --git a/lib/include/srslte/phy/phch/pucch_cfg.h b/lib/include/srslte/phy/phch/pucch_cfg.h index dcb81df32..bc360eab9 100644 --- a/lib/include/srslte/phy/phch/pucch_cfg.h +++ b/lib/include/srslte/phy/phch/pucch_cfg.h @@ -75,6 +75,7 @@ typedef struct SRSLTE_API { float threshold_format1; float threshold_data_valid_format1a; float threshold_data_valid_format2; + float threshold_dmrs_detection; // PUCCH configuration generated during a call to encode/decode srslte_pucch_format_t format; diff --git a/lib/src/phy/phch/pucch.c b/lib/src/phy/phch/pucch.c index b650d0bdf..c7f9e6d1f 100644 --- a/lib/src/phy/phch/pucch.c +++ b/lib/src/phy/phch/pucch.c @@ -918,8 +918,8 @@ int srslte_pucch_decode(srslte_pucch_t* q, float _pow = srslte_vec_avg_power_cf(q->ce, nof_re); float _r = _rms / _pow; - // Return not detected if the ratio is 0, NAN, +/- Infinity or below 0.1 - if (!isnormal(_r) || _r < 0.1f) { + // Return not detected if the ratio is 0, NAN, +/- Infinity or below threshold + if (!isnormal(_r) || _r < cfg->threshold_dmrs_detection) { data->detected = false; data->correlation = NAN; return SRSLTE_SUCCESS; diff --git a/srsenb/src/phy/phy_ue_db.cc b/srsenb/src/phy/phy_ue_db.cc index bc6175468..b792ebb86 100644 --- a/srsenb/src/phy/phy_ue_db.cc +++ b/srsenb/src/phy/phy_ue_db.cc @@ -106,6 +106,7 @@ inline void phy_ue_db::_set_common_config_rnti(uint16_t rnti) scell_info.phy_cfg.ul_cfg.pucch.threshold_format1 = SRSLTE_PUCCH_DEFAULT_THRESHOLD_FORMAT1; scell_info.phy_cfg.ul_cfg.pucch.threshold_data_valid_format1a = SRSLTE_PUCCH_DEFAULT_THRESHOLD_FORMAT1A; scell_info.phy_cfg.ul_cfg.pucch.threshold_data_valid_format2 = SRSLTE_PUCCH_DEFAULT_THRESHOLD_FORMAT2; + scell_info.phy_cfg.ul_cfg.pucch.threshold_dmrs_detection = SRSLTE_PUCCH_DEFAULT_THRESHOLD_DMRS; } }