diff --git a/openair1/PHY/NR_REFSIG/nr_dmrs_rx.c b/openair1/PHY/NR_REFSIG/nr_dmrs_rx.c index 1af712a26f..f9b4afeb34 100644 --- a/openair1/PHY/NR_REFSIG/nr_dmrs_rx.c +++ b/openair1/PHY/NR_REFSIG/nr_dmrs_rx.c @@ -151,8 +151,8 @@ int nr_pbch_dmrs_rx(unsigned int *nr_gold_pbch, ((int16_t*)output)[(m<<1)+1] = nr_mod_table[((1 + ((nr_gold_pbch[m>>5]&(1<<(m&0x1f)))>>(m&0x1f)))<<1) + 1]; #ifdef DEBUG_PBCH //printf("nr_gold_pbch[m>>5] %x\n",nr_gold_pbch[m>>5]); - if (m<6) - printf("m %d output %d %d addr %p\n", m, output[2*m], output[2*m+1],&output[0]); + if (m<16) + printf("m %d output %d %d addr %p\n", m, ((int16_t*)output)[m<<1], ((int16_t*)output)[(m<<1)+1],&output[0]); #endif } diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c index ebd68bc11a..cbb58527da 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c @@ -46,15 +46,15 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, uint16_t Nid_cell = (eNB_offset == 0) ? ue->frame_parms.Nid_cell : ue->measurements.adj_cell_id[eNB_offset-1]; - uint8_t nushift; + uint8_t nushift, Lmax, ssb_index=1, n_hf=0; uint8_t previous_thread_id = ue->current_thread_id[Ns>>1]==0 ? (RX_NB_TH-1):(ue->current_thread_id[Ns>>1]-1); int **dl_ch_estimates =ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates[eNB_offset]; int **rxdataF=ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].rxdataF; - - // recompute nushift with eNB_offset corresponding to adjacent eNB on which to perform channel estimation - nushift = Nid_cell%4; - + Lmax = 8; //to be updated + nushift = (Lmax < 8)? ssb_index&3 : ssb_index&7; + ue->frame_parms.nushift = nushift; + if (ue->high_speed_flag == 0) // use second channel estimate position for temporary storage ch_offset = ue->frame_parms.ofdm_symbol_size ; else @@ -124,11 +124,8 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, break; } - - // generate pilot - nr_pbch_dmrs_rx(ue->nr_gold_pbch, - &pilot[p][0]); + nr_pbch_dmrs_rx(ue->nr_gold_pbch[n_hf][ssb_index], &pilot[p][0]); for (aarx=0; aarxframe_parms.nb_antennas_rx; aarx++) { diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c index b0b56608c2..a4b8679f37 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c @@ -107,7 +107,7 @@ int nr_pbch_detection(PHY_VARS_NR_UE *ue, runmode_t mode) ue->high_speed_flag, frame_mod4); - pbch_decoded = 1; + pbch_decoded = 0; //to be updated // break; //} diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c index 96b1425cd3..11f1095df3 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c @@ -617,11 +617,11 @@ uint16_t nr_rx_pbch( PHY_VARS_NR_UE *ue, for (i=0; i<(NR_POLAR_PBCH_PAYLOAD_BITS); i++) decoded_output[(NR_POLAR_PBCH_PAYLOAD_BITS)-i-1] = pbch_a[i]; -#ifdef DEBUG_PBCH + //#ifdef DEBUG_PBCH for (i=0; i<(NR_POLAR_PBCH_PAYLOAD_BITS); i++) printf("unscrambling pbch_a[%d] = %d \n", i,pbch_a[i]); - for (i=0; i