Commit 2cced7bd authored by Robert Schmidt's avatar Robert Schmidt

Merge remote-tracking branch 'origin/optim-rotate_cpx' into integration_2022_wk26

parents b7e026fd df1cffbc
...@@ -197,8 +197,8 @@ check_warnings() { ...@@ -197,8 +197,8 @@ check_warnings() {
#argument: #argument:
# $1: log file # $1: log file
check_errors() { check_errors() {
#we look for 'warning:' in the compilation log file #we look for 'error:' in the compilation log file
error_count=`grep "error:" "$1" | wc -l` error_count=`grep -c "error:" "$1"`
if [ $error_count -gt 0 ]; then if [ $error_count -gt 0 ]; then
echo_error "ERROR: $error_count error. See $1" echo_error "ERROR: $error_count error. See $1"
fi fi
......
...@@ -88,7 +88,7 @@ int32_t lte_ul_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -88,7 +88,7 @@ int32_t lte_ul_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
} }
uint16_t N_rb_alloc = ulsch->harq_processes[harq_pid]->nb_rb; uint16_t N_rb_alloc = ulsch->harq_processes[harq_pid]->nb_rb;
int32_t tmp_estimates[N_rb_alloc*12] __attribute__((aligned(16))); int32_t tmp_estimates[N_rb_alloc*12] __attribute__((aligned(32)));
Msc_RS = N_rb_alloc*12; Msc_RS = N_rb_alloc*12;
cyclic_shift = (frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift + cyclic_shift = (frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift +
ulsch->harq_processes[harq_pid]->n_DMRS2 + ulsch->harq_processes[harq_pid]->n_DMRS2 +
...@@ -334,14 +334,14 @@ int32_t lte_ul_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -334,14 +334,14 @@ int32_t lte_ul_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
current_phase2 = cmin(abs(current_phase2),127); current_phase2 = cmin(abs(current_phase2),127);
// msg("sym: %d, current_phase1: %d, ru: %d + j%d, current_phase2: %d, ru: %d + j%d\n",k,current_phase1,ru1[2*current_phase1],ru1[2*current_phase1+1],current_phase2,ru2[2*current_phase2],ru2[2*current_phase2+1]); // msg("sym: %d, current_phase1: %d, ru: %d + j%d, current_phase2: %d, ru: %d + j%d\n",k,current_phase1,ru1[2*current_phase1],ru1[2*current_phase1+1],current_phase2,ru2[2*current_phase2],ru2[2*current_phase2+1]);
// rotate channel estimates by estimated phase // rotate channel estimates by estimated phase
rotate_cpx_vector((int16_t *) ul_ch1, rotate_cpx_vector((c16_t *) ul_ch1,
&ru1[2*current_phase1], (c16_t *)&ru1[2*current_phase1],
(int16_t *) &ul_ch_estimates[aa][frame_parms->N_RB_UL*12*k], (c16_t *) &ul_ch_estimates[aa][frame_parms->N_RB_UL*12*k],
Msc_RS, Msc_RS,
15); 15);
rotate_cpx_vector((int16_t *) ul_ch2, rotate_cpx_vector((c16_t *) ul_ch2,
&ru2[2*current_phase2], (c16_t *)&ru2[2*current_phase2],
(int16_t *) &tmp_estimates[0], (c16_t *) tmp_estimates,
Msc_RS, Msc_RS,
15); 15);
// Combine the two rotated estimates // Combine the two rotated estimates
...@@ -657,14 +657,14 @@ int32_t lte_ul_channel_estimation_RRU(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -657,14 +657,14 @@ int32_t lte_ul_channel_estimation_RRU(LTE_DL_FRAME_PARMS *frame_parms,
current_phase2 = cmin(abs(current_phase2),127); current_phase2 = cmin(abs(current_phase2),127);
// msg("sym: %d, current_phase1: %d, ru: %d + j%d, current_phase2: %d, ru: %d + j%d\n",k,current_phase1,ru1[2*current_phase1],ru1[2*current_phase1+1],current_phase2,ru2[2*current_phase2],ru2[2*current_phase2+1]); // msg("sym: %d, current_phase1: %d, ru: %d + j%d, current_phase2: %d, ru: %d + j%d\n",k,current_phase1,ru1[2*current_phase1],ru1[2*current_phase1+1],current_phase2,ru2[2*current_phase2],ru2[2*current_phase2+1]);
// rotate channel estimates by estimated phase // rotate channel estimates by estimated phase
rotate_cpx_vector((int16_t *) ul_ch1, rotate_cpx_vector((c16_t *) ul_ch1,
&ru1[2*current_phase1], (c16_t *) &ru1[2*current_phase1],
(int16_t *) &ul_ch_estimates[aa][frame_parms->N_RB_UL*12*k], (c16_t *) &ul_ch_estimates[aa][frame_parms->N_RB_UL*12*k],
Msc_RS, Msc_RS,
15); 15);
rotate_cpx_vector((int16_t *) ul_ch2, rotate_cpx_vector((c16_t *) ul_ch2,
&ru2[2*current_phase2], (c16_t *) &ru2[2*current_phase2],
(int16_t *) &tmp_estimates[0], (c16_t *) &tmp_estimates[0],
Msc_RS, Msc_RS,
15); 15);
// Combine the two rotated estimates // Combine the two rotated estimates
......
...@@ -618,20 +618,20 @@ void init_symbol_rotation(NR_DL_FRAME_PARMS *fp) { ...@@ -618,20 +618,20 @@ void init_symbol_rotation(NR_DL_FRAME_PARMS *fp) {
double f0 = f[ll]; double f0 = f[ll];
double Ncpm1 = Ncp0; double Ncpm1 = Ncp0;
int16_t *symbol_rotation = fp->symbol_rotation[ll]; c16_t *symbol_rotation = fp->symbol_rotation[ll];
double tl = 0; double tl = 0;
double poff = 2 * M_PI * ((Ncp0 * Tc)) * f0; double poff = 2 * M_PI * ((Ncp0 * Tc)) * f0;
double exp_re = cos(poff); double exp_re = cos(poff);
double exp_im = sin(-poff); double exp_im = sin(-poff);
symbol_rotation[0] = (int16_t)floor(exp_re * 32767); symbol_rotation[0].r = (int16_t)floor(exp_re * 32767);
symbol_rotation[1] = (int16_t)floor(exp_im * 32767); symbol_rotation[0].i = (int16_t)floor(exp_im * 32767);
LOG_I(PHY, "Doing symbol rotation calculation for gNB TX/RX, f0 %f Hz, Nsymb %d\n", f0, nsymb); LOG_I(PHY, "Doing symbol rotation calculation for gNB TX/RX, f0 %f Hz, Nsymb %d\n", f0, nsymb);
LOG_I(PHY, "Symbol rotation %d/%d => (%d,%d)\n", LOG_I(PHY, "Symbol rotation %d/%d => (%d,%d)\n",
0, 0,
nsymb, nsymb,
symbol_rotation[0], symbol_rotation[0].r,
symbol_rotation[1]); symbol_rotation[0].i);
for (int l = 1; l < nsymb; l++) { for (int l = 1; l < nsymb; l++) {
...@@ -646,15 +646,15 @@ void init_symbol_rotation(NR_DL_FRAME_PARMS *fp) { ...@@ -646,15 +646,15 @@ void init_symbol_rotation(NR_DL_FRAME_PARMS *fp) {
poff = 2 * M_PI * (tl + (Ncp * Tc)) * f0; poff = 2 * M_PI * (tl + (Ncp * Tc)) * f0;
exp_re = cos(poff); exp_re = cos(poff);
exp_im = sin(-poff); exp_im = sin(-poff);
symbol_rotation[l<<1] = (int16_t)floor(exp_re * 32767); symbol_rotation[l].r = (int16_t)floor(exp_re * 32767);
symbol_rotation[1 + (l<<1)] = (int16_t)floor(exp_im * 32767); symbol_rotation[l].i = (int16_t)floor(exp_im * 32767);
LOG_I(PHY, "Symbol rotation %d/%d => tl %f (%d,%d) (%f)\n", LOG_I(PHY, "Symbol rotation %d/%d => tl %f (%d,%d) (%f)\n",
l, l,
nsymb, nsymb,
tl, tl,
symbol_rotation[l<<1], symbol_rotation[l].r,
symbol_rotation[1 + (l<<1)], symbol_rotation[l].i,
(poff / 2 / M_PI) - floor(poff / 2 / M_PI)); (poff / 2 / M_PI) - floor(poff / 2 / M_PI));
Ncpm1 = Ncp; Ncpm1 = Ncp;
...@@ -670,13 +670,13 @@ void init_timeshift_rotation(NR_DL_FRAME_PARMS *fp) ...@@ -670,13 +670,13 @@ void init_timeshift_rotation(NR_DL_FRAME_PARMS *fp)
double poff = -i * 2.0 * M_PI * sample_offset / fp->ofdm_symbol_size; double poff = -i * 2.0 * M_PI * sample_offset / fp->ofdm_symbol_size;
double exp_re = cos(poff); double exp_re = cos(poff);
double exp_im = sin(-poff); double exp_im = sin(-poff);
fp->timeshift_symbol_rotation[i*2] = (int16_t)round(exp_re * 32767); fp->timeshift_symbol_rotation[i].r = (int16_t)round(exp_re * 32767);
fp->timeshift_symbol_rotation[i*2+1] = (int16_t)round(exp_im * 32767); fp->timeshift_symbol_rotation[i].i = (int16_t)round(exp_im * 32767);
if (i < 10) if (i < 10)
LOG_I(PHY,"Timeshift symbol rotation %d => (%d,%d) %f\n",i, LOG_I(PHY,"Timeshift symbol rotation %d => (%d,%d) %f\n",i,
fp->timeshift_symbol_rotation[i*2], fp->timeshift_symbol_rotation[i].r,
fp->timeshift_symbol_rotation[i*2+1], fp->timeshift_symbol_rotation[i].i,
poff); poff);
} }
} }
......
...@@ -348,7 +348,7 @@ void apply_nr_rotation(NR_DL_FRAME_PARMS *fp, ...@@ -348,7 +348,7 @@ void apply_nr_rotation(NR_DL_FRAME_PARMS *fp,
int length) { int length) {
int symb_offset = (slot%fp->slots_per_subframe)*fp->symbols_per_slot; int symb_offset = (slot%fp->slots_per_subframe)*fp->symbols_per_slot;
int16_t *symbol_rotation = fp->symbol_rotation[0]; c16_t *symbol_rotation = fp->symbol_rotation[0];
for (int sidx=0;sidx<nsymb;sidx++) { for (int sidx=0;sidx<nsymb;sidx++) {
...@@ -357,12 +357,12 @@ void apply_nr_rotation(NR_DL_FRAME_PARMS *fp, ...@@ -357,12 +357,12 @@ void apply_nr_rotation(NR_DL_FRAME_PARMS *fp,
slot, slot,
sidx + first_symbol + symb_offset, sidx + first_symbol + symb_offset,
length, length,
symbol_rotation[2 * (sidx + first_symbol + symb_offset)], symbol_rotation[sidx + first_symbol + symb_offset].r,
symbol_rotation[1 + 2 * (sidx + first_symbol + symb_offset)]); symbol_rotation[sidx + first_symbol + symb_offset].i);
rotate_cpx_vector(trxdata + (sidx * length * 2), rotate_cpx_vector(((c16_t*) trxdata) + sidx * length,
&symbol_rotation[2 * (sidx + first_symbol + symb_offset)], symbol_rotation + sidx + first_symbol + symb_offset,
trxdata + (sidx * length * 2), ((c16_t*) trxdata) + sidx * length,
length, length,
15); 15);
} }
......
...@@ -98,25 +98,25 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue, ...@@ -98,25 +98,25 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
stop_meas(&ue->rx_dft_stats); stop_meas(&ue->rx_dft_stats);
int symb_offset = (Ns%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot; int symb_offset = (Ns%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot;
int32_t rot2 = ((uint32_t*)frame_parms->symbol_rotation[0])[symbol+symb_offset]; c16_t rot2 = frame_parms->symbol_rotation[0][symbol+symb_offset];
((int16_t*)&rot2)[1]=-((int16_t*)&rot2)[1]; rot2.i=-rot2.i;
#ifdef DEBUG_FEP #ifdef DEBUG_FEP
// if (ue->frame <100) // if (ue->frame <100)
printf("slot_fep: slot %d, symbol %d rx_offset %u, rotation symbol %d %d.%d\n", Ns,symbol, rx_offset, printf("slot_fep: slot %d, symbol %d rx_offset %u, rotation symbol %d %d.%d\n", Ns,symbol, rx_offset,
symbol+symb_offset,((int16_t*)&rot2)[0],((int16_t*)&rot2)[1]); symbol+symb_offset,rot2.r,rot2.i);
#endif #endif
rotate_cpx_vector((int16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol], rotate_cpx_vector((c16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
(int16_t*)&rot2, &rot2,
(int16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol], (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, frame_parms->ofdm_symbol_size,
15); 15);
int16_t *shift_rot = frame_parms->timeshift_symbol_rotation; 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], multadd_cpx_vector((int16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
shift_rot, (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], (int16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
1, 1,
frame_parms->ofdm_symbol_size, frame_parms->ofdm_symbol_size,
...@@ -214,18 +214,18 @@ int nr_slot_fep_init_sync(PHY_VARS_NR_UE *ue, ...@@ -214,18 +214,18 @@ int nr_slot_fep_init_sync(PHY_VARS_NR_UE *ue,
stop_meas(&ue->rx_dft_stats); stop_meas(&ue->rx_dft_stats);
int symb_offset = (Ns%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot; int symb_offset = (Ns%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot;
int32_t rot2 = ((uint32_t*)frame_parms->symbol_rotation[0])[symbol + symb_offset]; c16_t rot2 = frame_parms->symbol_rotation[0][symbol + symb_offset];
((int16_t*)&rot2)[1]=-((int16_t*)&rot2)[1]; rot2.i=-rot2.i;
#ifdef DEBUG_FEP #ifdef DEBUG_FEP
// if (ue->frame <100) // if (ue->frame <100)
printf("slot_fep: slot %d, symbol %d rx_offset %u, rotation symbol %d %d.%d\n", Ns,symbol, rx_offset, printf("slot_fep: slot %d, symbol %d rx_offset %u, rotation symbol %d %d.%d\n", Ns,symbol, rx_offset,
symbol+symb_offset,((int16_t*)&rot2)[0],((int16_t*)&rot2)[1]); symbol+symb_offset,rot2.r,rot2.i);
#endif #endif
rotate_cpx_vector((int16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol], rotate_cpx_vector((c16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
(int16_t*)&rot2, &rot2,
(int16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol], (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, frame_parms->ofdm_symbol_size,
15); 15);
} }
...@@ -310,19 +310,19 @@ void apply_nr_rotation_ul(NR_DL_FRAME_PARMS *frame_parms, ...@@ -310,19 +310,19 @@ void apply_nr_rotation_ul(NR_DL_FRAME_PARMS *frame_parms,
for (int symbol=first_symbol;symbol<nsymb;symbol++) { for (int symbol=first_symbol;symbol<nsymb;symbol++) {
uint32_t rot2 = ((uint32_t*)frame_parms->symbol_rotation[1])[symbol + symb_offset]; c16_t rot2 = frame_parms->symbol_rotation[1][symbol + symb_offset];
((int16_t*)&rot2)[1]=-((int16_t*)&rot2)[1]; rot2.i=-rot2.i;
LOG_D(PHY,"slot %d, symb_offset %d rotating by %d.%d\n",slot,symb_offset,((int16_t*)&rot2)[0],((int16_t*)&rot2)[1]); LOG_D(PHY,"slot %d, symb_offset %d rotating by %d.%d\n",slot,symb_offset,rot2.r,rot2.i);
rotate_cpx_vector((int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)], rotate_cpx_vector((c16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
(int16_t*)&rot2, &rot2,
(int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)], (c16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
length, length,
15); 15);
int16_t *shift_rot = frame_parms->timeshift_symbol_rotation; c16_t *shift_rot = frame_parms->timeshift_symbol_rotation;
multadd_cpx_vector((int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)], multadd_cpx_vector((int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
shift_rot, (int16_t *)shift_rot,
(int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)], (int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
1, 1,
length, length,
......
...@@ -854,7 +854,6 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB, ...@@ -854,7 +854,6 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
uint32_t nb_re_pusch) uint32_t nb_re_pusch)
{ {
//#define DEBUG_UL_PTRS 1 //#define DEBUG_UL_PTRS 1
int16_t *phase_per_symbol = NULL;
int32_t *ptrs_re_symbol = NULL; int32_t *ptrs_re_symbol = NULL;
int8_t ret = 0; int8_t ret = 0;
...@@ -871,20 +870,20 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB, ...@@ -871,20 +870,20 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
uint8_t *ptrsReOffset = &rel15_ul->pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset; uint8_t *ptrsReOffset = &rel15_ul->pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset;
/* loop over antennas */ /* loop over antennas */
for (int aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { for (int aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
phase_per_symbol = (int16_t*)gNB->pusch_vars[ulsch_id]->ptrs_phase_per_slot[aarx]; c16_t *phase_per_symbol = (c16_t*)gNB->pusch_vars[ulsch_id]->ptrs_phase_per_slot[aarx];
ptrs_re_symbol = &gNB->pusch_vars[ulsch_id]->ptrs_re_per_slot; ptrs_re_symbol = &gNB->pusch_vars[ulsch_id]->ptrs_re_per_slot;
*ptrs_re_symbol = 0; *ptrs_re_symbol = 0;
phase_per_symbol[(2*symbol)+1] = 0; // Imag phase_per_symbol[symbol].i = 0;
/* set DMRS estimates to 0 angle with magnitude 1 */ /* set DMRS estimates to 0 angle with magnitude 1 */
if(is_dmrs_symbol(symbol,*dmrsSymbPos)) { if(is_dmrs_symbol(symbol,*dmrsSymbPos)) {
/* set DMRS real estimation to 32767 */ /* set DMRS real estimation to 32767 */
phase_per_symbol[2*symbol]=(int16_t)((1<<15)-1); // 32767 phase_per_symbol[symbol].r=INT16_MAX; // 32767
#ifdef DEBUG_UL_PTRS #ifdef DEBUG_UL_PTRS
printf("[PHY][PTRS]: DMRS Symbol %d -> %4d + j*%4d\n", symbol, phase_per_symbol[2*symbol],phase_per_symbol[(2*symbol)+1]); printf("[PHY][PTRS]: DMRS Symbol %d -> %4d + j*%4d\n", symbol, phase_per_symbol[symbol].r,phase_per_symbol[symbol].i);
#endif #endif
} }
else {// real ptrs value is set to 0 else {// real ptrs value is set to 0
phase_per_symbol[2*symbol] = 0; // Real phase_per_symbol[symbol].r = 0;
} }
if(symbol == *startSymbIndex) { if(symbol == *startSymbIndex) {
...@@ -909,7 +908,7 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB, ...@@ -909,7 +908,7 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
symbol,frame_parms->ofdm_symbol_size, symbol,frame_parms->ofdm_symbol_size,
(int16_t*)&gNB->pusch_vars[ulsch_id]->rxdataF_comp[aarx][(symbol * nb_re_pusch)], (int16_t*)&gNB->pusch_vars[ulsch_id]->rxdataF_comp[aarx][(symbol * nb_re_pusch)],
gNB->nr_gold_pusch_dmrs[rel15_ul->scid][nr_tti_rx][symbol], gNB->nr_gold_pusch_dmrs[rel15_ul->scid][nr_tti_rx][symbol],
&phase_per_symbol[2* symbol], (int16_t*)&phase_per_symbol[symbol],
ptrs_re_symbol); ptrs_re_symbol);
} }
/* For last OFDM symbol at each antenna perform interpolation and compensation for the slot*/ /* For last OFDM symbol at each antenna perform interpolation and compensation for the slot*/
...@@ -919,7 +918,7 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB, ...@@ -919,7 +918,7 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
/*------------------------------------------------------------------------------------------------------- */ /*------------------------------------------------------------------------------------------------------- */
/* If L-PTRS is > 0 then we need interpolation */ /* If L-PTRS is > 0 then we need interpolation */
if(*L_ptrs > 0) { if(*L_ptrs > 0) {
ret = nr_ptrs_process_slot(*dmrsSymbPos, *ptrsSymbPos, phase_per_symbol, *startSymbIndex, *nbSymb); ret = nr_ptrs_process_slot(*dmrsSymbPos, *ptrsSymbPos, (int16_t*)phase_per_symbol, *startSymbIndex, *nbSymb);
if(ret != 0) { if(ret != 0) {
LOG_W(PHY,"[PTRS] Compensation is skipped due to error in PTRS slot processing !!\n"); LOG_W(PHY,"[PTRS] Compensation is skipped due to error in PTRS slot processing !!\n");
} }
...@@ -938,11 +937,11 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB, ...@@ -938,11 +937,11 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB,
/* Skip rotation if the slot processing is wrong */ /* Skip rotation if the slot processing is wrong */
if((!is_dmrs_symbol(i,*dmrsSymbPos)) && (ret == 0)) { if((!is_dmrs_symbol(i,*dmrsSymbPos)) && (ret == 0)) {
#ifdef DEBUG_UL_PTRS #ifdef DEBUG_UL_PTRS
printf("[PHY][UL][PTRS]: Rotate Symbol %2d with %d + j* %d\n", i, phase_per_symbol[2* i],phase_per_symbol[(2* i) +1]); printf("[PHY][UL][PTRS]: Rotate Symbol %2d with %d + j* %d\n", i, phase_per_symbol[i].r,phase_per_symbol[i].i);
#endif #endif
rotate_cpx_vector((int16_t*)&gNB->pusch_vars[ulsch_id]->rxdataF_comp[aarx][(i * rel15_ul->rb_size * NR_NB_SC_PER_RB)], rotate_cpx_vector((c16_t*)&gNB->pusch_vars[ulsch_id]->rxdataF_comp[aarx][(i * rel15_ul->rb_size * NR_NB_SC_PER_RB)],
&phase_per_symbol[2* i], &phase_per_symbol[i],
(int16_t*)&gNB->pusch_vars[ulsch_id]->rxdataF_comp[aarx][(i * rel15_ul->rb_size * NR_NB_SC_PER_RB)], (c16_t*)&gNB->pusch_vars[ulsch_id]->rxdataF_comp[aarx][(i * rel15_ul->rb_size * NR_NB_SC_PER_RB)],
((*nb_rb) * NR_NB_SC_PER_RB), 15); ((*nb_rb) * NR_NB_SC_PER_RB), 15);
}// if not DMRS Symbol }// if not DMRS Symbol
}// symbol loop }// symbol loop
......
...@@ -1657,7 +1657,6 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue, ...@@ -1657,7 +1657,6 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
RX_type_t rx_type) RX_type_t rx_type)
{ {
//#define DEBUG_DL_PTRS 1 //#define DEBUG_DL_PTRS 1
int16_t *phase_per_symbol = NULL;
int32_t *ptrs_re_symbol = NULL; int32_t *ptrs_re_symbol = NULL;
int8_t ret = 0; int8_t ret = 0;
/* harq specific variables */ /* harq specific variables */
...@@ -1701,20 +1700,20 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue, ...@@ -1701,20 +1700,20 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
} }
/* loop over antennas */ /* loop over antennas */
for (int aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { for (int aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
phase_per_symbol = (int16_t*)pdsch_vars[gNB_id]->ptrs_phase_per_slot[aarx]; c16_t *phase_per_symbol = (c16_t*)pdsch_vars[gNB_id]->ptrs_phase_per_slot[aarx];
ptrs_re_symbol = (int32_t*)pdsch_vars[gNB_id]->ptrs_re_per_slot[aarx]; ptrs_re_symbol = (int32_t*)pdsch_vars[gNB_id]->ptrs_re_per_slot[aarx];
ptrs_re_symbol[symbol] = 0; ptrs_re_symbol[symbol] = 0;
phase_per_symbol[(2*symbol)+1] = 0; // Imag phase_per_symbol[symbol].i = 0; // Imag
/* set DMRS estimates to 0 angle with magnitude 1 */ /* set DMRS estimates to 0 angle with magnitude 1 */
if(is_dmrs_symbol(symbol,*dmrsSymbPos)) { if(is_dmrs_symbol(symbol,*dmrsSymbPos)) {
/* set DMRS real estimation to 32767 */ /* set DMRS real estimation to 32767 */
phase_per_symbol[2*symbol]=(int16_t)((1<<15)-1); // 32767 phase_per_symbol[symbol].r=INT16_MAX; // 32767
#ifdef DEBUG_DL_PTRS #ifdef DEBUG_DL_PTRS
printf("[PHY][PTRS]: DMRS Symbol %d -> %4d + j*%4d\n", symbol, phase_per_symbol[2*symbol],phase_per_symbol[(2*symbol)+1]); printf("[PHY][PTRS]: DMRS Symbol %d -> %4d + j*%4d\n", symbol, phase_per_symbol[symbol].r,phase_per_symbol[symbol].i);
#endif #endif
} }
else { // real ptrs value is set to 0 else { // real ptrs value is set to 0
phase_per_symbol[2*symbol] = 0; // Real phase_per_symbol[symbol].r = 0; // Real
} }
if(dlsch0_harq->status == ACTIVE) { if(dlsch0_harq->status == ACTIVE) {
...@@ -1740,7 +1739,7 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue, ...@@ -1740,7 +1739,7 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
symbol,frame_parms->ofdm_symbol_size, symbol,frame_parms->ofdm_symbol_size,
(int16_t*)&pdsch_vars[gNB_id]->rxdataF_comp0[aarx][(symbol * nb_re_pdsch)], (int16_t*)&pdsch_vars[gNB_id]->rxdataF_comp0[aarx][(symbol * nb_re_pdsch)],
ue->nr_gold_pdsch[gNB_id][nr_slot_rx][symbol][0], ue->nr_gold_pdsch[gNB_id][nr_slot_rx][symbol][0],
&phase_per_symbol[2* symbol], (int16_t*)&phase_per_symbol[symbol],
&ptrs_re_symbol[symbol]); &ptrs_re_symbol[symbol]);
} }
}// HARQ 0 }// HARQ 0
...@@ -1752,7 +1751,7 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue, ...@@ -1752,7 +1751,7 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
/*------------------------------------------------------------------------------------------------------- */ /*------------------------------------------------------------------------------------------------------- */
/* If L-PTRS is > 0 then we need interpolation */ /* If L-PTRS is > 0 then we need interpolation */
if(*L_ptrs > 0) { if(*L_ptrs > 0) {
ret = nr_ptrs_process_slot(*dmrsSymbPos, *ptrsSymbPos, phase_per_symbol, *startSymbIndex, *nbSymb); ret = nr_ptrs_process_slot(*dmrsSymbPos, *ptrsSymbPos, (int16_t*)phase_per_symbol, *startSymbIndex, *nbSymb);
if(ret != 0) { if(ret != 0) {
LOG_W(PHY,"[PTRS] Compensation is skipped due to error in PTRS slot processing !!\n"); LOG_W(PHY,"[PTRS] Compensation is skipped due to error in PTRS slot processing !!\n");
} }
...@@ -1771,11 +1770,11 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue, ...@@ -1771,11 +1770,11 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
/* Skip rotation if the slot processing is wrong */ /* Skip rotation if the slot processing is wrong */
if((!is_dmrs_symbol(i,*dmrsSymbPos)) && (ret == 0)) { if((!is_dmrs_symbol(i,*dmrsSymbPos)) && (ret == 0)) {
#ifdef DEBUG_DL_PTRS #ifdef DEBUG_DL_PTRS
printf("[PHY][DL][PTRS]: Rotate Symbol %2d with %d + j* %d\n", i, phase_per_symbol[2* i],phase_per_symbol[(2* i) +1]); printf("[PHY][DL][PTRS]: Rotate Symbol %2d with %d + j* %d\n", i, phase_per_symbol[i].r,phase_per_symbol[i].i);
#endif #endif
rotate_cpx_vector((int16_t*)&pdsch_vars[gNB_id]->rxdataF_comp0[aarx][(i * (*nb_rb) * NR_NB_SC_PER_RB)], rotate_cpx_vector((c16_t*)&pdsch_vars[gNB_id]->rxdataF_comp0[aarx][(i * (*nb_rb) * NR_NB_SC_PER_RB)],
&phase_per_symbol[2* i], &phase_per_symbol[i],
(int16_t*)&pdsch_vars[gNB_id]->rxdataF_comp0[aarx][(i * (*nb_rb) * NR_NB_SC_PER_RB)], (c16_t*)&pdsch_vars[gNB_id]->rxdataF_comp0[aarx][(i * (*nb_rb) * NR_NB_SC_PER_RB)],
((*nb_rb) * NR_NB_SC_PER_RB), 15); ((*nb_rb) * NR_NB_SC_PER_RB), 15);
}// if not DMRS Symbol }// if not DMRS Symbol
}// symbol loop }// symbol loop
......
...@@ -597,17 +597,15 @@ uint8_t nr_ue_pusch_common_procedures(PHY_VARS_NR_UE *UE, ...@@ -597,17 +597,15 @@ uint8_t nr_ue_pusch_common_procedures(PHY_VARS_NR_UE *UE,
int symb_offset = (slot%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot; int symb_offset = (slot%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot;
for(ap = 0; ap < n_antenna_ports; ap++) { for(ap = 0; ap < n_antenna_ports; ap++) {
for (int s=0;s<NR_NUMBER_OF_SYMBOLS_PER_SLOT;s++){ for (int s=0;s<NR_NUMBER_OF_SYMBOLS_PER_SLOT;s++){
c16_t rot=((c16_t*)frame_parms->symbol_rotation[1])[s + symb_offset];
LOG_D(PHY,"In %s: rotating txdataF symbol %d (%d) => (%d.%d)\n", LOG_D(PHY,"rotating txdataF symbol %d (%d) => (%d.%d)\n",
__FUNCTION__,
s, s,
s + symb_offset, s + symb_offset,
frame_parms->symbol_rotation[1][2 * (s + symb_offset)], rot.r, rot.i);
frame_parms->symbol_rotation[1][1 + (2 * (s + symb_offset))]);
rotate_cpx_vector((int16_t *)&txdataF[ap][frame_parms->ofdm_symbol_size * s], rotate_cpx_vector((c16_t *)&txdataF[ap][frame_parms->ofdm_symbol_size * s],
&frame_parms->symbol_rotation[1][2 * (s + symb_offset)], &rot,
(int16_t *)&txdataF[ap][frame_parms->ofdm_symbol_size * s], (c16_t *)&txdataF[ap][frame_parms->ofdm_symbol_size * s],
frame_parms->ofdm_symbol_size, frame_parms->ofdm_symbol_size,
15); 15);
} }
......
This diff is collapsed.
...@@ -37,6 +37,7 @@ extern "C" { ...@@ -37,6 +37,7 @@ extern "C" {
#include <stdint.h> #include <stdint.h>
#include <assert.h> #include <assert.h>
#include "PHY/sse_intrin.h" #include "PHY/sse_intrin.h"
#include "common/utils/assertions.h"
#define CEILIDIV(a,b) ((a+b-1)/b) #define CEILIDIV(a,b) ((a+b-1)/b)
#define ROUNDIDIV(a,b) (((a<<1)+b)/(b<<1)) #define ROUNDIDIV(a,b) (((a<<1)+b)/(b<<1))
...@@ -104,15 +105,6 @@ void multadd_complex_vector_real_scalar(int16_t *x, ...@@ -104,15 +105,6 @@ void multadd_complex_vector_real_scalar(int16_t *x,
uint8_t zero_flag, uint8_t zero_flag,
uint32_t N); uint32_t N);
int rotate_cpx_vector(int16_t *x,
int16_t *alpha,
int16_t *y,
uint32_t N,
uint16_t output_shift);
/*!\fn void init_fft(uint16_t size,uint8_t logsize,uint16_t *rev) /*!\fn void init_fft(uint16_t size,uint8_t logsize,uint16_t *rev)
\brief Initialize the FFT engine for a given size \brief Initialize the FFT engine for a given size
@param size Size of the FFT @param size Size of the FFT
...@@ -461,7 +453,7 @@ idft_size_idx_t get_idft(int ofdm_symbol_size) ...@@ -461,7 +453,7 @@ idft_size_idx_t get_idft(int ofdm_symbol_size)
} }
/*!\fn int32_t rotate_cpx_vector(int16_t *x,int16_t *alpha,int16_t *y,uint32_t N,uint16_t output_shift) /*!\fn int32_t rotate_cpx_vector(c16_t *x,c16_t *alpha,c16_t *y,uint32_t N,uint16_t output_shift)
This function performs componentwise multiplication of a vector with a complex scalar. This function performs componentwise multiplication of a vector with a complex scalar.
@param x Vector input (Q1.15) in the format |Re0 Im0|,......,|Re(N-1) Im(N-1)| @param x Vector input (Q1.15) in the format |Re0 Im0|,......,|Re(N-1) Im(N-1)|
@param alpha Scalar input (Q1.15) in the format |Re0 Im0| @param alpha Scalar input (Q1.15) in the format |Re0 Im0|
...@@ -471,9 +463,9 @@ This function performs componentwise multiplication of a vector with a complex s ...@@ -471,9 +463,9 @@ This function performs componentwise multiplication of a vector with a complex s
The function implemented is : \f$\mathbf{y} = \alpha\mathbf{x}\f$ The function implemented is : \f$\mathbf{y} = \alpha\mathbf{x}\f$
*/ */
int32_t rotate_cpx_vector(int16_t *x, void rotate_cpx_vector(c16_t *x,
int16_t *alpha, c16_t *alpha,
int16_t *y, c16_t *y,
uint32_t N, uint32_t N,
uint16_t output_shift); uint16_t output_shift);
......
...@@ -359,10 +359,10 @@ struct NR_DL_FRAME_PARMS { ...@@ -359,10 +359,10 @@ struct NR_DL_FRAME_PARMS {
lte_prefix_type_t Ncp; lte_prefix_type_t Ncp;
/// sequence which is computed based on carrier frequency and numerology to rotate/derotate each OFDM symbol according to Section 5.3 in 38.211 /// sequence which is computed based on carrier frequency and numerology to rotate/derotate each OFDM symbol according to Section 5.3 in 38.211
/// First dimension is for the direction of the link (0 DL, 1 UL) /// First dimension is for the direction of the link (0 DL, 1 UL)
int16_t symbol_rotation[2][224*2]; c16_t symbol_rotation[2][224];
/// sequence used to compensate the phase rotation due to timeshifted OFDM symbols /// sequence used to compensate the phase rotation due to timeshifted OFDM symbols
/// First dimenstion is for different CP lengths /// First dimenstion is for different CP lengths
int16_t timeshift_symbol_rotation[4096*2] __attribute__ ((aligned (16))); c16_t timeshift_symbol_rotation[4096*2] __attribute__ ((aligned (16)));
/// shift of pilot position in one RB /// shift of pilot position in one RB
uint8_t nushift; uint8_t nushift;
/// SRS configuration from TS 38.331 RRC /// SRS configuration from TS 38.331 RRC
......
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