First code simplification in UL channel estimation
This commit is contained in:
@@ -321,43 +321,27 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
|||||||
rxF = (int16_t *)&rxdataF[aarx][(soffset+symbol_offset+nushift+re_offset)];
|
rxF = (int16_t *)&rxdataF[aarx][(soffset+symbol_offset+nushift+re_offset)];
|
||||||
ul_ch+=8;
|
ul_ch+=8;
|
||||||
|
|
||||||
for (pilot_cnt=3; pilot_cnt<(6*nb_rb_pusch-3); pilot_cnt += 2) {
|
for (pilot_cnt=3; pilot_cnt<(6*nb_rb_pusch-3); pilot_cnt++) {
|
||||||
|
|
||||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||||
|
|
||||||
#ifdef DEBUG_PUSCH
|
#ifdef DEBUG_PUSCH
|
||||||
printf("pilot %u : rxF - > (%d,%d) (%d) ch -> (%d,%d) (%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],dBc(rxF[0],rxF[1]),ch[0],ch[1],dBc(ch[0],ch[1]),pil[0],pil[1]);
|
printf("pilot %4u: pil -> (%6d,%6d), rxF -> (%4d,%4d), ch -> (%4d,%4d)\n",
|
||||||
printf("data %u : rxF - > (%d,%d) (%d)\n",pilot_cnt,rxF[2],rxF[3],dBc(rxF[2],rxF[3]));
|
pilot_cnt, pil[0], pil[1], rxF[0], rxF[1], ch[0], ch[1]);
|
||||||
#endif
|
//printf("data %4u: rxF -> (%4d,%4d) (%2d)\n",pilot_cnt, rxF[2], rxF[3], dBc(rxF[2], rxF[3]));
|
||||||
multadd_real_vector_complex_scalar(fm,
|
#endif
|
||||||
ch,
|
|
||||||
ul_ch,
|
|
||||||
8);
|
|
||||||
pil += 2;
|
|
||||||
re_offset = (re_offset+2) % gNB->frame_parms.ofdm_symbol_size;
|
|
||||||
rxF = (int16_t *)&rxdataF[aarx][(soffset+symbol_offset+nushift+re_offset)];
|
|
||||||
//printf("ul_ch addr %p\n",ul_ch);
|
|
||||||
|
|
||||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
if (pilot_cnt%2 == 0) {
|
||||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
multadd_real_vector_complex_scalar(fmm, ch, ul_ch, 8);
|
||||||
|
ul_ch+=8;
|
||||||
#ifdef DEBUG_PUSCH
|
} else {
|
||||||
printf("pilot %u : rxF - > (%d,%d) (%d) ch -> (%d,%d) (%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],dBc(rxF[0],rxF[1]),ch[0],ch[1],dBc(ch[0],ch[1]),pil[0],pil[1]);
|
multadd_real_vector_complex_scalar(fm, ch, ul_ch, 8);
|
||||||
printf("data %u : rxF - > (%d,%d) (%d)\n",pilot_cnt+1,rxF[2],rxF[3],dBc(rxF[2],rxF[3]));
|
}
|
||||||
#endif
|
|
||||||
multadd_real_vector_complex_scalar(fmm,
|
|
||||||
ch,
|
|
||||||
ul_ch,
|
|
||||||
8);
|
|
||||||
|
|
||||||
//for (int i= 0; i<16; i++)
|
|
||||||
//printf("ul_ch addr %p %d\n", ul_ch+i, *(ul_ch+i));
|
|
||||||
|
|
||||||
pil += 2;
|
pil += 2;
|
||||||
re_offset = (re_offset+2) % gNB->frame_parms.ofdm_symbol_size;
|
re_offset = (re_offset+2) % gNB->frame_parms.ofdm_symbol_size;
|
||||||
rxF = (int16_t *)&rxdataF[aarx][soffset+(symbol_offset+nushift+re_offset)];
|
rxF = (int16_t *)&rxdataF[aarx][(soffset+symbol_offset+nushift+re_offset)];
|
||||||
ul_ch+=8;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Treat first 2 pilots specially (right edge)
|
// Treat first 2 pilots specially (right edge)
|
||||||
|
|||||||
Reference in New Issue
Block a user