Commit 6e57abc7 authored by Thomas Schlichter's avatar Thomas Schlichter

NR_UE: consider sync position (1/8 CP) in initial sync and UL write timestamp

parent 3eb2b4d7
......@@ -657,7 +657,7 @@ void *UE_thread(void *arg) {
// use previous timing_advance value to compute writeTimestamp
writeTimestamp = timestamp + UE->frame_parms.get_samples_slot_timestamp(slot_nr, &UE->frame_parms,DURATION_RX_TO_TX - RX_NB_TH) -
firstSymSamp - openair0_cfg[0].tx_sample_advance - UE->N_TA_offset - timing_advance;
firstSymSamp - openair0_cfg[0].tx_sample_advance - UE->N_TA_offset - timing_advance + UE->frame_parms.nb_prefix_samples / 8;
// but use current UE->timing_advance value to compute writeBlockSize
if (UE->timing_advance != timing_advance) {
......
......@@ -309,6 +309,7 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, PHY_VARS_NR_UE *ue, int n_frames)
// 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);
sync_pos_frame += fp->nb_prefix_samples / 8; // shift sync position ahead by 1/8th of cyclic prefix, same as in nr_adjust_synch_ue()
if (ue->ssb_offset < sync_pos_frame)
ue->rx_offset = fp->samples_per_frame - sync_pos_frame + ue->ssb_offset;
else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment