gNB: improve TA accuracy
The TA calculation takes the CIR peak position error and scales it according to 38.213 section 4.2. Till now it was simply an integer division "timing_advance_update = sync_pos / bw_scaling". E.g. in case of bandwidth_scaling == 16, the timing_advance_update was 0 for sync_pos between -15 and +15. With this change, this range (and thus the UL timing error) will be reduced to -8 and +8.
This commit is contained in:
@@ -369,6 +369,11 @@ void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id,
|
||||
|
||||
// scale the 16 factor in N_TA calculation in 38.213 section 4.2 according to the used FFT size
|
||||
uint16_t bw_scaling = 16 * gNB->frame_parms.ofdm_symbol_size / 2048;
|
||||
// do some integer rounding to improve TA accuracy
|
||||
if (sync_pos > 0)
|
||||
sync_pos += bw_scaling / 2 - 1;
|
||||
else if(sync_pos < 0)
|
||||
sync_pos -= bw_scaling / 2 - 1;
|
||||
timing_advance_update = sync_pos / bw_scaling;
|
||||
|
||||
// put timing advance command in 0..63 range
|
||||
|
||||
Reference in New Issue
Block a user