Commit 99e02e93 authored by Matthieu Kanj's avatar Matthieu Kanj

msg5 decoding

parent 89007e0f
......@@ -206,7 +206,7 @@ void phy_config_sib2_eNB_NB_IoT(uint8_t Mod_id,
NB_IoT_DL_FRAME_PARMS *fp = &PHY_vars_eNB_NB_IoT_g[Mod_id][CC_id]->frame_parms_NB_IoT;
PHY_VARS_eNB *eNB = &PHY_vars_eNB_g[0][0];
// PHY_VARS_eNB *eNB = &PHY_vars_eNB_g[0][0];
LOG_I(PHY,"[eNB%d] CCid %d: Applying config_NB_IoT from sib2_NB\n",Mod_id,CC_id);
......@@ -235,13 +235,13 @@ void phy_config_sib2_eNB_NB_IoT(uint8_t Mod_id,
LOG_D(PHY,"config#0: numRepetitionsPerPreambleAttempt= %d\n",fp->nprach_config_common.nprach_ParametersList.list[0].numRepetitionsPerPreambleAttempt);
//////////////////////////////////////////////////////////////////////////
eNB->nprach_config_common.nprach_CP_Length = config->nprach_config_0_cp_length.value;
/* eNB->nprach_config_common.nprach_CP_Length = config->nprach_config_0_cp_length.value;
eNB->nprach_config_common.nprach_ParametersList.list[0].nprach_Periodicity = config->nprach_config_0_sf_periodicity.value;
eNB->nprach_config_common.nprach_ParametersList.list[0].nprach_StartTime = config->nprach_config_0_start_time.value;
eNB->nprach_config_common.nprach_ParametersList.list[0].nprach_SubcarrierOffset = config->nprach_config_0_subcarrier_offset.value;
eNB->nprach_config_common.nprach_ParametersList.list[0].nprach_NumSubcarriers = config->nprach_config_0_number_of_subcarriers.value;
eNB->nprach_config_common.nprach_ParametersList.list[0].numRepetitionsPerPreambleAttempt = config->nprach_config_0_number_of_repetitions_per_attempt.value;
*/
//////////////////////////////////////////////////////////////////////////
//missed configuration in FAPI config_request (TS 36.331 pag 610) (may not needed)
/*fp->nprach_config_common.nprach_ParametersList.list.array[0]->nprach_SubcarrierMSG3_RangeStart = extra_phy_parms->nprach_config_0_subcarrier_MSG3_range_start;
......@@ -273,13 +273,13 @@ void phy_config_sib2_eNB_NB_IoT(uint8_t Mod_id,
LOG_D(PHY,"config#1: numRepetitionsPerPreambleAttempt= %d\n",fp->nprach_config_common.nprach_ParametersList.list[1].numRepetitionsPerPreambleAttempt);
///////////////////////////////////////////////////////////////////////////////////////
eNB->nprach_config_common.nprach_CP_Length = config->nprach_config_1_cp_length.value;
/* eNB->nprach_config_common.nprach_CP_Length = config->nprach_config_1_cp_length.value;
eNB->nprach_config_common.nprach_ParametersList.list[1].nprach_Periodicity = config->nprach_config_1_sf_periodicity.value;
eNB->nprach_config_common.nprach_ParametersList.list[1].nprach_StartTime = config->nprach_config_1_start_time.value;
eNB->nprach_config_common.nprach_ParametersList.list[1].nprach_SubcarrierOffset = config->nprach_config_1_subcarrier_offset.value;
eNB->nprach_config_common.nprach_ParametersList.list[1].nprach_NumSubcarriers = config->nprach_config_1_number_of_subcarriers.value;
eNB->nprach_config_common.nprach_ParametersList.list[1].numRepetitionsPerPreambleAttempt = config->nprach_config_1_number_of_repetitions_per_attempt.value;
*/
//////////////////////////////////////////////////////////////////////////////////////
//missed configuration in FAPI config_request (TS 36.331 pag 610) (may not needed)
/*fp->nprach_config_common.nprach_ParametersList.list.array[1]->nprach_SubcarrierMSG3_RangeStart = extra_phy_parms->nprach_config_1_subcarrier_MSG3_range_start;
......@@ -310,14 +310,14 @@ void phy_config_sib2_eNB_NB_IoT(uint8_t Mod_id,
LOG_D(PHY,"config#2: numRepetitionsPerPreambleAttempt= %d\n",fp->nprach_config_common.nprach_ParametersList.list[2].numRepetitionsPerPreambleAttempt);
//////////////////////////////////////////////////////////////////////////////////////
/*
eNB->nprach_config_common.nprach_CP_Length = config->nprach_config_2_cp_length.value;
eNB->nprach_config_common.nprach_ParametersList.list[2].nprach_Periodicity = config->nprach_config_2_sf_periodicity.value;
eNB->nprach_config_common.nprach_ParametersList.list[2].nprach_StartTime = config->nprach_config_2_start_time.value;
eNB->nprach_config_common.nprach_ParametersList.list[2].nprach_SubcarrierOffset = config->nprach_config_2_subcarrier_offset.value;
eNB->nprach_config_common.nprach_ParametersList.list[2].nprach_NumSubcarriers = config->nprach_config_2_number_of_subcarriers.value;
eNB->nprach_config_common.nprach_ParametersList.list[2].numRepetitionsPerPreambleAttempt = config->nprach_config_2_number_of_repetitions_per_attempt.value;
*/
//////////////////////////////////////////////////////////////////////////////////////
//missed configuration in FAPI config_request (TS 36.331 pag 610) (may not needed)
/*fp->nprach_config_common.nprach_ParametersList.list.array[2]->nprach_SubcarrierMSG3_RangeStart = extra_phy_parms->nprach_config_2_subcarrier_MSG3_range_start;
......
......@@ -177,6 +177,9 @@ void rotate_channel_sc_tmp_NB_IoT(int16_t *estimated_channel,
int16_t est_channel_re, est_channel_im, est_channel_re2, est_channel_im2;
int16_t *e_phi_re,*e_phi_im;
int32_t sign_pm[2] = {1,-1};
int8_t ind_sign_pm; // index for above table
switch(ul_sc_start) /// only for single tone and 15 KHz spacing ? // missing the other configs
{
case 0:
......@@ -230,6 +233,7 @@ void rotate_channel_sc_tmp_NB_IoT(int16_t *estimated_channel,
}
//ul_sc_start = get_UL_sc_start_NB_IoT(I_sc); // NB-IoT: get the used subcarrier in RB
ind_sign_pm = ((14*(N_SF_per_word-counter_msg3) + l)/14)%2;
for (k=0;k<12;k++)
{
......@@ -252,10 +256,11 @@ void rotate_channel_sc_tmp_NB_IoT(int16_t *estimated_channel,
}
if(flag==0) // rotation of msg3
{
estimated_channel[k<<1] = (int16_t)(((int32_t)e_phi_re[14*(N_SF_per_word-counter_msg3) + l] * (int32_t)est_channel_re2 +
(int32_t)e_phi_im[14*(N_SF_per_word-counter_msg3) + l] * (int32_t)est_channel_im2)>>15);
estimated_channel[(k<<1)+1] = (int16_t)(((int32_t)e_phi_re[14*(N_SF_per_word-counter_msg3) + l] * (int32_t)est_channel_im2 -
(int32_t)e_phi_im[14*(N_SF_per_word-counter_msg3) + l] * (int32_t)est_channel_re2)>>15);
estimated_channel[k<<1] = (int16_t)(((int32_t)e_phi_re[(14*(N_SF_per_word-counter_msg3) + l)%14] * sign_pm[ind_sign_pm] * (int32_t)est_channel_re2 +
(int32_t)e_phi_im[(14*(N_SF_per_word-counter_msg3) + l)%14] * sign_pm[ind_sign_pm] * (int32_t)est_channel_im2)>>15);
estimated_channel[(k<<1)+1] = (int16_t)(((int32_t)e_phi_re[(14*(N_SF_per_word-counter_msg3) + l)%14] * sign_pm[ind_sign_pm] * (int32_t)est_channel_im2 -
(int32_t)e_phi_im[(14*(N_SF_per_word-counter_msg3) + l)%14] * sign_pm[ind_sign_pm] * (int32_t)est_channel_re2)>>15);
}
if(flag==1) // rotation of msg5
{
......
......@@ -1061,7 +1061,9 @@ void rotate_single_carrier_NB_IoT(PHY_VARS_eNB *eNB,
int16_t *e_phi_re,*e_phi_im;
int16_t *rxdataF_comp16;
int16_t rxdataF_comp16_re, rxdataF_comp16_im,rxdataF_comp16_re_2,rxdataF_comp16_im_2;
int32_t sign_pm[2] = {1,-1};
int8_t ind_sign_pm; // index for above table
switch(ul_sc_start)
{
......@@ -1114,7 +1116,7 @@ void rotate_single_carrier_NB_IoT(PHY_VARS_eNB *eNB,
e_phi_im = e_phi_im_p5;
break;
}
ind_sign_pm = ((14*(N_SF_per_word-counter_msg3) + symbol)/14)%2;
//ul_sc_start = get_UL_sc_start_NB_IoT(I_sc); // NB-IoT: get the used subcarrier in RB
rxdataF_comp16 = (int16_t *)&rxdataF_comp[0][symbol*frame_parms->N_RB_DL*12 + ul_sc_start];
rxdataF_comp16_re = rxdataF_comp16[0];
......@@ -1137,10 +1139,11 @@ void rotate_single_carrier_NB_IoT(PHY_VARS_eNB *eNB,
if(option==0) // rotation for msg3 (NPUSCH format 1)
{
rxdataF_comp16[0] = (int16_t)(((int32_t)e_phi_re[14*(N_SF_per_word-counter_msg3) + symbol] * (int32_t)rxdataF_comp16_re_2 +
(int32_t)e_phi_im[14*(N_SF_per_word-counter_msg3) + symbol] * (int32_t)rxdataF_comp16_im_2)>>15);
rxdataF_comp16[1] = (int16_t)(((int32_t)e_phi_re[14*(N_SF_per_word-counter_msg3) + symbol] * (int32_t)rxdataF_comp16_im_2 -
(int32_t)e_phi_im[14*(N_SF_per_word-counter_msg3) + symbol] * (int32_t)rxdataF_comp16_re_2)>>15);
rxdataF_comp16[0] = (int16_t)(((int32_t)e_phi_re[(14*(N_SF_per_word-counter_msg3) + symbol)%14] * sign_pm[ind_sign_pm] * (int32_t)rxdataF_comp16_re_2 +
(int32_t)e_phi_im[(14*(N_SF_per_word-counter_msg3) + symbol)%14] * sign_pm[ind_sign_pm] * (int32_t)rxdataF_comp16_im_2)>>15);
rxdataF_comp16[1] = (int16_t)(((int32_t)e_phi_re[(14*(N_SF_per_word-counter_msg3) + symbol)%14] * sign_pm[ind_sign_pm] * (int32_t)rxdataF_comp16_im_2 -
(int32_t)e_phi_im[(14*(N_SF_per_word-counter_msg3) + symbol)%14] * sign_pm[ind_sign_pm] * (int32_t)rxdataF_comp16_re_2)>>15);
}
if(option==1) // rotation for msg5 (NPUSCH format 1)
{
......@@ -1865,6 +1868,12 @@ uint8_t rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB,
NB_IoT_eNB_NULSCH_t *ulsch_NB_IoT = eNB->ulsch_NB_IoT[0];
NB_IoT_UL_eNB_HARQ_t *ulsch_harq = ulsch_NB_IoT->harq_process;
if( (7 < ((rx_frame*10 + rx_subframe)%160)) && ( ((rx_frame*10 + rx_subframe)%160) < (8+6)) )
{
return 0;
} else {
if (ulsch_NB_IoT->Msg3_active == 1)
{
......@@ -1977,6 +1986,6 @@ uint8_t rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB,
} else {
return 0; // create void function for NPUSCH ?
}
}
}
\ No newline at end of file
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