From d2f1e41bcbf5b2d3be50d5f50320c42eb5029d1f Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 29 Apr 2021 12:02:51 +0200 Subject: [PATCH] using n_frames to compute init_sync_frame --- openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c index ba8c64d9f4..df35f14869 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c @@ -308,14 +308,15 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, PHY_VARS_NR_UE *ue, int n_frames) // every 7*(1<symbol_offset/(7*(1<ofdm_symbol_size + fp->nb_prefix_samples0)+(ue->symbol_offset-n_symb_prefix0)*(fp->ofdm_symbol_size + fp->nb_prefix_samples); + // for a correct computation of frame number to sync with the one decoded at MIB we need to take into account in which of the n_frames we got sync + ue->init_sync_frame = n_frames - 1 - is; + // we also need to take into account the shift by samples_per_frame in case the if is true if (ue->ssb_offset < sync_pos_frame){ ue->rx_offset = fp->samples_per_frame - sync_pos_frame + ue->ssb_offset; - ue->init_sync_frame = !is + 1; + ue->init_sync_frame += 1; } - else{ + else ue->rx_offset = ue->ssb_offset - sync_pos_frame; - ue->init_sync_frame = !is; - } } /*