Commit 63106069 authored by Thomas Schlichter's avatar Thomas Schlichter

fix alignment issues in case of odd number of PRBs

parent 3c17573f
......@@ -359,6 +359,18 @@ void apply_nr_rotation(NR_DL_FRAME_PARMS *fp,
symbol_rotation[sidx + first_symbol + symb_offset].r,
symbol_rotation[sidx + first_symbol + symb_offset].i);
if (fp->N_RB_DL & 1) {
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 + 1) * 6,
15);
rotate_cpx_vector(((c16_t*) txdataF) + sidx * fp->ofdm_symbol_size + fp->first_carrier_offset - 6,
symbol_rotation + sidx + first_symbol + symb_offset,
((c16_t*) txdataF) + sidx * fp->ofdm_symbol_size + fp->first_carrier_offset - 6,
(fp->N_RB_DL + 1) * 6,
15);
} else {
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,
......@@ -370,5 +382,6 @@ void apply_nr_rotation(NR_DL_FRAME_PARMS *fp,
fp->N_RB_DL * 6,
15);
}
}
}
......@@ -107,6 +107,32 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
symbol+symb_offset,rot2.r,rot2.i);
#endif
c16_t *shift_rot = frame_parms->timeshift_symbol_rotation;
if (frame_parms->N_RB_DL & 1) {
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->N_RB_DL + 1) * 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 - 6],
&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 - 6],
(frame_parms->N_RB_DL + 1) * 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],
(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 + 1) * 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 - 6],
(int16_t *)(shift_rot + frame_parms->first_carrier_offset - 6),
(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 - 6],
1,
(frame_parms->N_RB_DL + 1) * 6,
15);
} else {
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],
......@@ -117,9 +143,6 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
(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],
......@@ -133,6 +156,7 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
frame_parms->N_RB_DL * 6,
15);
}
}
#ifdef DEBUG_FEP
printf("slot_fep: done\n");
......@@ -322,6 +346,33 @@ void apply_nr_rotation_ul(NR_DL_FRAME_PARMS *frame_parms,
c16_t rot2 = frame_parms->symbol_rotation[1][symbol + symb_offset];
rot2.i=-rot2.i;
LOG_D(PHY,"slot %d, symb_offset %d rotating by %d.%d\n",slot,symb_offset,rot2.r,rot2.i);
c16_t *shift_rot = frame_parms->timeshift_symbol_rotation;
if (frame_parms->N_RB_UL & 1) {
rotate_cpx_vector((c16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
&rot2,
(c16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
(frame_parms->N_RB_UL + 1) * 6,
15);
rotate_cpx_vector((c16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)+frame_parms->first_carrier_offset-6],
&rot2,
(c16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)+frame_parms->first_carrier_offset-6],
(frame_parms->N_RB_UL + 1) * 6,
15);
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,
(frame_parms->N_RB_UL+1) * 6,
15);
multadd_cpx_vector((int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)+frame_parms->first_carrier_offset-6],
(int16_t *)(shift_rot + frame_parms->first_carrier_offset - 6),
(int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)+frame_parms->first_carrier_offset-6],
1,
(frame_parms->N_RB_UL+1) * 6,
15);
} else {
rotate_cpx_vector((c16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
&rot2,
(c16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
......@@ -332,9 +383,6 @@ void apply_nr_rotation_ul(NR_DL_FRAME_PARMS *frame_parms,
(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)],
......@@ -348,4 +396,5 @@ void apply_nr_rotation_ul(NR_DL_FRAME_PARMS *frame_parms,
frame_parms->N_RB_UL * 6,
15);
}
}
}
......@@ -603,6 +603,18 @@ uint8_t nr_ue_pusch_common_procedures(PHY_VARS_NR_UE *UE,
s + symb_offset,
rot.r, rot.i);
if (frame_parms->N_RB_UL & 1) {
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->N_RB_UL + 1) * 6,
15);
rotate_cpx_vector((c16_t *)&txdataF[ap][frame_parms->ofdm_symbol_size * s + frame_parms->first_carrier_offset - 6],
&rot,
(c16_t *)&txdataF[ap][frame_parms->ofdm_symbol_size * s + frame_parms->first_carrier_offset - 6],
(frame_parms->N_RB_UL + 1) * 6,
15);
} else {
rotate_cpx_vector((c16_t *)&txdataF[ap][frame_parms->ofdm_symbol_size * s],
&rot,
(c16_t *)&txdataF[ap][frame_parms->ofdm_symbol_size * s],
......@@ -615,6 +627,7 @@ uint8_t nr_ue_pusch_common_procedures(PHY_VARS_NR_UE *UE,
15);
}
}
}
for (ap = 0; ap < n_antenna_ports; ap++) {
if (frame_parms->Ncp == 1) { // extended cyclic prefix
......
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