Commit 3c17573f authored by Thomas Schlichter's avatar Thomas Schlichter

apply nr rotation only on used PRBs instead of complete OFDM symbol

parent 21ea2f21
......@@ -221,8 +221,7 @@ void rx_func(void *param) {
gNB->common_vars.rxdataF[aa],
slot_rx,
0,
gNB->frame_parms.Ncp==EXTENDED?12:14,
gNB->frame_parms.ofdm_symbol_size);
gNB->frame_parms.Ncp==EXTENDED?12:14);
}
phy_procedures_gNB_uespec_RX(gNB, frame_rx, slot_rx);
}
......
......@@ -112,8 +112,7 @@ void apply_nr_rotation(NR_DL_FRAME_PARMS *fp,
int16_t* txdata,
int slot,
int first_symbol,
int nsymb,
int length);
int nsymb);
void init_symbol_rotation(NR_DL_FRAME_PARMS *fp);
......@@ -123,8 +122,7 @@ void apply_nr_rotation_ul(NR_DL_FRAME_PARMS *frame_parms,
int32_t *rxdataF,
int slot,
int first_symbol,
int nsymb,
int length);
int nsymb);
/*! \brief Perform NR precoding. TS 38.211 V15.4.0 subclause 6.3.1.5
@param[in] datatx_F_precoding, Pointer to n_layers*re data array
......
......@@ -341,29 +341,33 @@ void do_OFDM_mod(int32_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t ne
}
void apply_nr_rotation(NR_DL_FRAME_PARMS *fp,
int16_t* trxdata,
int16_t* txdataF,
int slot,
int first_symbol,
int nsymb,
int length) {
int nsymb)
{
int symb_offset = (slot%fp->slots_per_subframe)*fp->symbols_per_slot;
c16_t *symbol_rotation = fp->symbol_rotation[0];
for (int sidx=0;sidx<nsymb;sidx++) {
LOG_D(PHY,"Rotating symbol %d, slot %d, symbol_subframe_index %d, length %d (%d,%d)\n",
LOG_D(PHY,"Rotating symbol %d, slot %d, symbol_subframe_index %d (%d,%d)\n",
first_symbol + sidx,
slot,
sidx + first_symbol + symb_offset,
length,
symbol_rotation[sidx + first_symbol + symb_offset].r,
symbol_rotation[sidx + first_symbol + symb_offset].i);
rotate_cpx_vector(((c16_t*) trxdata) + sidx * length,
rotate_cpx_vector(((c16_t*) txdataF) + sidx * fp->ofdm_symbol_size,
symbol_rotation + sidx + first_symbol + symb_offset,
((c16_t*) txdataF) + sidx * fp->ofdm_symbol_size,
fp->N_RB_DL * 6,
15);
rotate_cpx_vector(((c16_t*) txdataF) + sidx * fp->ofdm_symbol_size + fp->first_carrier_offset,
symbol_rotation + sidx + first_symbol + symb_offset,
((c16_t*) trxdata) + sidx * length,
length,
((c16_t*) txdataF) + sidx * fp->ofdm_symbol_size + fp->first_carrier_offset,
fp->N_RB_DL * 6,
15);
}
}
......
......@@ -108,19 +108,30 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
#endif
rotate_cpx_vector((c16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
&rot2,
(c16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
frame_parms->ofdm_symbol_size,
15);
&rot2,
(c16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
frame_parms->N_RB_DL * 6,
15);
rotate_cpx_vector((c16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol + frame_parms->first_carrier_offset],
&rot2,
(c16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol + frame_parms->first_carrier_offset],
frame_parms->N_RB_DL * 6,
15);
c16_t *shift_rot = frame_parms->timeshift_symbol_rotation;
multadd_cpx_vector((int16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
(int16_t *)shift_rot,
(int16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
1,
frame_parms->ofdm_symbol_size,
15);
(int16_t *)shift_rot,
(int16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
1,
frame_parms->N_RB_DL * 6,
15);
multadd_cpx_vector((int16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol + frame_parms->first_carrier_offset],
(int16_t *)(shift_rot + frame_parms->first_carrier_offset),
(int16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol + frame_parms->first_carrier_offset],
1,
frame_parms->N_RB_DL * 6,
15);
}
#ifdef DEBUG_FEP
......@@ -301,10 +312,8 @@ void apply_nr_rotation_ul(NR_DL_FRAME_PARMS *frame_parms,
int32_t *rxdataF,
int slot,
int first_symbol,
int nsymb,
int length) {
int nsymb)
{
int symb_offset = (slot%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot;
int soffset = (slot&3)*frame_parms->symbols_per_slot*frame_parms->ofdm_symbol_size;
......@@ -314,18 +323,29 @@ void apply_nr_rotation_ul(NR_DL_FRAME_PARMS *frame_parms,
rot2.i=-rot2.i;
LOG_D(PHY,"slot %d, symb_offset %d rotating by %d.%d\n",slot,symb_offset,rot2.r,rot2.i);
rotate_cpx_vector((c16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
&rot2,
(c16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
length,
15);
&rot2,
(c16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
frame_parms->N_RB_UL * 6,
15);
rotate_cpx_vector((c16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)+frame_parms->first_carrier_offset],
&rot2,
(c16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)+frame_parms->first_carrier_offset],
frame_parms->N_RB_UL * 6,
15);
c16_t *shift_rot = frame_parms->timeshift_symbol_rotation;
multadd_cpx_vector((int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
(int16_t *)shift_rot,
(int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
1,
length,
15);
(int16_t *)shift_rot,
(int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
1,
frame_parms->N_RB_UL * 6,
15);
multadd_cpx_vector((int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)+frame_parms->first_carrier_offset],
(int16_t *)(shift_rot + frame_parms->first_carrier_offset),
(int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)+frame_parms->first_carrier_offset],
1,
frame_parms->N_RB_UL * 6,
15);
}
}
......@@ -606,7 +606,12 @@ uint8_t nr_ue_pusch_common_procedures(PHY_VARS_NR_UE *UE,
rotate_cpx_vector((c16_t *)&txdataF[ap][frame_parms->ofdm_symbol_size * s],
&rot,
(c16_t *)&txdataF[ap][frame_parms->ofdm_symbol_size * s],
frame_parms->ofdm_symbol_size,
frame_parms->N_RB_UL * 6,
15);
rotate_cpx_vector((c16_t *)&txdataF[ap][frame_parms->ofdm_symbol_size * s + frame_parms->first_carrier_offset],
&rot,
(c16_t *)&txdataF[ap][frame_parms->ofdm_symbol_size * s + frame_parms->first_carrier_offset],
frame_parms->N_RB_UL * 6,
15);
}
}
......
......@@ -181,7 +181,7 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx,
//apply the OFDM symbol rotation here
for (aa=0; aa<cfg->carrier_config.num_tx_ant.value; aa++) {
apply_nr_rotation(fp,(int16_t*) &gNB->common_vars.txdataF[aa][txdataF_offset],slot,0,fp->Ncp==EXTENDED?12:14,fp->ofdm_symbol_size);
apply_nr_rotation(fp,(int16_t*) &gNB->common_vars.txdataF[aa][txdataF_offset],slot,0,fp->Ncp==EXTENDED?12:14);
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_TX+offset,0);
......
......@@ -610,8 +610,7 @@ int main(int argc, char **argv)
(int16_t*)gNB->common_vars.txdataF[aa],
slot,
0,
12,
frame_parms->ofdm_symbol_size);
12);
PHY_ofdm_mod(gNB->common_vars.txdataF[aa],
&txdata[aa][frame_parms->get_samples_slot_timestamp(slot,frame_parms,0)],
......@@ -624,8 +623,7 @@ int main(int argc, char **argv)
(int16_t*)gNB->common_vars.txdataF[aa],
slot,
0,
14,
frame_parms->ofdm_symbol_size);
14);
/*nr_normal_prefix_mod(gNB->common_vars.txdataF[aa],
&txdata[aa][frame_parms->get_samples_slot_timestamp(slot,frame_parms,0)],
......
......@@ -1377,8 +1377,7 @@ int main(int argc, char **argv)
gNB->common_vars.rxdataF[aa],
slot,
0,
gNB->frame_parms.Ncp == EXTENDED ? 12 : 14,
gNB->frame_parms.ofdm_symbol_size);
gNB->frame_parms.Ncp == EXTENDED ? 12 : 14);
}
ul_proc_error = phy_procedures_gNB_uespec_RX(gNB, frame, slot);
......
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