Commit d38f75b3 authored by Matthieu Kanj's avatar Matthieu Kanj

Detection of msg1 sent from NB-IoT module

parent aa9e906b
This diff is collapsed.
......@@ -282,18 +282,20 @@ void ulsch_extract_rbs_single_NB_IoT(int32_t **rxdataF,
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 ******************//
void RX_NPRACH_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB, int16_t *Rx_buffer);
uint32_t RX_NPRACH_NB_IoT(PHY_VARS_eNB *eNB, int frame);
uint32_t TA_estimation_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,
uint32_t TA_estimation_NB_IoT(PHY_VARS_eNB *eNB,
int16_t *Rx_sub_sampled_buffer,
uint16_t sub_sampling_rate,
uint16_t FRAME_LENGTH_COMPLEX_SUB_SAMPLES,
uint32_t estimated_TA_coarse,
char coarse);
uint8_t coarse);
uint8_t NPRACH_detection_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB, int16_t *Rx_sub_sampled_buffer, uint16_t sub_sampling_rate, uint32_t FRAME_LENGTH_COMPLEX_SUB_SAMPLES);
uint8_t NPRACH_detection_NB_IoT(int16_t *input_buffer,uint32_t FRAME_LENGTH_COMPLEX_SAMPLESx);
int16_t* sub_sampling_NB_IoT(int16_t *input_buffer, uint32_t length_input, uint32_t *length_ouput, uint16_t sub_sampling_rate);
int16_t* sub_sampling_NB_IoT(int16_t *input_buffer, uint32_t length_input, uint32_t *length_ouput, uint16_t sub_sampling_rate);
void filtering_signal(int16_t *input_buffer, int16_t *filtered_buffer, uint32_t FRAME_LENGTH_COMPLEX_SAMPLESx);
//************************************************************//
//*****************Vincent part for ULSCH demodulation ******************//
uint16_t get_UL_sc_start_NB_IoT(uint16_t I_sc);
......
This diff is collapsed.
......@@ -48,6 +48,8 @@ uint32_t is_SIB1_NB_IoT(const frame_t frameP,
NB_IoT_eNB_NDLSCH_t *ndlsch_SIB1
);
void nprach_procedures_NB_IoT(PHY_VARS_eNB *eNB);
#endif
......@@ -2022,12 +2022,12 @@ void prach_procedures(PHY_VARS_eNB *eNB) {
int frame = eNB->proc.frame_prach;
uint8_t CC_id = eNB->CC_id;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,1);
/*VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,1);
memset(&preamble_energy_list[0],0,64*sizeof(uint16_t));
memset(&preamble_delay_list[0],0,64*sizeof(uint16_t));
memset(&preamble_delay_list[0],0,64*sizeof(uint16_t));*/
if (eNB->abstraction_flag == 0) {
LOG_D(PHY,"[eNB %d][RAPROC] Frame %d, Subframe %d : PRACH RX Signal Power : %d dBm\n",eNB->Mod_id,
/*LOG_D(PHY,"[eNB %d][RAPROC] Frame %d, Subframe %d : PRACH RX Signal Power : %d dBm\n",eNB->Mod_id,
frame,subframe,dB_fixed(signal_energy(&eNB->common_vars.rxdata[0][0][subframe*fp->samples_per_tti],512)) - eNB->rx_total_gain_dB);
......@@ -2035,11 +2035,13 @@ void prach_procedures(PHY_VARS_eNB *eNB) {
preamble_energy_list,
preamble_delay_list,
frame,
0);
0);*/
//usleep(100);
nprach_procedures_NB_IoT(eNB);
} else {
for (UE_id=0; UE_id<NB_UE_INST; UE_id++) {
LOG_D(PHY,"[RAPROC] UE_id %d (%p), generate_prach %d, UE RSI %d, eNB RSI %d preamble index %d\n",
/*LOG_D(PHY,"[RAPROC] UE_id %d (%p), generate_prach %d, UE RSI %d, eNB RSI %d preamble index %d\n",
UE_id,PHY_vars_UE_g[UE_id][CC_id],PHY_vars_UE_g[UE_id][CC_id]->generate_prach,
PHY_vars_UE_g[UE_id][CC_id]->frame_parms.prach_config_common.rootSequenceIndex,
fp->prach_config_common.rootSequenceIndex,
......@@ -2051,11 +2053,11 @@ void prach_procedures(PHY_VARS_eNB *eNB) {
preamble_energy_list[PHY_vars_UE_g[UE_id][CC_id]->prach_PreambleIndex] = 800;
preamble_delay_list[PHY_vars_UE_g[UE_id][CC_id]->prach_PreambleIndex] = 5;
}
}*/
}
}
preamble_energy_max = preamble_energy_list[0];
/*preamble_energy_max = preamble_energy_list[0];
preamble_max = 0;
for (i=1; i<64; i++) {
......@@ -2132,7 +2134,7 @@ void prach_procedures(PHY_VARS_eNB *eNB) {
eNB->Mod_id,frame, subframe);
}
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,0);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,0);*/
}
void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq_pid,uint8_t do_srs)
......@@ -2846,8 +2848,10 @@ void do_prach(PHY_VARS_eNB *eNB,int frame,int subframe) {
eNB_proc_t *proc = &eNB->proc;
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
if(frame%2==0 && subframe==9)
{
// check if we have to detect PRACH first
if (is_prach_subframe(fp,frame,subframe)>0) {
//if (is_prach_subframe(fp,frame,subframe)>0) {
/* accept some delay in processing - up to 5ms */
int i;
for (i = 0; i < 10 && proc->instance_cnt_prach == 0; i++) {
......@@ -2879,7 +2883,8 @@ void do_prach(PHY_VARS_eNB *eNB,int frame,int subframe) {
}
pthread_mutex_unlock( &proc->mutex_prach );
}
//}
}
}
......
......@@ -1514,4 +1514,23 @@ void phy_procedures_eNB_TX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,
}
}
}
void nprach_procedures_NB_IoT(PHY_VARS_eNB *eNB) {
uint32_t estimated_TA;
int subframe,frame,frame_mod;
subframe = eNB->proc.subframe_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 = RX_NPRACH_NB_IoT(eNB,frame);
//printf("estim = %i\n",estimated_TA);
}
}
\ 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