Commit fcf64390 authored by Ahmed Hussein's avatar Ahmed Hussein Committed by Thomas Schlichter

Fixed bug related to N_TA_offset not being applied at UE

  - By default this value is equal to 0 at gNB in case of ulsim, but
    has a value in case of RF simulator
  - The N_TA_offset was calculated but not used at UE side
parent eeef6da2
......@@ -537,22 +537,52 @@ uint8_t nr_ue_pusch_common_procedures(PHY_VARS_NR_UE *UE,
txdata = UE->common_vars.txdata;
txdataF = UE->common_vars.txdataF;
for (ap = 0; ap < Nl; ap++) {
if(UE->N_TA_offset > tx_offset) {
int32_t *tmp_idft_out = (int32_t*)malloc16(frame_parms->get_samples_per_slot(slot, frame_parms) * sizeof(int32_t));
for(ap = 0; ap < Nl; ap++) {
if (frame_parms->Ncp == 1) { // extended cyclic prefix
PHY_ofdm_mod(txdataF[ap],
&txdata[ap][tx_offset],
frame_parms->ofdm_symbol_size,
12,
frame_parms->nb_prefix_samples,
CYCLIC_PREFIX);
PHY_ofdm_mod(txdataF[ap],
tmp_idft_out,
frame_parms->ofdm_symbol_size,
12,
frame_parms->nb_prefix_samples,
CYCLIC_PREFIX);
} else { // normal cyclic prefix
nr_normal_prefix_mod(txdataF[ap],
&txdata[ap][tx_offset],
14,
frame_parms);
nr_normal_prefix_mod(txdataF[ap],
tmp_idft_out,
14,
frame_parms);
}
memcpy((void *) &txdata[ap][frame_parms->samples_per_frame - UE->N_TA_offset + tx_offset],
(void *) tmp_idft_out,
(UE->N_TA_offset - tx_offset) * sizeof(int32_t));
memcpy((void *) &txdata[ap][0],
(void *) &tmp_idft_out[UE->N_TA_offset - tx_offset],
(frame_parms->get_samples_per_slot(slot, frame_parms) - UE->N_TA_offset + tx_offset) * sizeof(int32_t));
}
free(tmp_idft_out);
} else { // UE->N_TA_offset <= tx_offset
for (ap = 0; ap < Nl; ap++) {
if (frame_parms->Ncp == 1) { // extended cyclic prefix
PHY_ofdm_mod(txdataF[ap],
&txdata[ap][tx_offset-UE->N_TA_offset],
frame_parms->ofdm_symbol_size,
12,
frame_parms->nb_prefix_samples,
CYCLIC_PREFIX);
} else { // normal cyclic prefix
nr_normal_prefix_mod(txdataF[ap],
&txdata[ap][tx_offset-UE->N_TA_offset],
14,
frame_parms);
}
}
}
///////////
////////////////////////////////////////////////////
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment