Fix NR PRACH encoding

master
Xavier Arteaga 3 years ago committed by Andre Puschmann
parent 753edc7d7b
commit a31a40184d

@ -615,7 +615,9 @@ int srsran_prach_set_cell_(srsran_prach_t* p,
int ret = SRSRAN_ERROR;
if (p != NULL && N_ifft_ul < 2049 && cfg->config_idx < 64 && cfg->root_seq_idx < MAX_ROOTS) {
if (N_ifft_ul > p->max_N_ifft_ul) {
ERROR("PRACH: Error in set_cell(): N_ifft_ul must be lower or equal max_N_ifft_ul in init()");
ERROR("PRACH: Error in set_cell(): N_ifft_ul (%d) must be lower or equal max_N_ifft_ul (%d) in init()",
N_ifft_ul,
p->max_N_ifft_ul);
return -1;
}
@ -743,7 +745,7 @@ int srsran_prach_gen(srsran_prach_t* p, uint32_t seq_index, uint32_t freq_offset
uint32_t N_rb_ul = srsran_nof_prb(p->N_ifft_ul);
uint32_t k_0 = freq_offset * N_RB_SC - N_rb_ul * N_RB_SC / 2 + p->N_ifft_ul / 2;
uint32_t K = DELTA_F / DELTA_F_RA;
uint32_t begin = PHI + (K * k_0) + (p->is_nr ? 1 : (K / 2));
uint32_t begin = PHI + (K * k_0) + (p->is_nr ? 0 : (K / 2));
if (6 + freq_offset > N_rb_ul) {
ERROR("Error no space for PRACH: frequency offset=%d, N_rb_ul=%d", freq_offset, N_rb_ul);
@ -982,7 +984,7 @@ int srsran_prach_detect_offset(srsran_prach_t* p,
uint32_t N_rb_ul = srsran_nof_prb(p->N_ifft_ul);
uint32_t k_0 = freq_offset * N_RB_SC - N_rb_ul * N_RB_SC / 2 + p->N_ifft_ul / 2;
uint32_t K = DELTA_F / DELTA_F_RA;
uint32_t begin = PHI + (K * k_0) + (p->is_nr ? 1 : (K / 2));
uint32_t begin = PHI + (K * k_0) + (p->is_nr ? 0 : (K / 2));
memcpy(p->prach_bins, &p->signal_fft[begin], p->N_zc * sizeof(cf_t));
int loops = (p->successive_cancellation) ? SUCCESSIVE_CANCELLATION_ITS : 1;

Loading…
Cancel
Save