From 5570dcd938eb37190162ae10cade86353492df0f Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Wed, 2 May 2018 16:38:22 +0200 Subject: [PATCH] Use next_offset to correct time advance --- srsue/src/phy/phch_recv.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/srsue/src/phy/phch_recv.cc b/srsue/src/phy/phch_recv.cc index 4f88a6c66..b74139bf7 100644 --- a/srsue/src/phy/phch_recv.cc +++ b/srsue/src/phy/phch_recv.cc @@ -629,9 +629,7 @@ void phch_recv::set_agc_enable(bool enable) void phch_recv::set_time_adv_sec(float time_adv_sec) { // If transmitting earlier, transmit less samples to align time advance. If transmit later just delay next TX - if (time_adv_sec > this->time_adv_sec) { - next_offset = floor((this->time_adv_sec-time_adv_sec)*srslte_sampling_freq_hz(cell.nof_prb)+1); - } + next_offset = floor((this->time_adv_sec-time_adv_sec)*srslte_sampling_freq_hz(cell.nof_prb)); this->next_time_adv_sec = time_adv_sec; Info("Applying time_adv_sec=%.1f us, next_offset=%d\n", time_adv_sec*1e6, next_offset); }