Commit 52a142d0 authored by Francesco Mani's avatar Francesco Mani
Browse files

bugfix in pbch correlation

parent 14ae2b54
......@@ -36,6 +36,7 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
uint8_t eNB_offset,
unsigned char Ns,
unsigned char symbol,
int dmrss,
NR_UE_SSB *current_ssb)
{
int pilot[200] __attribute__((aligned(16)));
......@@ -44,7 +45,7 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
unsigned int pilot_cnt;
int16_t ch[2],*pil,*rxF;
int symbol_offset;
int dmrss;
uint8_t nushift;
uint8_t ssb_index=current_ssb->i_ssb;
......@@ -56,13 +57,9 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
unsigned int ssb_offset = ue->frame_parms.first_carrier_offset + ue->frame_parms.ssb_start_subcarrier;
if (ssb_offset>= ue->frame_parms.ofdm_symbol_size) ssb_offset-=ue->frame_parms.ofdm_symbol_size;
if (ue->is_synchronized ==0 ) dmrss = symbol-1;
else dmrss = symbol-5;
AssertFatal((symbol > 0 && symbol < 4 && ue->is_synchronized == 0) ||
(symbol > 4 && symbol < 8 && ue->is_synchronized == 1),
"symbol %d is illegal for PBCH DM-RS (is_synchronized %d)\n",
symbol,ue->is_synchronized);
AssertFatal(dmrss >= 0 && dmrss < 3,
"symbol %d is illegal for PBCH DM-RS \n",
dmrss);
symbol_offset = ue->frame_parms.ofdm_symbol_size*symbol;
......
......@@ -54,6 +54,7 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue,
uint8_t eNB_offset,
unsigned char Ns,
unsigned char symbol,
int dmrss,
NR_UE_SSB *current_ssb);
int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
......
......@@ -130,7 +130,7 @@ int nr_pbch_detection(PHY_VARS_NR_UE *ue, int pbch_initial_symbol, runmode_t mod
#endif
// computing correlation between received DMRS symbols and transmitted sequence for current i_ssb and n_hf
for(int i=pbch_initial_symbol; i<pbch_initial_symbol+3;i++)
nr_pbch_dmrs_correlation(ue,0,0,i,current_ssb);
nr_pbch_dmrs_correlation(ue,0,0,i,i-pbch_initial_symbol,current_ssb);
#if UE_TIMING_TRACE
stop_meas(&ue->dlsch_channel_estimation_stats);
#endif
......
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