Commit 29cc22bd authored by Bilel's avatar Bilel

[OAI-UE] bugfix issue#204: fix for pss/sss extraction during scan period

parent 4eae34a9
......@@ -1207,7 +1207,8 @@ int32_t rx_pdcch(LTE_UE_COMMON *lte_ue_common_vars,
*/
int pss_sss_extract(PHY_VARS_UE *phy_vars_ue,
int32_t pss_ext[4][72],
int32_t sss_ext[4][72]);
int32_t sss_ext[4][72],
uint8_t subframe);
/*! \brief Extract only PSS resource elements
@param phy_vars_ue Pointer to UE variables
......
......@@ -149,7 +149,8 @@ int pss_ch_est(PHY_VARS_UE *ue,
int _do_pss_sss_extract(PHY_VARS_UE *ue,
int32_t pss_ext[4][72],
int32_t sss_ext[4][72],
uint8_t doPss, uint8_t doSss) // add flag to indicate extracting only PSS, only SSS, or both
uint8_t doPss, uint8_t doSss,
uint8_t subframe) // add flag to indicate extracting only PSS, only SSS, or both
{
......@@ -163,32 +164,52 @@ int _do_pss_sss_extract(PHY_VARS_UE *ue,
int rx_offset = frame_parms->ofdm_symbol_size-3*12;
uint8_t pss_symb,sss_symb;
int32_t **rxdataF = ue->common_vars.common_vars_rx_data_per_thread[0].rxdataF;
if (frame_parms->frame_type == FDD) {
pss_symb = 6-frame_parms->Ncp;
sss_symb = pss_symb-1;
} else {
pss_symb = 2;
sss_symb = frame_parms->symbols_per_tti-1;
}
int32_t **rxdataF;
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
if (frame_parms->frame_type == FDD) {
pss_symb = 6-frame_parms->Ncp;
sss_symb = pss_symb-1;
rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe&0x1)].rxdataF;
pss_rxF = &rxdataF[aarx][(rx_offset + (pss_symb*(frame_parms->ofdm_symbol_size)))];
sss_rxF = &rxdataF[aarx][(rx_offset + (sss_symb*(frame_parms->ofdm_symbol_size)))];
} else {
pss_symb = 2;
sss_symb = frame_parms->symbols_per_tti-1;
rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe&0x1)].rxdataF;
sss_rxF = &rxdataF[aarx][(rx_offset + (sss_symb*(frame_parms->ofdm_symbol_size)))];
rxdataF = ue->common_vars.common_vars_rx_data_per_thread[((subframe+1)&0x1)].rxdataF;
pss_rxF = &rxdataF[aarx][(rx_offset + (pss_symb*(frame_parms->ofdm_symbol_size)))];
}
//printf("extract_rbs: symbol_mod=%d, rx_offset=%d, ch_offset=%d\n",symbol_mod,
// (rx_offset + (symbol*(frame_parms->ofdm_symbol_size)))*2,
// LTE_CE_OFFSET+ch_offset+(symbol_mod*(frame_parms->ofdm_symbol_size)));
pss_rxF = &rxdataF[aarx][(rx_offset + (pss_symb*(frame_parms->ofdm_symbol_size)))];
sss_rxF = &rxdataF[aarx][(rx_offset + (sss_symb*(frame_parms->ofdm_symbol_size)))];
pss_rxF_ext = &pss_ext[aarx][0];
sss_rxF_ext = &sss_ext[aarx][0];
for (rb=0; rb<nb_rb; rb++) {
// skip DC carrier
if (rb==3) {
sss_rxF = &rxdataF[aarx][(1 + (sss_symb*(frame_parms->ofdm_symbol_size)))];
pss_rxF = &rxdataF[aarx][(1 + (pss_symb*(frame_parms->ofdm_symbol_size)))];
if(frame_parms->frame_type == FDD)
{
sss_rxF = &rxdataF[aarx][(1 + (sss_symb*(frame_parms->ofdm_symbol_size)))];
pss_rxF = &rxdataF[aarx][(1 + (pss_symb*(frame_parms->ofdm_symbol_size)))];
}
else
{
rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe&0x1)].rxdataF;
sss_rxF = &rxdataF[aarx][(1 + (sss_symb*(frame_parms->ofdm_symbol_size)))];
rxdataF = ue->common_vars.common_vars_rx_data_per_thread[((subframe+1)&0x1)].rxdataF;
pss_rxF = &rxdataF[aarx][(1 + (pss_symb*(frame_parms->ofdm_symbol_size)))];
}
}
for (i=0; i<12; i++) {
......@@ -209,16 +230,17 @@ int _do_pss_sss_extract(PHY_VARS_UE *ue,
int pss_sss_extract(PHY_VARS_UE *phy_vars_ue,
int32_t pss_ext[4][72],
int32_t sss_ext[4][72])
int32_t sss_ext[4][72],
uint8_t subframe)
{
return _do_pss_sss_extract(phy_vars_ue, pss_ext, sss_ext, 1 /* doPss */, 1 /* doSss */);
return _do_pss_sss_extract(phy_vars_ue, pss_ext, sss_ext, 1 /* doPss */, 1 /* doSss */, subframe);
}
int pss_only_extract(PHY_VARS_UE *phy_vars_ue,
int32_t pss_ext[4][72])
{
static int32_t dummy[4][72];
return _do_pss_sss_extract(phy_vars_ue, pss_ext, dummy, 1 /* doPss */, 0 /* doSss */);
return _do_pss_sss_extract(phy_vars_ue, pss_ext, dummy, 1 /* doPss */, 0 /* doSss */, 0);
}
......@@ -226,7 +248,7 @@ int sss_only_extract(PHY_VARS_UE *phy_vars_ue,
int32_t sss_ext[4][72])
{
static int32_t dummy[4][72];
return _do_pss_sss_extract(phy_vars_ue, dummy, sss_ext, 0 /* doPss */, 1 /* doSss */);
return _do_pss_sss_extract(phy_vars_ue, dummy, sss_ext, 0 /* doPss */, 1 /* doSss */, 0);
}
......@@ -295,10 +317,10 @@ int rx_sss(PHY_VARS_UE *ue,int32_t *tot_metric,uint8_t *flip_max,uint8_t *phase_
0,
1);
}
// pss sss extract for subframe 0
pss_sss_extract(ue,
pss_ext,
sss0_ext);
sss0_ext,0);
/*
write_output("rxsig0.m","rxs0",&ue->common_vars.rxdata[0][0],ue->frame_parms.samples_per_tti,1,1);
write_output("rxdataF0.m","rxF0",&ue->common_vars.rxdataF[0][0],2*14*ue->frame_parms.ofdm_symbol_size,2,1);
......@@ -346,9 +368,10 @@ int rx_sss(PHY_VARS_UE *ue,int32_t *tot_metric,uint8_t *flip_max,uint8_t *phase_
1);
}
// pss sss extract for subframe 5
pss_sss_extract(ue,
pss_ext,
sss5_ext);
sss5_ext,5);
// write_output("sss5_ext0.m","sss5ext0",sss5_ext,72,1,1);
// get conjugated channel estimate from PSS (symbol 6), H* = R* \cdot PSS
......
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