diff --git a/lib/src/phy/phch/prach.c b/lib/src/phy/phch/prach.c index 0aca3bf19..85717a3f3 100644 --- a/lib/src/phy/phch/prach.c +++ b/lib/src/phy/phch/prach.c @@ -654,7 +654,15 @@ int srslte_prach_detect_offset(srslte_prach_t *p, peak_to_avg[*n_indices] = p->peak_values[j] / corr_ave; } if (t_offsets) { - t_offsets[*n_indices] = (float) p->peak_offsets[j] * p->T_seq / p->N_zc; + float corr = 1.8; + if (p->peak_offsets[j] > 30) { + corr = 1.9; + } + if (p->peak_offsets[j] > 250) { + corr = 1.91; + } + + t_offsets[*n_indices] = corr*p->peak_offsets[j]/(DELTA_F_RA * p->N_zc); } (*n_indices)++; } diff --git a/srsenb/src/mac/mac.cc b/srsenb/src/mac/mac.cc index fb1a71c4a..3673ce1b0 100644 --- a/srsenb/src/mac/mac.cc +++ b/srsenb/src/mac/mac.cc @@ -489,7 +489,7 @@ int mac::rach_detected(uint32_t tti, uint32_t preamble_idx, uint32_t time_adv) // Save RA info pending_rars[ra_id].preamble_idx = preamble_idx; - pending_rars[ra_id].ta_cmd = 2*time_adv; + pending_rars[ra_id].ta_cmd = time_adv; pending_rars[ra_id].temp_crnti = last_rnti; // Add new user to the scheduler so that it can RX/TX SRB0 diff --git a/srsue/src/phy/prach.cc b/srsue/src/phy/prach.cc index 05aa56a7f..390ff8f9d 100644 --- a/srsue/src/phy/prach.cc +++ b/srsue/src/phy/prach.cc @@ -191,8 +191,8 @@ cf_t *prach::generate(float cfo, uint32_t *nof_sf, float *target_power) { *target_power = target_power_dbm; } - Info("PRACH: Transmitted preamble=%d, CFO=%.2f KHz, nof_sf=%d, target_power=%.1f dBm\n", - preamble_idx, cfo*15, nsf, target_power_dbm); + Info("PRACH: Transmitted preamble=%d, tti=%d, CFO=%.2f KHz, nof_sf=%d, target_power=%.1f dBm\n", + preamble_idx, transmitted_tti, cfo*15, nsf, target_power_dbm); preamble_idx = -1; return signal_buffer;