From c5e68e146c0eae95de8020b2ab384bc0f4777af3 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Tue, 11 Oct 2022 12:11:22 +0200 Subject: [PATCH] NR_UE: increase the accuracy of the filtered peak position value --- executables/nr-ue.c | 2 +- openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index c274773880..641aa0a64c 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -801,7 +801,7 @@ int computeSamplesShift(PHY_VARS_NR_UE *UE) { if (samples_shift != 0) { LOG_I(NR_PHY,"Adjusting frame in time by %i samples\n", samples_shift); UE->rx_offset = 0; // reset so that it is not applied falsely in case of SSB being only in every second frame - UE->max_pos_fil += samples_shift; // reset IIR filter when sample shift is applied + UE->max_pos_fil += samples_shift << 15; // reset IIR filter when sample shift is applied } return samples_shift; } diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c b/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c index 20be091975..c387c7f38b 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c @@ -75,14 +75,14 @@ void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms, // filter position to reduce jitter if (clear == 1) - ue->max_pos_fil = max_pos; + ue->max_pos_fil = max_pos << 15; else - ue->max_pos_fil = ((ue->max_pos_fil * coef) + (max_pos * ncoef)) >> 15; + ue->max_pos_fil = ((ue->max_pos_fil * coef) >> 15) + (max_pos * ncoef); // do not filter to have proactive timing adjustment - //ue->max_pos_fil = max_pos; + //ue->max_pos_fil = max_pos << 15; - int diff = ue->max_pos_fil - sync_pos; + int diff = (ue->max_pos_fil >> 15) - sync_pos; if (frame_parms->freq_range==nr_FR2) sync_offset = 2;