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 24d0295a44..624f4afa83 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c @@ -27,6 +27,7 @@ #include "PHY/NR_REFSIG/nr_refsig.h" #include "PHY/NR_REFSIG/dmrs_nr.h" #include "PHY/NR_REFSIG/ptrs_nr.h" +#include "PHY/NR_REFSIG/nr_mod_table.h" #include "PHY/NR_TRANSPORT/nr_sch_dmrs.h" #include "PHY/NR_TRANSPORT/nr_transport_proto.h" #include "common/utils/nr/nr_common.h" @@ -39,7 +40,26 @@ //#define DEBUG_PBCH //#define DEBUG_PRS_CHEST // To enable PRS Matlab dumps //#define DEBUG_PRS_PRINTS // To enable PRS channel estimation debug logs -extern short nr_qpsk_mod_table[8]; + +#define CH_INTERP 0 +#define NO_INTERP 1 + +/* Generic function to find the peak of channel estimation buffer */ +void peak_estimator(int32_t *buffer, int32_t buf_len, int32_t *peak_idx, int32_t *peak_val) +{ + int32_t max_val = 0, max_idx = 0, abs_val = 0; + for(int k = 0; k < buf_len; k++) + { + abs_val = squaredMod(((c16_t*)buffer)[k]); + if(abs_val > max_val) + { + max_val = abs_val; + max_idx = k; + } + } + *peak_val = max_val; + *peak_idx = max_idx; +} int nr_prs_channel_estimation(uint8_t gNB_id, uint8_t rsc_id, @@ -545,29 +565,6 @@ int nr_prs_channel_estimation(uint8_t gNB_id, return(0); } -#define CH_INTERP 0 -#define NO_INTERP 1 - -/* Generic function to find the peak of channel estimation buffer */ -void peak_estimator(int32_t *buffer, int32_t buf_len, int32_t *peak_idx, int32_t *peak_val) -{ - int32_t max_val = 0, max_idx = 0, abs_val = 0; - for(int k = 0; k < buf_len; k++) - { - abs_val = squaredMod(((c16_t*)buffer)[k]); - if(abs_val > max_val) - { - max_val = abs_val; - max_idx = k; - } - } - *peak_val = max_val; - *peak_idx = max_idx; -} - -#define CH_INTERP 0 -#define NO_INTERP 1 - int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t gNB_id,