PRACH working correctly for ZCZ>4. Fixed TA computation. PRACH matches Matlab.

master
ismagom 10 years ago
parent 41b603e472
commit c4e771040b

@ -27,8 +27,8 @@ for n_rb=1:length(NULRB)
lib=srslte_prach(ueConfig,prachConfig);
[mat, info]=ltePRACH(ueConfig,prachConfig);
err=mean(abs(mat-lib));
if (err > 10^-3)
err=max(abs(mat-lib));
if (err > 2*10^-3)
disp(err)
a=1:100;
plot(a,real(lib(a)),a,real(mat(a)))

@ -239,7 +239,6 @@ bool mux::assemble_pdu(uint32_t pdu_sz_nbits) {
}
// MAC control element for PHR
// TODO
printf("1 nof_subh=%d, rem_size=%d\n", pdu_msg.nof_subh(), pdu_msg.rem_size());
// data from any Logical Channel, except data from UL-CCCH;
// first only those with positive Bj
@ -252,15 +251,12 @@ bool mux::assemble_pdu(uint32_t pdu_sz_nbits) {
}
}
}
printf("2 nof_subh=%d, rem_size=%d\n", pdu_msg.nof_subh(), pdu_msg.rem_size());
// If resources remain, allocate regardless of their Bj value
for (int i=0;i<mac_io::NOF_UL_LCH;i++) {
while (allocate_sdu(lchid_sorted[i], &pdu_msg));
}
printf("3 nof_subh=%d, rem_size=%d\n", pdu_msg.nof_subh(), pdu_msg.rem_size());
bool send_bsr = bsr_procedure->generate_bsr_on_ul_grant(pdu_msg.rem_size(), &bsr);
// Insert Padding BSR if not inserted Regular/Periodic BSR
if (!bsr_payload_sz && send_bsr) {

@ -202,7 +202,7 @@ void process_connsetup(LIBLTE_RRC_CONNECTION_SETUP_STRUCT *msg, srslte::ue::mac
// FIXME: There's an error parsing the connectionSetup message. This value is hard-coded:
phy->set_param(srslte::ue::phy_params::SR_PUCCH_RESINDEX,
phy->set_param(srslte::ue::phy_params::PUCCH_N_PUCCH_SR,
msg->rr_cnfg.phy_cnfg_ded.sched_request_cnfg.sr_pucch_resource_idx);
phy->set_param(srslte::ue::phy_params::SR_CONFIG_INDEX,
msg->rr_cnfg.phy_cnfg_ded.sched_request_cnfg.sr_cnfg_idx);

@ -74,7 +74,8 @@ bool phy::init_(srslte::radio* radio_handler_, srslte::ue::tti_sync* ttisync_, l
dl_buffer_queue = new queue(6, sizeof(dl_buffer));
do_agc = do_agc_;
last_gain = 1e4;
time_adv_sec = 0;
time_adv_sec = 0;
sr_tx_tti = 0;
// Set default params
params_db.set_param(phy_params::CELLSEARCH_TIMEOUT_PSS_NFRAMES, 100);
@ -109,15 +110,14 @@ radio* phy::get_radio() {
}
void phy::set_timeadv_rar(uint32_t ta_cmd) {
ta_cmd=7;
n_ta = srslte_N_ta_new_rar(ta_cmd);
time_adv_sec = ((float) n_ta)/(15000.0*srslte_symbol_sz(cell.nof_prb));
time_adv_sec = ((float) n_ta)*SRSLTE_LTE_TS;
Info("Set TA RAR: ta_cmd: %d, n_ta: %d, ta_usec: %.1f\n", ta_cmd, n_ta, time_adv_sec*1e6);
}
void phy::set_timeadv(uint32_t ta_cmd) {
n_ta = srslte_N_ta_new(n_ta, ta_cmd);
time_adv_sec = ((float) n_ta)/(15000.0*srslte_symbol_sz(cell.nof_prb));
time_adv_sec = ((float) n_ta)*SRSLTE_LTE_TS;
Info("Set TA: ta_cmd: %d, n_ta: %d, ta_usec: %.1f\n", ta_cmd, n_ta, time_adv_sec*1e6);
}
@ -150,7 +150,7 @@ bool phy::send_prach(uint32_t preamble_idx, int allowed_subframe, int target_pow
return false;
}
/* Send SR as soon as possible as defined in Section 10.2 of 36.213 */
/* Instruct the PHY to send a SR as soon as possible */
void phy::send_sr(bool enable)
{
sr_enabled = enable;
@ -502,6 +502,7 @@ void phy::run_rx_tx_state()
if (prach_buffer.is_ready_to_send(current_tti)) {
// send prach if we have to
prach_buffer.send(radio_handler, cfo, last_rx_time);
radio_handler->tx_end();
radio_handler->set_tx_gain(old_gain);
srslte_agc_lock(&ue_sync.agc, false);
Info("Restoring AGC. Set TX gain to %.1f dB\n", old_gain);

@ -357,7 +357,7 @@ int srslte_prach_init(srslte_prach_t *p,
p->rsi = root_seq_index;
p->hs = high_speed_flag;
p->zczc = zero_corr_zone_config;
// Determine N_zc and N_cs
if(4 == preamble_format){
p->N_zc = 139;
@ -370,6 +370,8 @@ int srslte_prach_init(srslte_prach_t *p,
p->N_cs = prach_Ncs_unrestricted[p->zczc];
}
}
printf("Ncs=%d, zczc=%d, root_seq_index=%d, format=%d\n", p->N_cs, zero_corr_zone_config, root_seq_index, preamble_format);
// Set up containers
p->prach_bins = srslte_vec_malloc(sizeof(cf_t)*p->N_zc);
@ -500,7 +502,7 @@ int srslte_prach_detect(srslte_prach_t *p,
uint32_t N_rb_ul = prach_get_rb_ul(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) + 1;
uint32_t begin = PHI + (K*k_0) + (K/2);
for(int i=0;i<p->N_zc;i++){
p->prach_bins[i] = signal[begin+i];

Loading…
Cancel
Save