From 255a5acbfa0f2e38f21750f3d65bed9d2bed5683 Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Sat, 14 Aug 2021 09:05:49 +0530 Subject: [PATCH] Made FD interpolation by default PRB based averaging can activated from command line options --- executables/nr-gnb.c | 2 +- executables/nr-uesoftmodem.c | 4 ++-- executables/nr-uesoftmodem.h | 2 +- executables/softmodem-common.h | 8 ++++---- openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c | 4 ++-- openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c | 4 ++-- openair1/PHY/defs_gNB.h | 2 +- openair1/PHY/defs_nr_UE.h | 6 +++--- openair1/SIMULATION/NR_PHY/dlsim.c | 6 +++--- openair1/SIMULATION/NR_PHY/ulsim.c | 6 +++--- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index 64146f19c1..ae7909769d 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -536,7 +536,7 @@ void init_gNB(int single_thread_flag,int wait_for_sync) { gNB->UL_INFO.cqi_ind.cqi_raw_pdu_list = gNB->cqi_raw_pdu_list;*/ gNB->prach_energy_counter = 0; - gNB->fd_interpolation = get_softmodem_params()->fd_interpolation; + gNB->prb_interpolation = get_softmodem_params()->prb_interpolation; } diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index 082ab21fdc..1c3def6a91 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -321,8 +321,8 @@ void set_options(int CC_id, PHY_VARS_NR_UE *UE){ UE->rf_map.chain = CC_id + chain_offset; - LOG_I(PHY,"Set UE mode %d, UE_fo_compensation %d, UE_scan_carrier %d, UE_no_timing_correction %d \n, fd_lin_interpolation %d", - UE->mode, UE->UE_fo_compensation, UE->UE_scan_carrier, UE->no_timing_correction, UE->fd_lin_interpolation); + LOG_I(PHY,"Set UE mode %d, UE_fo_compensation %d, UE_scan_carrier %d, UE_no_timing_correction %d \n, do_prb_interpolation %d\n", + UE->mode, UE->UE_fo_compensation, UE->UE_scan_carrier, UE->no_timing_correction, UE->prb_interpolation); // Set FP variables diff --git a/executables/nr-uesoftmodem.h b/executables/nr-uesoftmodem.h index 311630abab..3eba5731b0 100644 --- a/executables/nr-uesoftmodem.h +++ b/executables/nr-uesoftmodem.h @@ -62,7 +62,7 @@ {"E" , CONFIG_HLP_TQFS, PARAMFLAG_BOOL, u8ptr:&(fp->threequarter_fs), defintval:0, TYPE_UINT8, 0}, \ {"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \ {"ue-timing-correction-disable", CONFIG_HLP_DISABLETIMECORR, PARAMFLAG_BOOL, iptr:&(UE->no_timing_correction), defintval:0, TYPE_INT, 0}, \ - {"do-fd-interpolation", CONFIG_HLP_FDINTER, PARAMFLAG_BOOL, iptr:&(UE->fd_lin_interpolation), defintval:0, TYPE_INT, 0}, \ + {"do-prb-interpolation", CONFIG_HLP_PRBINTER, PARAMFLAG_BOOL, iptr:&(UE->prb_interpolation), defintval:0, TYPE_INT, 0}, \ } diff --git a/executables/softmodem-common.h b/executables/softmodem-common.h index 6e49e1554f..76904f2368 100644 --- a/executables/softmodem-common.h +++ b/executables/softmodem-common.h @@ -72,7 +72,7 @@ extern "C" #define CONFIG_HLP_DLMCS "Set the maximum downlink MCS\n" #define CONFIG_HLP_STMON "Enable processing timing measurement of lte softmodem on per subframe basis \n" #define CONFIG_HLP_256QAM "Use the 256 QAM mcs table for PDSCH\n" -#define CONFIG_HLP_FDINTER "Do frequency domain linear interpolation for channel estimates. By default, average of estimates over 1 PRB is used\n" +#define CONFIG_HLP_PRBINTER "Do PRB based averaging of channel estimates. Frequency domain linear interpolation by default\n" #define CONFIG_HLP_NONSTOP "Go back to frame sync mode after 100 consecutive PBCH failures\n" //#define CONFIG_HLP_NUMUES "Set the number of UEs for the emulation" @@ -120,7 +120,7 @@ extern "C" #define SEND_DMRSSYNC softmodem_params.send_dmrs_sync #define USIM_TEST softmodem_params.usim_test #define USE_256QAM_TABLE softmodem_params.use_256qam_table -#define FD_INTERPOLATION softmodem_params.fd_interpolation +#define PRB_INTERPOLATION softmodem_params.prb_interpolation #define NFAPI softmodem_params.nfapi #define NON_STOP softmodem_params.non_stop @@ -155,7 +155,7 @@ extern int usrp_tx_thread; {"nokrnmod", CONFIG_HLP_NOKRNMOD, PARAMFLAG_BOOL, uptr:&nokrnmod, defintval:0, TYPE_INT, 0}, \ {"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, uptr:&nonbiot, defuintval:0, TYPE_INT, 0}, \ {"use-256qam-table", CONFIG_HLP_256QAM, PARAMFLAG_BOOL, iptr:&USE_256QAM_TABLE, defintval:0, TYPE_INT, 0}, \ - {"do-fd-interpolation", CONFIG_HLP_FDINTER, PARAMFLAG_BOOL, iptr:&FD_INTERPOLATION, defintval:0, TYPE_INT, 0}, \ + {"do-prb-interpolation", CONFIG_HLP_PRBINTER, PARAMFLAG_BOOL, iptr:&PRB_INTERPOLATION, defintval:0, TYPE_INT, 0}, \ {"usrp-tx-thread-config", CONFIG_HLP_USRP_THREAD, 0, iptr:&usrp_tx_thread, defstrval:0, TYPE_INT, 0}, \ {"nfapi", CONFIG_HLP_NFAPI, 0, u8ptr:&nfapi_mode, defintval:0, TYPE_UINT8, 0}, \ {"non-stop", CONFIG_HLP_NONSTOP, PARAMFLAG_BOOL, iptr:&NON_STOP, defintval:0, TYPE_INT, 0}, \ @@ -249,7 +249,7 @@ typedef struct { int hw_timing_advance; uint32_t send_dmrs_sync; int use_256qam_table; - int fd_interpolation; + int prb_interpolation; uint8_t nfapi; int non_stop; } softmodem_params_t; diff --git a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c index 573060426e..39b80da068 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c +++ b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c @@ -187,7 +187,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, #endif //if ((gNB->frame_parms.N_RB_UL&1)==0) { - if (pusch_pdu->dmrs_config_type == pusch_dmrs_type1 && gNB->fd_interpolation == 1){ + if (pusch_pdu->dmrs_config_type == pusch_dmrs_type1 && gNB->prb_interpolation == 0){ LOG_D(PHY,"PUSCH estimation DMRS type 1, Freq-domain interpolation"); // Treat first 2 pilots specially (left edge) ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); @@ -432,7 +432,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, } #endif } - else if (pusch_pdu->dmrs_config_type == pusch_dmrs_type2 && gNB->fd_interpolation == 1) { //pusch_dmrs_type2 |p_r,p_l,d,d,d,d,p_r,p_l,d,d,d,d| + else if (pusch_pdu->dmrs_config_type == pusch_dmrs_type2 && gNB->prb_interpolation == 0) { //pusch_dmrs_type2 |p_r,p_l,d,d,d,d,p_r,p_l,d,d,d,d| LOG_D(PHY,"PUSCH estimation DMRS type 2, Freq-domain interpolation"); // Treat first DMRS specially (left edge) 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 1d6a960716..8097b9b3ea 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c @@ -785,7 +785,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, printf("rxF addr %p p %d\n", rxF,p); printf("dl_ch addr %p nushift %d\n",dl_ch,nushift); #endif - if (config_type == NFAPI_NR_DMRS_TYPE1 && ue->fd_lin_interpolation == 1) { + if (config_type == NFAPI_NR_DMRS_TYPE1 && ue->prb_interpolation == 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); @@ -962,7 +962,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, 8); } } - } else if (config_type == NFAPI_NR_DMRS_TYPE2 && ue->fd_lin_interpolation == 1){ //pdsch_dmrs_type2 |dmrs_r,dmrs_l,0,0,0,0,dmrs_r,dmrs_l,0,0,0,0| + } else if (config_type == NFAPI_NR_DMRS_TYPE2 && ue->prb_interpolation == 0){ //pdsch_dmrs_type2 |dmrs_r,dmrs_l,0,0,0,0,dmrs_r,dmrs_l,0,0,0,0| // Treat first 4 pilots specially (left edge) ch_l[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index a722dbe723..778724218f 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -840,7 +840,7 @@ typedef struct PHY_VARS_gNB_s { int **dl_precoder_SgNB[3]; char log2_maxp; /// holds the maximum channel/precoder coefficient - int fd_interpolation; + int prb_interpolation; /// if ==0 enables phy only test mode int mac_enabled; diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index 4d62ca7aed..c4a771294a 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -861,9 +861,9 @@ typedef struct { uint32_t perfect_ce; - // flag to activate linear interpolation in frequency-domain channel estimation - // when off (default), this just averages channel on per-PRB basis - int fd_lin_interpolation; + // flag to activate PRB based averaging of channel estimates + // when off, defaults to frequency domain interpolation + int prb_interpolation; int16_t ch_est_alpha; int generate_ul_signal[NUMBER_OF_CONNECTED_gNB_MAX]; diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index f5b8d39278..7a3e5aeccb 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -477,7 +477,7 @@ int main(int argc, char **argv) break; case 'i': - fd_inter=1; + prb_inter=1; break; case 'n': @@ -638,7 +638,7 @@ int main(int argc, char **argv) printf("-g [A,B,C,D,E,F,G,R] Use 3GPP SCM (A,B,C,D) or 36-101 (E-EPA,F-EVA,G-ETU) models or R for MIMO model (ignores delay spread and Ricean factor)\n"); printf("-y Number of TX antennas used in gNB\n"); printf("-z Number of RX antennas used in UE\n"); - printf("-i Activate freq domain interpolation for channel estimation. Average over 1 PRB by default.\n"); + printf("-i Activate PRB based averaging for channel estimation. Frequncy domain interpolation by default.\n"); //printf("-j Relative strength of second intefering gNB (in dB) - cell_id mod 3 = 2\n"); printf("-R N_RB_DL\n"); printf("-O oversampling factor (1,2,4,8,16)\n"); @@ -905,7 +905,7 @@ int main(int argc, char **argv) UE->if_inst->phy_config_request = nr_ue_phy_config_request; UE->if_inst->dl_indication = nr_ue_dl_indication; UE->if_inst->ul_indication = dummy_nr_ue_ul_indication; - UE->fd_lin_interpolation = fd_inter; + UE->prb_interpolation = prb_inter; UE_mac->if_module = nr_ue_if_module_init(0); diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 8c5ca677c5..c57b5f56e6 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -425,7 +425,7 @@ int main(int argc, char **argv) break; case 'i': - fd_inter=1; + prb_inter=1; break; case 'k': @@ -587,7 +587,7 @@ int main(int argc, char **argv) printf("-f Number of frames to simulate\n"); printf("-g [A,B,C,D,E,F,G] Use 3GPP SCM (A,B,C,D) or 36-101 (E-EPA,F-EVA,G-ETU) models (ignores delay spread and Ricean factor)\n"); printf("-h This message\n"); - printf("-i Activate freq domain interpolation for channel estimation. Average over 1 PRB by default.\n"); + printf("-i Activate PRB based averaging for channel estimation. Frequncy domain interpolation by default.\n"); //printf("-j Relative strength of second intefering eNB (in dB) - cell_id mod 3 = 2\n"); printf("-s Starting SNR, runs from SNR0 to SNR0 + 10 dB if ending SNR isn't given\n"); printf("-m MCS value\n"); @@ -675,7 +675,7 @@ int main(int argc, char **argv) gNB->UL_INFO.crc_ind.crc_list = (nfapi_nr_crc_t *)malloc(NB_UE_INST*sizeof(nfapi_nr_crc_t)); gNB->UL_INFO.rx_ind.number_of_pdus = 0; gNB->UL_INFO.crc_ind.number_crcs = 0; - gNB->fd_interpolation = fd_inter; + gNB->prb_interpolation = prb_inter; frame_parms = &gNB->frame_parms; //to be initialized I suppose (maybe not necessary for PBCH)