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,21 +537,51 @@ uint8_t nr_ue_pusch_common_procedures(PHY_VARS_NR_UE *UE, ...@@ -537,21 +537,51 @@ uint8_t nr_ue_pusch_common_procedures(PHY_VARS_NR_UE *UE,
txdata = UE->common_vars.txdata; txdata = UE->common_vars.txdata;
txdataF = UE->common_vars.txdataF; txdataF = UE->common_vars.txdataF;
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],
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],
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++) { for (ap = 0; ap < Nl; ap++) {
if (frame_parms->Ncp == 1) { // extended cyclic prefix if (frame_parms->Ncp == 1) { // extended cyclic prefix
PHY_ofdm_mod(txdataF[ap], PHY_ofdm_mod(txdataF[ap],
&txdata[ap][tx_offset], &txdata[ap][tx_offset-UE->N_TA_offset],
frame_parms->ofdm_symbol_size, frame_parms->ofdm_symbol_size,
12, 12,
frame_parms->nb_prefix_samples, frame_parms->nb_prefix_samples,
CYCLIC_PREFIX); CYCLIC_PREFIX);
} else { // normal cyclic prefix } else { // normal cyclic prefix
nr_normal_prefix_mod(txdataF[ap], nr_normal_prefix_mod(txdataF[ap],
&txdata[ap][tx_offset], &txdata[ap][tx_offset-UE->N_TA_offset],
14, 14,
frame_parms); frame_parms);
} }
} }
}
/////////// ///////////
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
......
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