From 910c1860f049459c58f1426845ca18053ea9f2c6 Mon Sep 17 00:00:00 2001 From: Parminder Singh Date: Fri, 6 Nov 2020 13:48:43 +0100 Subject: [PATCH] DMRS estimation default value is moved outside slot processing - in PTRS processing the default value for DMRS is set outside slot processing. --- .../NR_ESTIMATION/nr_ul_channel_estimation.c | 15 ++++++- openair1/PHY/NR_REFSIG/ptrs_nr.c | 10 ----- .../nr_dl_channel_estimation.c | 41 ++++++++++++------- 3 files changed, 41 insertions(+), 25 deletions(-) diff --git a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c index 34a2d43c61..1a93099f93 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c +++ b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c @@ -563,8 +563,21 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB, phase_per_symbol = (int16_t*)gNB->pusch_vars[ulsch_id]->ptrs_phase_per_slot[aarx]; ptrs_re_symbol = &gNB->pusch_vars[ulsch_id]->ptrs_re_per_slot; *ptrs_re_symbol = 0; - phase_per_symbol[2*symbol] = 0; // Real phase_per_symbol[(2*symbol)+1] = 0; // Imag + /* set DMRS estimates to 0 angle with magnitude 1 */ + if(is_dmrs_symbol(symbol,*dmrsSymbPos)) + { + /* set DMRS real estimation to 32767 */ + phase_per_symbol[2*symbol]=(int16_t)((1<<15)-1); // 32767 +#ifdef DEBUG_UL_PTRS + printf("[PHY][PTRS]: DMRS Symbol %d -> %4d + j*%4d\n", symbol, phase_per_symbol[2*symbol],phase_per_symbol[(2*symbol)+1]); +#endif + } + else// real ptrs value is set to 0 + { + phase_per_symbol[2*symbol] = 0; // Real + } + if(symbol == *startSymbIndex) { *ptrsSymbPos = 0; diff --git a/openair1/PHY/NR_REFSIG/ptrs_nr.c b/openair1/PHY/NR_REFSIG/ptrs_nr.c index a06799b221..7259013255 100644 --- a/openair1/PHY/NR_REFSIG/ptrs_nr.c +++ b/openair1/PHY/NR_REFSIG/ptrs_nr.c @@ -365,16 +365,6 @@ int8_t nr_ptrs_process_slot(uint16_t dmrsSymbPos, int8_t tmp = 0; for(uint8_t symb = startSymbIdx; symb status == ACTIVE) - { - symbInSlot = dlsch0_harq->start_symbol + dlsch0_harq->nb_symbols; - startSymbIndex = &dlsch0_harq->start_symbol; - nbSymb = &dlsch0_harq->nb_symbols; - L_ptrs = &dlsch0_harq->PTRSTimeDensity; - K_ptrs = &dlsch0_harq->PTRSFreqDensity; - dmrsSymbPos = &dlsch0_harq->dlDmrsSymbPos; - ptrsSymbPos = &dlsch0_harq->ptrs_symbols; - ptrsSymbIdx = &dlsch0_harq->ptrs_symbol_index; - ptrsReOffset = &dlsch0_harq->PTRSReOffset; - dmrsConfigType = &dlsch0_harq->ptrs_symbol_index; - nb_rb = &dlsch0_harq->nb_rb; - } + { + symbInSlot = dlsch0_harq->start_symbol + dlsch0_harq->nb_symbols; + startSymbIndex = &dlsch0_harq->start_symbol; + nbSymb = &dlsch0_harq->nb_symbols; + L_ptrs = &dlsch0_harq->PTRSTimeDensity; + K_ptrs = &dlsch0_harq->PTRSFreqDensity; + dmrsSymbPos = &dlsch0_harq->dlDmrsSymbPos; + ptrsSymbPos = &dlsch0_harq->ptrs_symbols; + ptrsSymbIdx = &dlsch0_harq->ptrs_symbol_index; + ptrsReOffset = &dlsch0_harq->PTRSReOffset; + dmrsConfigType = &dlsch0_harq->ptrs_symbol_index; + nb_rb = &dlsch0_harq->nb_rb; + } if(dlsch1_harq) { symbInSlot = dlsch1_harq->start_symbol + dlsch0_harq->nb_symbols; @@ -1028,8 +1028,21 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue, phase_per_symbol = (int16_t*)pdsch_vars[eNB_id]->ptrs_phase_per_slot[aarx]; ptrs_re_symbol = (int32_t*)pdsch_vars[eNB_id]->ptrs_re_per_slot[aarx]; ptrs_re_symbol[symbol] = 0; - phase_per_symbol[2*symbol] = 0; // Real phase_per_symbol[(2*symbol)+1] = 0; // Imag + /* set DMRS estimates to 0 angle with magnitude 1 */ + if(is_dmrs_symbol(symbol,*dmrsSymbPos)) + { + /* set DMRS real estimation to 32767 */ + phase_per_symbol[2*symbol]=(int16_t)((1<<15)-1); // 32767 +#ifdef DEBUG_DL_PTRS + printf("[PHY][PTRS]: DMRS Symbol %d -> %4d + j*%4d\n", symbol, phase_per_symbol[2*symbol],phase_per_symbol[(2*symbol)+1]); +#endif + } + else// real ptrs value is set to 0 + { + phase_per_symbol[2*symbol] = 0; // Real + } + if(dlsch0_harq->status == ACTIVE) { if(symbol == *startSymbIndex)