From 7f074bcc223d499c8d19fa503dc82f0bb048c7a4 Mon Sep 17 00:00:00 2001 From: Bo Zhao Date: Mon, 15 Nov 2021 10:41:44 +0100 Subject: [PATCH] Implement PDCCH channel estimation averaging over PRB (no interpolation) --- openair1/PHY/NR_UE_ESTIMATION/filt16a_32.c | 4 +- .../nr_dl_channel_estimation.c | 39 ++++++++++++++++++- 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/openair1/PHY/NR_UE_ESTIMATION/filt16a_32.c b/openair1/PHY/NR_UE_ESTIMATION/filt16a_32.c index 0c520aabe7..c4add88b7f 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/filt16a_32.c +++ b/openair1/PHY/NR_UE_ESTIMATION/filt16a_32.c @@ -93,7 +93,7 @@ short filt16a_m3_dc[16] = { -9831,-6554,-3277,0,3276,6553,9830,16384,12288,8192,4096,0,0,0,0,0}; short filt16a_1[16] = { -16384,16384,16384,16384,16384,16384,16384,16384,16384,16384,16384,16384}; +16384,16384,16384,16384,16384,16384,16384,16384,16384,16384,16384,16384,0,0,0,0}; short filt16a_2l0[16] = { 16384,12288,8192,4096,-4096,0,0,0,0,0,0,0,0,0,0,0}; @@ -282,4 +282,4 @@ short filt16_middle4[16] = { 4096,8192,8192,8192,8192,8192,8192,8192,4096,0,0,0,0,0,0,0}; short filt16_end[16] = { - 4096,8192,8192,8192,12288,16384,16384,16384,0,0,0,0,0,0,0,0}; \ No newline at end of file + 4096,8192,8192,8192,12288,16384,16384,16384,0,0,0,0,0,0,0,0}; diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c index 30836ded01..b1e2acea05 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c @@ -33,7 +33,7 @@ //#define DEBUG_PDSCH //#define DEBUG_PDCCH - +#define CH_INTERP 0 int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, @@ -520,6 +520,7 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue, printf("dl_ch addr %p\n",dl_ch); #endif + #if CH_INTERP // if ((ue->frame_parms.N_RB_DL&1)==0) { // Treat first 2 pilots specially (left edge) ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); @@ -648,6 +649,42 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue, rxF += 8; k += 4; } + #else //ELSE CH_INTERP + int ch_sum[2]; + + for ( pilot_cnt=0; pilot_cnt<(3*nb_rb_coreset); pilot_cnt += 3 ) { + if (k >= ue->frame_parms.ofdm_symbol_size){ + k-=ue->frame_parms.ofdm_symbol_size; + rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+1)]; + } +#ifdef DEBUG_PDCCH + printf("pilot[%d] = (%d, %d)\trxF[%d] = (%d, %d)\n", pilot_cnt+0, pil[0], pil[1], k+1, rxF[0], rxF[1]); +#endif + ch_sum[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); + ch_sum[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); + pil += 2; + rxF += 8; +#ifdef DEBUG_PDCCH + printf("pilot[%d] = (%d, %d)\trxF[%d] = (%d, %d)\n", pilot_cnt+1, pil[0], pil[1], k+5, rxF[0], rxF[1]); +#endif + ch_sum[0] += (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); + ch_sum[1] += (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); + pil += 2; + rxF += 8; +#ifdef DEBUG_PDCCH + printf("pilot[%d] = (%d, %d)\trxF[%d] = (%d, %d)\n", pilot_cnt+2, pil[0], pil[1], k+9, rxF[0], rxF[1]); +#endif + ch_sum[0] += (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); + ch_sum[1] += (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); + pil += 2; + rxF += 8; + ch[0] = ch_sum[0]/3; + ch[1] = ch_sum[1]/3; + multadd_real_vector_complex_scalar(filt16a_1, ch, dl_ch, 16); + dl_ch += 24; + k += 12; + } + #endif //END CH_INTERP //}