Commit b073ca48 authored by Thomas Schlichter's avatar Thomas Schlichter

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.
parent 5c6865fb
...@@ -369,6 +369,11 @@ void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id, ...@@ -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 // 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; 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; timing_advance_update = sync_pos / bw_scaling;
// put timing advance command in 0..63 range // put timing advance command in 0..63 range
......
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