Commit ca9b4d7e authored by Sakthivel Velumani's avatar Sakthivel Velumani

Improved channel estimates around DC

Ignored 1 pilot before and after DC
parent 615f2787
......@@ -123,6 +123,24 @@ short filt8_m0[8] = {
short filt8_mm0[8]= {
0,0,0,8192,16384,8192,0,0};
short filt8_dcma[8]= {
16384,12288,8192,4096,4096,0,0,0};
short filt8_dcmb[8]= {
0,4096,8192,4096,4096,0,0,0};
short filt8_dcmc[8]= {
0,0,0,4096,4096,8192,4096,0};
short filt8_dcmd[8]= {
0,0,0,4096,4096,8192,12288,16384};
short filt8_dcl[8]= {
0,8192,16384,12288,8192,4096,0,0};
short filt8_dcr[8]= {
0,0,0,4096,8192,12288,16384,0};
short filt8_l1[8] = {
24576,16384,0,0,0,0,0,0};
......@@ -136,4 +154,4 @@ short filt8_m1[8] = {
0,0,8192,16384,8192,0,0,0};
short filt8_mm1[8]= {
0,0,0,0,8192,16384,8192,0};
\ No newline at end of file
0,0,0,0,8192,16384,8192,0};
......@@ -91,6 +91,18 @@ extern short filt8_m0[8];
extern short filt8_mm0[8];
extern short filt8_dcma[8];
extern short filt8_dcmb[8];
extern short filt8_dcmc[8];
extern short filt8_dcmd[8];
extern short filt8_dcl[8];
extern short filt8_dcr[8];
extern short filt8_l1[8];
extern short filt8_ml1[8];
......@@ -101,4 +113,4 @@ extern short filt8_m1[8];
extern short filt8_mm1[8];
#endif
\ No newline at end of file
#endif
......@@ -884,7 +884,72 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
dl_ch,
8);
//}
// check if PRB crosses DC and improve estimates around DC
if ((bwp_start_subcarrier >= ue->frame_parms.ofdm_symbol_size/2) && (bwp_start_subcarrier+nb_rb_pdsch*12 >= ue->frame_parms.ofdm_symbol_size)) {
dl_ch = (int16_t *)&dl_ch_estimates[aarx][ch_offset];
uint16_t idxDC = 2*(ue->frame_parms.ofdm_symbol_size - bwp_start_subcarrier);
uint16_t idxPil = idxDC/2;
printf("idxDC %d idxPil %d\n",idxDC,idxPil);
re_offset = k;
pil = (int16_t *)&pilot[rb_offset*((config_type==0) ? 6:4)];
pil += (idxPil-4);
dl_ch += (idxDC-8);
dl_ch = memset(dl_ch, 0, sizeof(int16_t)*16);
re_offset = (re_offset+idxDC/2-4)&(ue->frame_parms.ofdm_symbol_size-1);
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
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);
multadd_real_vector_complex_scalar(filt8_dcma,
ch,
dl_ch,
8);
pil += 2;
re_offset = (re_offset+2)&(ue->frame_parms.ofdm_symbol_size-1);
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
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);
multadd_real_vector_complex_scalar(filt8_dcmb,
ch,
dl_ch,
8);
pil += 4;
re_offset = (re_offset+4)&(ue->frame_parms.ofdm_symbol_size-1);
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
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);
multadd_real_vector_complex_scalar(filt8_dcmc,
ch,
dl_ch,
8);
pil += 2;
re_offset = (re_offset+2)&(ue->frame_parms.ofdm_symbol_size-1);
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
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);
multadd_real_vector_complex_scalar(filt8_dcmd,
ch,
dl_ch,
8);
}
//#ifdef DEBUG_PDSCH
dl_ch = (int16_t *)&dl_ch_estimates[aarx][ch_offset];
for(uint16_t idxP=0; idxP<(nb_rb_pdsch*12/8); idxP++) {
for(uint8_t idxI=0; idxI<16; idxI+=2) {
printf("%d\t%d\t",dl_ch[idxP*16+idxI],dl_ch[idxP*16+idxI+1]);
}
printf("\n");
}
//#endif
}
return(0);
......
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