Added Initial NR-PRACH configuration for preamble format 0

master
Xavier Arteaga 4 years ago committed by Xavier Arteaga
parent b3200d9ef5
commit 54a864e021

@ -45,6 +45,7 @@ typedef struct {
typedef struct SRSLTE_API {
// Parameters from higher layers (extracted from SIB2)
bool is_nr;
uint32_t config_idx;
uint32_t f; // preamble format
uint32_t rsi; // rootSequenceIndex
@ -115,6 +116,7 @@ typedef enum SRSLTE_API {
} srslte_prach_sfn_t;
typedef struct {
bool is_nr; // Set to true if NR
uint32_t config_idx;
uint32_t root_seq_idx;
uint32_t zero_corr_zone;
@ -167,21 +169,6 @@ SRSLTE_API void srslte_prach_sf_config(uint32_t config_idx, srslte_prach_sf_conf
SRSLTE_API int srslte_prach_init(srslte_prach_t* p, uint32_t max_N_ifft_ul);
SRSLTE_API int srslte_prach_set_cell_fdd(srslte_prach_t* p,
uint32_t N_ifft_ul,
uint32_t config_idx,
uint32_t root_seq_index,
bool high_speed_flag,
uint32_t zero_corr_zone_config);
SRSLTE_API int srslte_prach_set_cell_tdd(srslte_prach_t* p,
uint32_t N_ifft_ul,
uint32_t config_idx,
uint32_t root_seq_index,
bool high_speed_flag,
uint32_t zero_corr_zone_config,
srslte_tdd_config_t* tdd_config);
SRSLTE_API int srslte_prach_set_cfg(srslte_prach_t* p, srslte_prach_cfg_t* cfg, uint32_t nof_prb);
SRSLTE_API int srslte_prach_gen(srslte_prach_t* p, uint32_t seq_index, uint32_t freq_offset, cf_t* signal);

@ -408,6 +408,7 @@ int srslte_prach_set_cell_(srslte_prach_t* p,
}
uint32_t preamble_format = srslte_prach_get_preamble_format(cfg->config_idx);
p->is_nr = cfg->is_nr;
p->config_idx = cfg->config_idx;
p->f = preamble_format;
p->rsi = cfg->root_seq_idx;
@ -513,7 +514,10 @@ int srslte_prach_set_cell_(srslte_prach_t* p,
}
ret = SRSLTE_SUCCESS;
} else {
ERROR("Invalid parameters\n");
ERROR("Invalid parameters N_ifft_ul=%d; config_idx=%d; root_seq_idx=%d;\n",
N_ifft_ul,
cfg->config_idx,
cfg->root_seq_idx);
}
return ret;
@ -527,7 +531,7 @@ int srslte_prach_gen(srslte_prach_t* p, uint32_t seq_index, uint32_t freq_offset
uint32_t N_rb_ul = srslte_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) + (K / 2);
uint32_t begin = PHI + (K * k_0) + (p->is_nr ? 1 : (K / 2));
if (6 + freq_offset > N_rb_ul) {
ERROR("Error no space for PRACH: frequency offset=%d, N_rb_ul=%d\n", freq_offset, N_rb_ul);

Loading…
Cancel
Save