From 729986f259fc5ee5453a2ea1403d08cffb085b7f Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Fri, 3 Jul 2020 12:58:49 +0200 Subject: [PATCH] srsLTE: Added PUCCH format 3 valid correlation --- lib/include/srslte/phy/phch/pucch.h | 1 + lib/include/srslte/phy/phch/pucch_cfg.h | 1 + lib/src/phy/phch/pucch.c | 4 ++-- lib/src/phy/phch/uci.c | 15 ++++++++++----- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/lib/include/srslte/phy/phch/pucch.h b/lib/include/srslte/phy/phch/pucch.h index 6c652b80b..fee99404f 100644 --- a/lib/include/srslte/phy/phch/pucch.h +++ b/lib/include/srslte/phy/phch/pucch.h @@ -55,6 +55,7 @@ #define SRSLTE_PUCCH_DEFAULT_THRESHOLD_FORMAT1 (0.5f) #define SRSLTE_PUCCH_DEFAULT_THRESHOLD_FORMAT1A (0.5f) #define SRSLTE_PUCCH_DEFAULT_THRESHOLD_FORMAT2 (0.5f) +#define SRSLTE_PUCCH_DEFAULT_THRESHOLD_FORMAT3 (0.5f) #define SRSLTE_PUCCH_DEFAULT_THRESHOLD_DMRS (0.4f) typedef struct { diff --git a/lib/include/srslte/phy/phch/pucch_cfg.h b/lib/include/srslte/phy/phch/pucch_cfg.h index 1ae706ac2..dd7e8b110 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_data_valid_format3; float threshold_dmrs_detection; // PUCCH configuration generated during a call to encode/decode diff --git a/lib/src/phy/phch/pucch.c b/lib/src/phy/phch/pucch.c index f321ebd3d..313a746dc 100644 --- a/lib/src/phy/phch/pucch.c +++ b/lib/src/phy/phch/pucch.c @@ -809,7 +809,7 @@ static bool decode_signal(srslte_pucch_t* q, break; case SRSLTE_PUCCH_FORMAT_3: corr = (float)decode_signal_format3(q, sf, cfg, pucch_bits, q->z) / 4800.0f; - detected = true; + detected = corr > cfg->threshold_data_valid_format3; break; default: ERROR("PUCCH format %d not implemented\n", cfg->format); @@ -831,7 +831,7 @@ static void decode_bits(srslte_pucch_cfg_t* cfg, uint32_t nof_ack = srslte_uci_cfg_total_ack(&cfg->uci_cfg); memcpy(uci_data->ack.ack_value, pucch_bits, nof_ack); uci_data->scheduling_request = (pucch_bits[nof_ack] == 1); - uci_data->ack.valid = true; + uci_data->ack.valid = pucch_found; } else { // If was looking for scheduling request, update value if (cfg->uci_cfg.is_scheduling_request_tti) { diff --git a/lib/src/phy/phch/uci.c b/lib/src/phy/phch/uci.c index f66b673d1..c9784a3d0 100644 --- a/lib/src/phy/phch/uci.c +++ b/lib/src/phy/phch/uci.c @@ -886,11 +886,16 @@ int srslte_uci_data_info(srslte_uci_cfg_t* uci_cfg, srslte_uci_value_t* uci_data uint32_t nof_acks = srslte_uci_cfg_total_ack(uci_cfg); if (nof_acks) { n = srslte_print_check(str, str_len, n, ", ack="); - for (uint32_t i = 0; i < nof_acks; i++) { - n = srslte_print_check(str, str_len, n, "%d", uci_data->ack.ack_value[i]); - } - if (uci_cfg->ack[0].N_bundle) { - n = srslte_print_check(str, str_len, n, ", n_bundle=%d", uci_cfg->ack[0].N_bundle); + if (uci_data->ack.valid) { + + for (uint32_t i = 0; i < nof_acks; i++) { + n = srslte_print_check(str, str_len, n, "%d", uci_data->ack.ack_value[i]); + } + if (uci_cfg->ack[0].N_bundle) { + n = srslte_print_check(str, str_len, n, ", n_bundle=%d", uci_cfg->ack[0].N_bundle); + } + } else { + n = srslte_print_check(str, str_len, n, "invalid"); } }