Commit 65fb8a84 authored by Parminder Singh's avatar Parminder Singh

Fixed Channel compensation for dlsim for multiple DMRS

- fixed channel compensation by choosing most recent DMRS symbol ina
  slot
- Removed code to find nearest DMRS symbol for channle compensation
- Updated TBS calculation in DLSIM
- Added debug prints in PTRS CPE estimation for DMRS symbol
parent 1e9720ef
...@@ -213,6 +213,11 @@ uint8_t get_next_estimate_in_slot(uint16_t ptrsSymbPos,uint16_t dmrsSymbPos, u ...@@ -213,6 +213,11 @@ uint8_t get_next_estimate_in_slot(uint16_t ptrsSymbPos,uint16_t dmrsSymbPos, u
{ {
return nextPtrs; return nextPtrs;
} }
/* Special case when DMRS is next valid estimation */
if(nextPtrs == 0 && nextDmrs !=0)
{
return nextDmrs;
}
return (nextPtrs > nextDmrs)?nextDmrs:nextPtrs; return (nextPtrs > nextDmrs)?nextDmrs:nextPtrs;
} }
...@@ -366,6 +371,9 @@ int8_t nr_ptrs_process_slot(uint16_t dmrsSymbPos, ...@@ -366,6 +371,9 @@ int8_t nr_ptrs_process_slot(uint16_t dmrsSymbPos,
/* set DMRS estimation */ /* set DMRS estimation */
estPerSymb[symb*2]=(int16_t)((1<<15)-1); // 32767 estPerSymb[symb*2]=(int16_t)((1<<15)-1); // 32767
estPerSymb[(symb*2)+1]= 0; // no angle estPerSymb[(symb*2)+1]= 0; // no angle
#ifdef DEBUG_PTRS
printf("[PHY][PTRS]: DMRS Symbol %d :(%4d %4d)\n", symb, estPerSymb[symb*2],estPerSymb[(symb*2)+1]);
#endif
} }
/* Update left and right reference from an estimated symbol */ /* Update left and right reference from an estimated symbol */
if((is_ptrs_symbol(symb, ptrsSymbPos)) || (is_dmrs_symbol(symb,dmrsSymbPos))) if((is_ptrs_symbol(symb, ptrsSymbPos)) || (is_dmrs_symbol(symb,dmrsSymbPos)))
...@@ -387,7 +395,11 @@ int8_t nr_ptrs_process_slot(uint16_t dmrsSymbPos, ...@@ -387,7 +395,11 @@ int8_t nr_ptrs_process_slot(uint16_t dmrsSymbPos,
{ {
/* calculate slope from next valid estimates*/ /* calculate slope from next valid estimates*/
tmp = get_next_estimate_in_slot(ptrsSymbPos,dmrsSymbPos,rightRef+1,symbInSlot); tmp = get_next_estimate_in_slot(ptrsSymbPos,dmrsSymbPos,rightRef+1,symbInSlot);
/* Special case when DMRS is not followed by PTRS symbol then reuse old slope */
if(tmp!=0)
{
get_slope_from_estimates(rightRef, tmp, estPerSymb, slope_p); get_slope_from_estimates(rightRef, tmp, estPerSymb, slope_p);
}
ptrs_estimate_from_slope(estPerSymb,slope_p,leftRef, rightRef); ptrs_estimate_from_slope(estPerSymb,slope_p,leftRef, rightRef);
symb = rightRef -1; symb = rightRef -1;
} }
......
...@@ -120,6 +120,7 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB, ...@@ -120,6 +120,7 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB,
uint32_t ***pdsch_dmrs = gNB->nr_gold_pdsch_dmrs[slot]; uint32_t ***pdsch_dmrs = gNB->nr_gold_pdsch_dmrs[slot];
int32_t** txdataF = gNB->common_vars.txdataF; int32_t** txdataF = gNB->common_vars.txdataF;
int16_t amp = AMP; int16_t amp = AMP;
int xOverhead = 0;
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms; NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
time_stats_t *dlsch_encoding_stats=&gNB->dlsch_encoding_stats; time_stats_t *dlsch_encoding_stats=&gNB->dlsch_encoding_stats;
time_stats_t *dlsch_scrambling_stats=&gNB->dlsch_scrambling_stats; time_stats_t *dlsch_scrambling_stats=&gNB->dlsch_scrambling_stats;
...@@ -157,9 +158,7 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB, ...@@ -157,9 +158,7 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB,
uint16_t dmrs_symbol_map = rel15->dlDmrsSymbPos;//single DMRS: 010000100 Double DMRS 110001100 uint16_t dmrs_symbol_map = rel15->dlDmrsSymbPos;//single DMRS: 010000100 Double DMRS 110001100
uint8_t dmrs_len = get_num_dmrs(rel15->dlDmrsSymbPos); uint8_t dmrs_len = get_num_dmrs(rel15->dlDmrsSymbPos);
uint16_t nb_re = ((12*rel15->NrOfSymbols)-nb_re_dmrs*dmrs_len-xOverhead)*rel15->rbSize*rel15->NrOfCodewords;
uint16_t nb_re;
nb_re = ((12*rel15->NrOfSymbols)-nb_re_dmrs-dmrs_len)*rel15->rbSize*rel15->NrOfCodewords;
uint8_t Qm = rel15->qamModOrder[0]; uint8_t Qm = rel15->qamModOrder[0];
uint32_t encoded_length = nb_re*Qm; uint32_t encoded_length = nb_re*Qm;
int16_t mod_dmrs[n_dmrs<<1] __attribute__ ((aligned(16))); int16_t mod_dmrs[n_dmrs<<1] __attribute__ ((aligned(16)));
......
...@@ -1059,6 +1059,7 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue, ...@@ -1059,6 +1059,7 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
&phase_per_symbol[2* symbol], &phase_per_symbol[2* symbol],
&ptrs_re_symbol[symbol]); &ptrs_re_symbol[symbol]);
/* if very first symbol is PTRS then we need to undo conjugate done in estimation */ /* if very first symbol is PTRS then we need to undo conjugate done in estimation */
/* The PTRS estimation before DMRS symbol is pure error, shall be used as it is*/
if(symbol == *startSymbIndex) if(symbol == *startSymbIndex)
{ {
phase_per_symbol[(2* symbol)+1] = (-1) * phase_per_symbol[(2* symbol)+1]; phase_per_symbol[(2* symbol)+1] = (-1) * phase_per_symbol[(2* symbol)+1];
......
...@@ -275,7 +275,6 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue, ...@@ -275,7 +275,6 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
nb_re_dmrs = 4*harq_process->n_dmrs_cdm_groups; nb_re_dmrs = 4*harq_process->n_dmrs_cdm_groups;
} }
uint16_t dmrs_length = get_num_dmrs(harq_process->dlDmrsSymbPos); uint16_t dmrs_length = get_num_dmrs(harq_process->dlDmrsSymbPos);
AssertFatal(dmrs_length == 1 || dmrs_length == 2 || dmrs_length == 3 ,"Illegal dmrs_length %d\n",dmrs_length);
uint32_t i,j; uint32_t i,j;
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include "T.h" #include "T.h"
#include "openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h" #include "openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h"
#include "openair1/PHY/NR_TRANSPORT/nr_dlsch.h" #include "openair1/PHY/NR_TRANSPORT/nr_dlsch.h"
#include "PHY/NR_REFSIG/nr_refsig.h"
#ifndef USER_MODE #ifndef USER_MODE
#define NOCYGWIN_STATIC static #define NOCYGWIN_STATIC static
...@@ -2098,9 +2099,8 @@ unsigned short nr_dlsch_extract_rbs_single(int **rxdataF, ...@@ -2098,9 +2099,8 @@ unsigned short nr_dlsch_extract_rbs_single(int **rxdataF,
unsigned char i,aarx; //,nsymb,sss_symb,pss_symb=0,l; unsigned char i,aarx; //,nsymb,sss_symb,pss_symb=0,l;
int *dl_ch0,*dl_ch0_ext,*rxF,*rxF_ext; int *dl_ch0,*dl_ch0_ext,*rxF,*rxF_ext;
uint8_t ClosestDMRSIdx = 15; //closest DMRS index to the current OFDM symbol
uint8_t ClosestDMRSdist = 15; //temporarily save the distance to the closest DMRS symbol
int8_t DMRSdist = 15; //temporarily save the distance to the DMRS symbol int8_t DMRSdist = 15; //temporarily save the distance to the DMRS symbol
static uint8_t validDmrsEst = 0; //store last DMRS Symbol index
unsigned char j=0; unsigned char j=0;
...@@ -2111,21 +2111,15 @@ unsigned short nr_dlsch_extract_rbs_single(int **rxdataF, ...@@ -2111,21 +2111,15 @@ unsigned short nr_dlsch_extract_rbs_single(int **rxdataF,
k = frame_parms->first_carrier_offset + NR_NB_SC_PER_RB*start_rb; k = frame_parms->first_carrier_offset + NR_NB_SC_PER_RB*start_rb;
if (high_speed_flag == 1) { if(validDmrsEst == 0)
for (int i=0; i<16; i++) { //loop over all possible DMRS symbols {
if ( (1<<i & dlDmrsSymbPos) > 0 ) { validDmrsEst = get_next_dmrs_symbol_in_slot(dlDmrsSymbPos, symbol, DMRSdist);
DMRSdist = symbol-i;
DMRSdist = DMRSdist>=0 ? DMRSdist : -DMRSdist;
if ( DMRSdist < ClosestDMRSdist ) {
ClosestDMRSIdx = i;
ClosestDMRSdist = DMRSdist;
}
}
} }
dl_ch0 = &dl_ch_estimates[aarx][(ClosestDMRSIdx*(frame_parms->ofdm_symbol_size))]; //use closest DMRS if(is_dmrs_symbol(symbol,dlDmrsSymbPos ) == 1)
{
validDmrsEst = symbol;
} }
else dl_ch0 = &dl_ch_estimates[aarx][(validDmrsEst*(frame_parms->ofdm_symbol_size))]; //use closest DMRS
dl_ch0 = &dl_ch_estimates[aarx][0];
dl_ch0_ext = &dl_ch_estimates_ext[aarx][symbol*(nb_rb_pdsch*12)]; dl_ch0_ext = &dl_ch_estimates_ext[aarx][symbol*(nb_rb_pdsch*12)];
......
...@@ -981,7 +981,7 @@ int main(int argc, char **argv) ...@@ -981,7 +981,7 @@ int main(int argc, char **argv)
int16_t *UE_llr = pdsch_vars[0]->llr[0]; int16_t *UE_llr = pdsch_vars[0]->llr[0];
TBS = UE_harq_process->TBS;//rel15->TBSize[0]; TBS = UE_harq_process->TBS;//rel15->TBSize[0];
uint16_t length_dmrs = 1; uint16_t length_dmrs = get_num_dmrs(rel15->dlDmrsSymbPos);
uint16_t nb_rb = rel15->rbSize; uint16_t nb_rb = rel15->rbSize;
uint8_t nb_re_dmrs = rel15->dmrsConfigType == NFAPI_NR_DMRS_TYPE1 ? 6 : 4; uint8_t nb_re_dmrs = rel15->dmrsConfigType == NFAPI_NR_DMRS_TYPE1 ? 6 : 4;
uint8_t mod_order = rel15->qamModOrder[0]; uint8_t mod_order = rel15->qamModOrder[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