From 19301afcb18c9bfaac6d71edb3b3ef448b66af95 Mon Sep 17 00:00:00 2001 From: alexjiao Date: Fri, 14 Nov 2025 19:21:19 +0800 Subject: [PATCH] Fix bug for SRS generation when freqDomainShift (n_shift) is not 0 According to TS 38.211 section 6.4.1.4.3, the frequency domain shift value n_shift is from higher-layer parameter freqDomainShift. The quantity n_RRC is given by higher-layer parameter freqDomainPosition. Also corrected k_0_overbar_p calculation formula to align with standard. --- openair1/PHY/nr_phy_common/src/nr_phy_common_srs.c | 2 +- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openair1/PHY/nr_phy_common/src/nr_phy_common_srs.c b/openair1/PHY/nr_phy_common/src/nr_phy_common_srs.c index ba5d792428..ae22eb25d7 100644 --- a/openair1/PHY/nr_phy_common/src/nr_phy_common_srs.c +++ b/openair1/PHY/nr_phy_common/src/nr_phy_common_srs.c @@ -293,7 +293,7 @@ bool generate_srs_nr(NR_DL_FRAME_PARMS *frame_parms, } uint8_t k_l_offset = 0; // If the SRS is configured by the IE SRS-PosResource-r16, the quantity k_l_offset is // given by TS 38.211 - Table 6.4.1.4.3-2, otherwise k_l_offset = 0. - uint8_t k_0_overbar_p = (nr_srs_info->n_shift * NR_NB_SC_PER_RB + (K_TC_p + k_l_offset)) % K_TC; + uint8_t k_0_overbar_p = nr_srs_info->n_shift * NR_NB_SC_PER_RB + (K_TC_p + k_l_offset) % K_TC; uint8_t k_0_p = k_0_overbar_p + K_TC * M_sc_b_SRS * sum_n_b; nr_srs_info->k_0_p[p_index][l_line] = k_0_p; diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 51c7bf2c55..43fef06ef7 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -278,8 +278,8 @@ static void configure_srs_info(fapi_nr_ul_config_srs_pdu *srs_config_pdu, nr_srs nr_srs_info->n_SRS_cs = srs_config_pdu->cyclic_shift; nr_srs_info->n_ID_SRS = srs_config_pdu->sequence_id; // It adjusts the SRS allocation to align with the common resource block grid in multiples of four - nr_srs_info->n_shift = srs_config_pdu->frequency_position; - nr_srs_info->n_RRC = srs_config_pdu->frequency_shift; + nr_srs_info->n_shift = srs_config_pdu->frequency_shift; + nr_srs_info->n_RRC = srs_config_pdu->frequency_position; nr_srs_info->groupOrSequenceHopping = srs_config_pdu->group_or_sequence_hopping; nr_srs_info->l_offset = srs_config_pdu->time_start_position; nr_srs_info->T_SRS = srs_config_pdu->t_srs;