Commit 8814974e authored by Matthieu Kanj's avatar Matthieu Kanj

replacing params in NPUSCH

parent 6d554b24
...@@ -163,14 +163,14 @@ int ul_chest_tmp_f2_NB_IoT(int32_t **rxdataF_ext, ...@@ -163,14 +163,14 @@ int ul_chest_tmp_f2_NB_IoT(int32_t **rxdataF_ext,
uint8_t flag, uint8_t flag,
uint8_t subframerx, uint8_t subframerx,
uint8_t Qm, uint8_t Qm,
uint32_t I_sc, uint16_t ul_sc_start,
LTE_DL_FRAME_PARMS *frame_parms) LTE_DL_FRAME_PARMS *frame_parms)
{ {
// NB-IoT: 36.211, Section 5.5.2.2.1, Table 5.5.2.2.1-2 // NB-IoT: 36.211, Section 5.5.2.2.1, Table 5.5.2.2.1-2
int16_t bar_w_re[9] = {32767, 32767, 32767, 32767, -16384, -16384, 32767, -16384, -16384}; int16_t bar_w_re[9] = {32767, 32767, 32767, 32767, -16384, -16384, 32767, -16384, -16384};
int16_t bar_w_im[9] = { 0, 0, 0, 0, 28377, -28377, 0, -28377, 28377}; int16_t bar_w_im[9] = { 0, 0, 0, 0, 28377, -28377, 0, -28377, 28377};
int pilot_pos_format2_15k[6] = {2,3,4,9,10,11}; // holds for npusch format 2, and 15 kHz subcarrier bandwidth int pilot_pos_format2_15k[6] = {2,3,4,9,10,11}; // holds for npusch format 2, and 15 kHz subcarrier bandwidth
uint16_t ul_sc_start; // subcarrier start index into UL RB //uint16_t ul_sc_start; // subcarrier start index into UL RB
//uint8_t Qm = 1; // needed to rotate the estimated channel //uint8_t Qm = 1; // needed to rotate the estimated channel
uint32_t u; //for group hopping uint32_t u; //for group hopping
//uint32_t I_sc = 0; //uint32_t I_sc = 0;
...@@ -189,7 +189,7 @@ int ul_chest_tmp_f2_NB_IoT(int32_t **rxdataF_ext, ...@@ -189,7 +189,7 @@ int ul_chest_tmp_f2_NB_IoT(int32_t **rxdataF_ext,
pilot_pos_format2 = pilot_pos_format2_15k; // In futur version, this could be adapted for 3.75 kHz pilot_pos_format2 = pilot_pos_format2_15k; // In futur version, this could be adapted for 3.75 kHz
u = frame_parms->Nid_cell%16; u = frame_parms->Nid_cell%16;
ul_sc_start = get_UL_sc_start_NB_IoT(I_sc); // NB-IoT: get the used subcarrier in RB //ul_sc_start = get_UL_sc_start_NB_IoT(I_sc); // NB-IoT: get the used subcarrier in RB
symbol = l + 7*(Ns&1); symbol = l + 7*(Ns&1);
if (l == pilot_pos_format2[0] || l == pilot_pos_format2[1] || l == pilot_pos_format2[2]) if (l == pilot_pos_format2[0] || l == pilot_pos_format2[1] || l == pilot_pos_format2[2])
...@@ -283,12 +283,12 @@ int ul_chest_tmp_NB_IoT(int32_t **rxdataF_ext, ...@@ -283,12 +283,12 @@ int ul_chest_tmp_NB_IoT(int32_t **rxdataF_ext,
uint8_t counter_msg3, /// should be replaced by the number of the received part of UL data uint8_t counter_msg3, /// should be replaced by the number of the received part of UL data
uint8_t pilot_pos1, uint8_t pilot_pos1,
uint8_t pilot_pos2, uint8_t pilot_pos2,
uint32_t I_sc, uint16_t ul_sc_start,
uint8_t Qm, uint8_t Qm,
LTE_DL_FRAME_PARMS *frame_parms) LTE_DL_FRAME_PARMS *frame_parms)
{ {
//int pilot_pos1 = 3, pilot_pos2 = 10; // holds for npusch format 1, and 15 kHz subcarrier bandwidth //int pilot_pos1 = 3, pilot_pos2 = 10; // holds for npusch format 1, and 15 kHz subcarrier bandwidth
uint16_t ul_sc_start; // subcarrier start index into UL RB //uint16_t ul_sc_start; // subcarrier start index into UL RB
//uint8_t Qm = 2; // needed to rotate the estimated channel //uint8_t Qm = 2; // needed to rotate the estimated channel
uint32_t u; //for group hopping uint32_t u; //for group hopping
int symbol_offset; int symbol_offset;
...@@ -302,7 +302,7 @@ int ul_chest_tmp_NB_IoT(int32_t **rxdataF_ext, ...@@ -302,7 +302,7 @@ int ul_chest_tmp_NB_IoT(int32_t **rxdataF_ext,
int16_t *ul_ch1, *ul_ch2; int16_t *ul_ch1, *ul_ch2;
u= frame_parms->Nid_cell % 16; //Ncell_ID%16; u= frame_parms->Nid_cell % 16; //Ncell_ID%16;
ul_sc_start = get_UL_sc_start_NB_IoT(I_sc); // NB-IoT: get the used subcarrier in RB // I_sc = 11 for testing //ul_sc_start = get_UL_sc_start_NB_IoT(I_sc); // NB-IoT: get the used subcarrier in RB // I_sc = 11 for testing
symbol = l + 7*(Ns&1); symbol = l + 7*(Ns&1);
if (l == pilot_pos1) if (l == pilot_pos1)
......
...@@ -220,6 +220,8 @@ int generate_NDLSCH_NB_IoT(NB_IoT_eNB_NDLSCH_t *RAR, ...@@ -220,6 +220,8 @@ int generate_NDLSCH_NB_IoT(NB_IoT_eNB_NDLSCH_t *RAR,
{ {
uint8_t *RAR_pdu = RAR->harq_process->pdu; uint8_t *RAR_pdu = RAR->harq_process->pdu;
// TODO: process the RAR PDU to get the subcarrier indication for NPUSCH , Then set value in NPUSCH // TODO: process the RAR PDU to get the subcarrier indication for NPUSCH , Then set value in NPUSCH
// to be added at the end of NPDSCH process
// make different between RAR data and NPDSCH data // add a flag in NPDSCH to switch between RA and normal data transmission
uint32_t rep = RAR->repetition_number; uint32_t rep = RAR->repetition_number;
uint8_t eutra_control_region = 3; uint8_t eutra_control_region = 3;
......
...@@ -405,7 +405,7 @@ void filtering_signal(int16_t *input_buffer, int16_t *filtered_buffer, uint32_t ...@@ -405,7 +405,7 @@ void filtering_signal(int16_t *input_buffer, int16_t *filtered_buffer, uint32_t
} }
uint32_t process_nprach_NB_IoT(PHY_VARS_eNB *eNB, int frame, uint8_t subframe, uint32_t *rnti, uint16_t *preamble_index, uint16_t *timing_advance){ uint32_t process_nprach_NB_IoT(PHY_VARS_eNB *eNB, int frame, uint8_t subframe, uint16_t *rnti, uint16_t *preamble_index, uint16_t *timing_advance){
//uint32_t estimated_TA_coarse=0; //uint32_t estimated_TA_coarse=0;
......
...@@ -357,15 +357,14 @@ uint8_t rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB, ...@@ -357,15 +357,14 @@ uint8_t rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB,
eNB_rxtx_proc_t *proc, eNB_rxtx_proc_t *proc,
uint8_t eNB_id, // this is the effective sector id uint8_t eNB_id, // this is the effective sector id
uint8_t UE_id, uint8_t UE_id,
NB_IoT_eNB_NULSCH_t **ulsch, // NB_IoT_eNB_NULSCH_t **ulsch,
uint8_t npusch_format, // 1, 2 //uint8_t npusch_format, // 1, 2
uint16_t UL_RB_ID_NB_IoT, // 22 , to be included in // to be replaced by NB_IoT_start ?? uint16_t UL_RB_ID_NB_IoT, // 22 , to be included in // to be replaced by NB_IoT_start ??
uint8_t subcarrier_spacing, // 0 (3.75 KHz) or 1 (15 KHz) // uint8_t subcarrier_spacing, // 0 (3.75 KHz) or 1 (15 KHz)
uint32_t rnti_tmp, //= 65522
uint8_t scrambling_subframe_msg3, uint8_t scrambling_subframe_msg3,
uint32_t scrambling_frame_msg3, uint32_t scrambling_frame_msg3,
uint16_t nb_slot, // total number of occupied slots uint16_t nb_slot, // total number of occupied slots
uint16_t I_sc, //uint16_t I_sc,
uint16_t Nsc_RU, uint16_t Nsc_RU,
uint16_t Mcs, uint16_t Mcs,
unsigned int A, unsigned int A,
...@@ -375,11 +374,9 @@ uint8_t rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB, ...@@ -375,11 +374,9 @@ uint8_t rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB,
uint8_t msg3_flag); uint8_t msg3_flag);
void ulsch_extract_rbs_single_NB_IoT(int32_t **rxdataF, void ulsch_extract_rbs_single_NB_IoT(int32_t **rxdataF,
int32_t **rxdataF_ext, int32_t **rxdataF_ext,
// uint32_t first_rb,
uint16_t UL_RB_ID_NB_IoT, // index of UL NB_IoT resource block !!! may be defined twice : in frame_parms and in NB_IoT_UL_eNB_HARQ_t uint16_t UL_RB_ID_NB_IoT, // index of UL NB_IoT resource block !!! may be defined twice : in frame_parms and in NB_IoT_UL_eNB_HARQ_t
uint8_t N_sc_RU, // number of subcarriers in UL uint8_t N_sc_RU, // number of subcarriers in UL
uint8_t subframe,// uint32_t I_sc, // NB_IoT: subcarrier indication field: must be defined in higher layer
uint8_t l, uint8_t l,
uint8_t Ns, uint8_t Ns,
LTE_DL_FRAME_PARMS *frame_parms); LTE_DL_FRAME_PARMS *frame_parms);
...@@ -405,7 +402,7 @@ void lte_idft_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *z, uint16_t Msc_P ...@@ -405,7 +402,7 @@ void lte_idft_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *z, uint16_t Msc_P
void extract_CQI_NB_IoT(void *o,UCI_format_NB_IoT_t uci_format,NB_IoT_eNB_UE_stats *stats,uint8_t N_RB_DL, uint16_t * crnti, uint8_t * access_mode); void extract_CQI_NB_IoT(void *o,UCI_format_NB_IoT_t uci_format,NB_IoT_eNB_UE_stats *stats,uint8_t N_RB_DL, uint16_t * crnti, uint8_t * access_mode);
//*****************Vincent part for nprach ******************// //*****************Vincent part for nprach ******************//
uint32_t process_nprach_NB_IoT(PHY_VARS_eNB *eNB, int frame, uint8_t subframe,uint32_t *rnti, uint16_t *preamble_index, uint16_t *timing_advance); uint32_t process_nprach_NB_IoT(PHY_VARS_eNB *eNB, int frame, uint8_t subframe,uint16_t *rnti, uint16_t *preamble_index, uint16_t *timing_advance);
uint32_t TA_estimation_NB_IoT(PHY_VARS_eNB *eNB, uint32_t TA_estimation_NB_IoT(PHY_VARS_eNB *eNB,
int16_t *Rx_sub_sampled_buffer, int16_t *Rx_sub_sampled_buffer,
...@@ -453,7 +450,7 @@ void rotate_single_carrier_NB_IoT(PHY_VARS_eNB *eNB, ...@@ -453,7 +450,7 @@ void rotate_single_carrier_NB_IoT(PHY_VARS_eNB *eNB,
uint8_t UE_id, uint8_t UE_id,
uint8_t symbol, uint8_t symbol,
uint8_t counter_msg3, uint8_t counter_msg3,
uint32_t I_sc, uint16_t ul_sc_start,
uint8_t Qm, uint8_t Qm,
uint8_t option); uint8_t option);
...@@ -550,7 +547,7 @@ int ul_chest_tmp_NB_IoT(int32_t **rxdataF_ext, ...@@ -550,7 +547,7 @@ int ul_chest_tmp_NB_IoT(int32_t **rxdataF_ext,
uint8_t counter_msg3, uint8_t counter_msg3,
uint8_t pilot_pos1, uint8_t pilot_pos1,
uint8_t pilot_pos2, uint8_t pilot_pos2,
uint32_t I_sc, uint16_t ul_sc_start,
uint8_t Qm, uint8_t Qm,
LTE_DL_FRAME_PARMS *frame_parms); LTE_DL_FRAME_PARMS *frame_parms);
...@@ -563,7 +560,7 @@ int ul_chest_tmp_f2_NB_IoT(int32_t **rxdataF_ext, ...@@ -563,7 +560,7 @@ int ul_chest_tmp_f2_NB_IoT(int32_t **rxdataF_ext,
uint8_t flag, uint8_t flag,
uint8_t subframerx, uint8_t subframerx,
uint8_t Qm, uint8_t Qm,
uint32_t I_sc, uint16_t ul_sc_start,
LTE_DL_FRAME_PARMS *frame_parms); LTE_DL_FRAME_PARMS *frame_parms);
void rotate_channel_sc_tmp_NB_IoT(int16_t *estimated_channel, void rotate_channel_sc_tmp_NB_IoT(int16_t *estimated_channel,
......
...@@ -1247,14 +1247,14 @@ void phy_procedures_eNB_TX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB, ...@@ -1247,14 +1247,14 @@ void phy_procedures_eNB_TX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,
* (in stand alone i can put whatever the number)in other case consider the PRB index in the Table R&Shwartz pag 9 * (in stand alone i can put whatever the number)in other case consider the PRB index in the Table R&Shwartz pag 9
* *
*/ */
/*
generate_npbch(eNB->npbch, generate_npbch(eNB->npbch,
txdataF, txdataF,
AMP, AMP,
fp, fp,
eNB->npbch->pdu, eNB->npbch->pdu,
frame%64, frame%64,
fp->NB_IoT_RB_ID); fp->NB_IoT_RB_ID);*/
} }
...@@ -1542,12 +1542,6 @@ uint32_t rx_nprach_NB_IoT(PHY_VARS_eNB *eNB, int frame, uint8_t subframe, uint16 ...@@ -1542,12 +1542,6 @@ uint32_t rx_nprach_NB_IoT(PHY_VARS_eNB *eNB, int frame, uint8_t subframe, uint16
//int frame,frame_mod; // subframe, //int frame,frame_mod; // subframe,
// subframe = eNB->proc.subframe_prach; // subframe = eNB->proc.subframe_prach;
// frame = eNB->proc.frame_prach; // frame = eNB->proc.frame_prach;
//printf("frame = %i \n sf = %i\n",frame,subframe);
// frame_mod = 0;//(frame)%32;
//if (subframe==1 && frame_mod==0 && frame!=0){
//if (frame_mod==0 && frame!=0){
//printf("\n frame_in = %i\n",frame);
estimated_TA = process_nprach_NB_IoT(eNB,frame,subframe,rnti,preamble_index,timing_advance); estimated_TA = process_nprach_NB_IoT(eNB,frame,subframe,rnti,preamble_index,timing_advance);
//printf("estim = %i\n",estimated_TA); //printf("estim = %i\n",estimated_TA);
// } // }
...@@ -1598,10 +1592,6 @@ void npusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -1598,10 +1592,6 @@ void npusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
{ {
//ulsch_NB_IoT = eNB->ulsch_NB_IoT[i]; //ulsch_NB_IoT = eNB->ulsch_NB_IoT[i];
//ulsch_harq = ulsch_NB_IoT->harq_process; //ulsch_harq = ulsch_NB_IoT->harq_process;
nulsch->Msg3_active = 1;
nulsch->Msg3_flag = 1;
// if eNB is ready to receive UL data // if eNB is ready to receive UL data
// define a flag to trigger on or off the decoding process // define a flag to trigger on or off the decoding process
//if ((ulsch) && (ulsch->rnti>0) && (ulsch_harq->status == ACTIVE) && (ulsch_harq->frame == frame) && (ulsch_harq->subframe == subframe) && (ulsch_harq->handled == 0)) //if ((ulsch) && (ulsch->rnti>0) && (ulsch_harq->status == ACTIVE) && (ulsch_harq->frame == frame) && (ulsch_harq->subframe == subframe) && (ulsch_harq->handled == 0))
...@@ -1624,15 +1614,14 @@ void npusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -1624,15 +1614,14 @@ void npusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
proc, proc,
0, // this is the effective sector id 0, // this is the effective sector id
0, 0,
nulsch, // nulsch,
nulsch->npusch_format, //npusch_format, // 1, 2 // nulsch->npusch_format, //npusch_format, // 1, 2
22, // 22 , to be included in // to be replaced by NB_IoT_start ?? 22, // 22 , to be included in // to be replaced by NB_IoT_start ??
1, // 0 (3.75 KHz) or 1 (15 KHz) // 1, // 0 (3.75 KHz) or 1 (15 KHz)
nulsch->rnti, //= 65522
nulsch->Msg3_subframe, // first received subframe nulsch->Msg3_subframe, // first received subframe
nulsch->Msg3_frame, // first received frame nulsch->Msg3_frame, // first received frame
N_slots, // total number of occupied slots = get_nb_slot_per_RU * NB_of_RU N_slots, // total number of occupied slots = get_nb_slot_per_RU * NB_of_RU
get_UL_sc_index_start_NB_IoT(nulsch_harq->subcarrier_spacing,nulsch_harq->subcarrier_indication,nulsch->npusch_format), //get_UL_sc_index_start_NB_IoT(nulsch_harq->subcarrier_spacing,nulsch_harq->subcarrier_indication,nulsch->npusch_format),
get_UL_N_ru_NB_IoT(nulsch_harq->mcs,nulsch_harq->resource_assignment,nulsch->Msg3_flag), // N_RU get_UL_N_ru_NB_IoT(nulsch_harq->mcs,nulsch_harq->resource_assignment,nulsch->Msg3_flag), // N_RU
//if 0<get_numb_UL_sc_NB_IoT(uint8_t subcarrier_spacing, uint8_t I_sc, uint8_t npush_format),// Nsc, //if 0<get_numb_UL_sc_NB_IoT(uint8_t subcarrier_spacing, uint8_t I_sc, uint8_t npush_format),// Nsc,
nulsch_harq->mcs, // I_mcs nulsch_harq->mcs, // I_mcs
...@@ -1648,15 +1637,14 @@ void npusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -1648,15 +1637,14 @@ void npusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
proc, proc,
0, // this is the effective sector id 0, // this is the effective sector id
0, 0,
nulsch, // nulsch,
nulsch->npusch_format, //npusch_format, // 1, 2 // nulsch->npusch_format, //npusch_format, // 1, 2
22, // 22 , to be included in // to be replaced by NB_IoT_start ?? 22, // 22 , to be included in // to be replaced by NB_IoT_start ??
1, // 0 (3.75 KHz) or 1 (15 KHz) // 1, // 0 (3.75 KHz) or 1 (15 KHz)
nulsch->rnti, //= 65522
nulsch->Msg3_subframe, // first received subframe nulsch->Msg3_subframe, // first received subframe
nulsch->Msg3_frame, // first received frame nulsch->Msg3_frame, // first received frame
N_slots, // total number of occupied slots = get_nb_slot_per_RU * NB_of_RU N_slots, // total number of occupied slots = get_nb_slot_per_RU * NB_of_RU
get_UL_sc_index_start_NB_IoT(nulsch_harq->subcarrier_spacing,nulsch_harq->subcarrier_indication,nulsch->npusch_format), // get_UL_sc_index_start_NB_IoT(nulsch_harq->subcarrier_spacing,nulsch_harq->subcarrier_indication,nulsch->npusch_format),
get_UL_N_ru_NB_IoT(nulsch_harq->mcs,nulsch_harq->resource_assignment,nulsch->Msg3_flag), // N_RU get_UL_N_ru_NB_IoT(nulsch_harq->mcs,nulsch_harq->resource_assignment,nulsch->Msg3_flag), // N_RU
nulsch_harq->mcs, // I_mcs nulsch_harq->mcs, // I_mcs
nulsch_harq->TBS, // A = TBS nulsch_harq->TBS, // A = TBS
......
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