fix in sync position at UE and other minor issues
This commit is contained in:
@@ -41,38 +41,32 @@ int nr_get_ssb_start_symbol(NR_DL_FRAME_PARMS *fp)
|
||||
int case_E[8] = {8, 12, 16, 20, 32, 36, 40, 44};
|
||||
|
||||
switch(mu) {
|
||||
|
||||
case NR_MU_0: // case A
|
||||
n = i_ssb >> 1;
|
||||
symbol = case_AC[i_ssb % 2] + 14*n;
|
||||
break;
|
||||
|
||||
case NR_MU_1:
|
||||
if (type == 1){ // case B
|
||||
n = i_ssb >> 2;
|
||||
symbol = case_BD[i_ssb % 4] + 28*n;
|
||||
}
|
||||
if (type == 2){ // case C
|
||||
n = i_ssb >> 1;
|
||||
symbol = case_AC[i_ssb % 2] + 14*n;
|
||||
}
|
||||
break;
|
||||
|
||||
case NR_MU_3: // case D
|
||||
n_temp = i_ssb >> 2;
|
||||
n = n_temp + (n_temp >> 2);
|
||||
symbol = case_BD[i_ssb % 4] + 28*n;
|
||||
break;
|
||||
|
||||
case NR_MU_4: // case E
|
||||
n_temp = i_ssb >> 3;
|
||||
n = n_temp + (n_temp >> 2);
|
||||
symbol = case_E[i_ssb % 8] + 56*n;
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
AssertFatal(0==1, "Invalid numerology index %d for the synchronization block\n", mu);
|
||||
case NR_MU_0: // case A
|
||||
n = i_ssb >> 1;
|
||||
symbol = case_AC[i_ssb % 2] + 14*n;
|
||||
break;
|
||||
case NR_MU_1:
|
||||
if (type == 1){ // case B
|
||||
n = i_ssb >> 2;
|
||||
symbol = case_BD[i_ssb % 4] + 28*n;
|
||||
}
|
||||
if (type == 2){ // case C
|
||||
n = i_ssb >> 1;
|
||||
symbol = case_AC[i_ssb % 2] + 14*n;
|
||||
}
|
||||
break;
|
||||
case NR_MU_3: // case D
|
||||
n_temp = i_ssb >> 2;
|
||||
n = n_temp + (n_temp >> 2);
|
||||
symbol = case_BD[i_ssb % 4] + 28*n;
|
||||
break;
|
||||
case NR_MU_4: // case E
|
||||
n_temp = i_ssb >> 3;
|
||||
n = n_temp + (n_temp >> 2);
|
||||
symbol = case_E[i_ssb % 8] + 56*n;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(0==1, "Invalid numerology index %d for the synchronization block\n", mu);
|
||||
}
|
||||
|
||||
if (half_frame_index)
|
||||
|
||||
@@ -303,8 +303,11 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, PHY_VARS_NR_UE *ue, runmode_t mode,
|
||||
if (ret == 0) {
|
||||
// sync at symbol ue->symbol_offset
|
||||
// computing the offset wrt the beginning of the frame
|
||||
sync_pos_frame = (fp->ofdm_symbol_size + fp->nb_prefix_samples0)+((ue->symbol_offset)-1)*(fp->ofdm_symbol_size + fp->nb_prefix_samples);
|
||||
|
||||
int mu = fp->numerology_index;
|
||||
// number of symbols with different prefix length
|
||||
// every 7*(1<<mu) symbols there is a different prefix length (38.211 5.3.1)
|
||||
int n_symb_prefix0 = (ue->symbol_offset/(7*(1<<mu)))+1;
|
||||
sync_pos_frame = n_symb_prefix0*(fp->ofdm_symbol_size + fp->nb_prefix_samples0)+(ue->symbol_offset-n_symb_prefix0)*(fp->ofdm_symbol_size + fp->nb_prefix_samples);
|
||||
if (ue->ssb_offset < sync_pos_frame)
|
||||
ue->rx_offset = fp->samples_per_frame - sync_pos_frame + ue->ssb_offset;
|
||||
else
|
||||
|
||||
@@ -62,7 +62,7 @@ uint16_t nr_pbch_extract(int **rxdataF,
|
||||
unsigned int rx_offset = frame_parms->first_carrier_offset + frame_parms->ssb_start_subcarrier; //and
|
||||
|
||||
// if (rx_offset>= frame_parms->ofdm_symbol_size) rx_offset-=frame_parms->ofdm_symbol_size;
|
||||
rx_offset=(rx_offset)%(frame_parms->ofdm_symbol_size);
|
||||
rx_offset=(rx_offset)%(frame_parms->ofdm_symbol_size);
|
||||
|
||||
AssertFatal(symbol>=1 && symbol<5,
|
||||
"symbol %d illegal for PBCH extraction\n",
|
||||
@@ -539,6 +539,7 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
|
||||
M = NR_POLAR_PBCH_E;
|
||||
nushift = (Lmax==4)? i_ssb&3 : i_ssb&7;
|
||||
uint32_t unscrambling_mask = (Lmax==64)?0x100006D:0x1000041;
|
||||
|
||||
nr_pbch_unscrambling(nr_ue_pbch_vars,frame_parms->Nid_cell,nushift,M,NR_POLAR_PBCH_E,0,0);
|
||||
//polar decoding de-rate matching
|
||||
const t_nrPolar_params *currentPtr = nr_polar_params( NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_AGGREGATION_LEVEL,1,&ue->polarList);
|
||||
|
||||
Reference in New Issue
Block a user