Commit d388be80 authored by Roberto Louro Magueta's avatar Roberto Louro Magueta Committed by luis_pereira87

Compute log2_maxh for UL channel estimation using nb_antennas_rx

parent 6b83d9e0
......@@ -397,11 +397,11 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
for (c16_t *end=ul_ch+12; ul_ch<end; ul_ch++)
*ul_ch=ch;
#else
c16multaddVectRealComplex(filt8_avlip0, ch, ul_ch, 8);
c16multaddVectRealComplex(filt8_avlip0, &ch, ul_ch, 8);
ul_ch += 8;
c16multaddVectRealComplex(filt8_avlip1, ch, ul_ch, 8);
c16multaddVectRealComplex(filt8_avlip1, &ch, ul_ch, 8);
ul_ch += 8;
c16multaddVectRealComplex(filt8_avlip2, ch, ul_ch, 8);
c16multaddVectRealComplex(filt8_avlip2, &ch, ul_ch, 8);
ul_ch -= 12;
#endif
......@@ -416,13 +416,11 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
ul_ch[3].i += (ch.i * 1365)>>15; // 1/12*16384
ul_ch += 4;
multadd_real_vector_complex_scalar(filt8_avlip3, ch, ul_ch, 8);
c16multaddVectRealComplex(filt8_avlip3, &ch, ul_ch, 8);
ul_ch += 8;
multadd_real_vector_complex_scalar(filt8_avlip4, ch, ul_ch, 8);
c16multaddVectRealComplex(filt8_avlip4, &ch, ul_ch, 8);
ul_ch += 8;
multadd_real_vector_complex_scalar(filt8_avlip5, ch, ul_ch, 8);
c16multaddVectRealComplex(filt8_avlip5, &ch, ul_ch, 8);
ul_ch -= 8;
#endif
}
......@@ -437,16 +435,9 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
ul_ch[3].i += (ch.i * 1365)>>15; // 1/12*16384
ul_ch += 4;
c16multaddVectRealComplex(filt8_avlip3,
ch,
ul_ch,
8);
c16multaddVectRealComplex(filt8_avlip3, &ch, ul_ch, 8);
ul_ch += 8;
c16multaddVectRealComplex(filt8_avlip6,
ch,
ul_ch,
8);
c16multaddVectRealComplex(filt8_avlip6, &ch, ul_ch, 8);
#endif
} else { // this is case without frequency-domain linear interpolation, just take average of LS channel estimates of 4 DMRS REs and use a common value for the whole PRB
LOG_D(PHY,"PUSCH estimation DMRS type 2, no Freq-domain interpolation");
......@@ -514,7 +505,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
for (c16_t *end=ul_ch+12; ul_ch<end; ul_ch++)
*ul_ch=ch;
#else
ul_ch[3]=c16maddShift(ch,(c16_t) {1365,1365},15); // 1365 = 1/12*16384 (full range is +/- 32768)
ul_ch[3] = c16maddShift(ch, (c16_t){1365, 1365}, (c16_t){0, 0}, 15); // 1365 = 1/12*16384 (full range is +/- 32768)
ul_ch += 4;
c16multaddVectRealComplex(filt8_avlip3, &ch, ul_ch, 8);
ul_ch += 8;
......@@ -547,7 +538,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
for (c16_t *end=ul_ch+12; ul_ch<end; ul_ch++)
*ul_ch=ch;
#else
ul_ch[3]=c16maddShift(ch, c16_t {1365,1365},15);// 1365 = 1/12*16384 (full range is +/- 32768)
ul_ch[3] = c16maddShift(ch, (c16_t){1365, 1365}, (c16_t){0, 0}, 15); // 1365 = 1/12*16384 (full range is +/- 32768)
ul_ch += 4;
c16multaddVectRealComplex(filt8_avlip3, &ch, ul_ch, 8);
ul_ch += 8;
......
......@@ -1954,6 +1954,7 @@ 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 ad_shift = 1 + log2_approx(frame_parms->nb_antennas_rx >> 2);
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;
......@@ -2021,7 +2022,7 @@ 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)+2;
gNB->pusch_vars[ulsch_id]->log2_maxh = (log2_approx(avgs) / 2) + ad_shift;
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