Commit a4d43c24 authored by Roberto Louro Magueta's avatar Roberto Louro Magueta

Update the ad_shift, considering the previous improvement

parent 451449e1
......@@ -1925,7 +1925,13 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB,
int off = ((rel15_ul->rb_size&1) == 1)? 4:0;
uint32_t rxdataF_ext_offset = 0;
uint8_t shift_ch_ext = rel15_ul->nrOfLayers > 1 ? log2_approx(max_ch >> 11) : 0;
uint8_t ad_shift = 1 + log2_approx(frame_parms->nb_antennas_rx >> 2) + (rel15_ul->nrOfLayers == 2);
int ad_shift = 0;
if (rel15_ul->nrOfLayers == 1) {
ad_shift = 1 + log2_approx(frame_parms->nb_antennas_rx >> 2);
} else {
ad_shift = -3; // For 2-layers, we are already doing a bit shift in the nr_ulsch_zero_forcing_rx_2layers() function, so we can use more bits
}
for(uint8_t symbol = rel15_ul->start_symbol_index; symbol < (rel15_ul->start_symbol_index + rel15_ul->nr_of_symbols); symbol++) {
uint8_t dmrs_symbol_flag = (rel15_ul->ul_dmrs_symb_pos >> symbol) & 0x01;
......@@ -1994,7 +2000,10 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB,
for (aarx=0;aarx<frame_parms->nb_antennas_rx;aarx++)
avgs = cmax(avgs,avg[aatx*frame_parms->nb_antennas_rx+aarx]);
gNB->pusch_vars[ulsch_id]->log2_maxh = (log2_approx(avgs) / 2) + ad_shift;
gNB->pusch_vars[ulsch_id]->log2_maxh = (log2_approx(avgs) >> 1) + ad_shift;
if (gNB->pusch_vars[ulsch_id]->log2_maxh < 0) {
gNB->pusch_vars[ulsch_id]->log2_maxh = 0;
}
gNB->pusch_vars[ulsch_id]->cl_done = 1;
}
......
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