Commit 22714366 authored by Matthieu Kanj's avatar Matthieu Kanj

nprach detection update

parent 994956c9
......@@ -80,7 +80,7 @@ uint8_t NPRACH_detection_NB_IoT(int16_t *input_buffer,uint32_t input_length){
}
//printf("energies = %ld %ld\n",energy_signal,energy_noise);
if ((uint64_t)(((uint64_t) energy_signal))<(uint64_t)energy_noise>>4){
if ((uint64_t)(((uint64_t) energy_signal))<(uint64_t)energy_noise>>6){
return 1;
}else{
......@@ -480,7 +480,7 @@ uint32_t process_nprach_NB_IoT(PHY_VARS_eNB *eNB, int frame, uint8_t subframe, u
*preamble_index = subcarrier_estimation(Rx_sub_sampled_buffer_128);
*timing_advance = 0;
*rnti = 1 + frame/4;
printf("estimated subaccier = %i\n",eNB->preamble_index_NB_IoT);
printf("estimated subaccier = %i\n",*preamble_index);
return 1;//estimated_TA;
}else{
......
......@@ -1592,6 +1592,7 @@ uint8_t rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB,
//fill_rx_indication_NB_IoT(eNB,i,frame,subframe); // indicate SDU to MAC
fill_rx_indication_NB_IoT(eNB,proc,npusch_format,ulsch_NB_IoT->Msg3_flag);
printf(" MSG3 OK");
//return 1;
} else {
......@@ -1600,7 +1601,7 @@ uint8_t rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB,
fill_rx_indication_NB_IoT(eNB,proc,npusch_format,ulsch_NB_IoT->Msg3_flag);
printf(" MSG3 NOT OK");
break;
//return 0;
}
}//////////// r loop end ////////////
......@@ -1647,14 +1648,14 @@ uint8_t rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB,
fill_crc_indication_NB_IoT(eNB,0,rx_frame,rx_subframe,0); // indicate ACK to MAC
//fill_rx_indication_NB_IoT(eNB,i,frame,subframe); // indicate SDU to MAC
fill_rx_indication_NB_IoT(eNB,proc,npusch_format,ulsch_NB_IoT->Msg3_flag);
//return 1;
} else if (counter_ack<8) { //hard decision
printf(" decoded msg5: NACK ");
fill_crc_indication_NB_IoT(eNB,0,rx_frame,rx_subframe,1); // indicate NAK to MAC
//fill_rx_indication_NB_IoT(eNB,i,frame,subframe); // indicate SDU to MAC
fill_rx_indication_NB_IoT(eNB,proc,npusch_format,ulsch_NB_IoT->Msg3_flag);
//return 0;
} else { //when equality (8 bits 0 vs 8 bits 1), soft decision
counter_ack_soft=0;
......@@ -1670,13 +1671,14 @@ uint8_t rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB,
fill_crc_indication_NB_IoT(eNB,0,rx_frame,rx_subframe,0); // indicate ACK to MAC
//fill_rx_indication_NB_IoT(eNB,i,frame,subframe); // indicate SDU to MAC
fill_rx_indication_NB_IoT(eNB,proc,npusch_format,ulsch_NB_IoT->Msg3_flag);
//return 1;
} else {
printf(" decoded msg5 (soft): NACK ");
fill_crc_indication_NB_IoT(eNB,0,rx_frame,rx_subframe,1); // indicate NAK to MAC
//fill_rx_indication_NB_IoT(eNB,i,frame,subframe); // indicate SDU to MAC
fill_rx_indication_NB_IoT(eNB,proc,npusch_format,ulsch_NB_IoT->Msg3_flag);
//return 0;
}
}
printf("\n\n\n");
......@@ -1705,6 +1707,7 @@ uint8_t rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB,
{
ulsch_NB_IoT->counter_sf = N_SF_per_word;
}
return 1;
/////////////////////////////////////////END/////////////////////////////////////////////////////////////////////////////////////
} else {
return 0; // create void function for NPUSCH ?
......
......@@ -3216,6 +3216,7 @@ void fill_rx_indication_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t d
for(m=0; m<6;m++)
{
pdu->data[m] = eNB->ulsch_NB_IoT[0]->harq_process->b[2+m];
printf(" pdu content = %d \n", eNB->ulsch_NB_IoT[0]->harq_process->b[2+m]);
}
} else {
......
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