Commit 2d12cac7 authored by Sakthivel Velumani's avatar Sakthivel Velumani

first

parent 334519d1
......@@ -635,6 +635,7 @@ int computeSamplesShift(PHY_VARS_NR_UE *UE) {
}
void *UE_thread(void *arg) {
int f_name_idx = 0;
//this thread should be over the processing thread to keep in real time
PHY_VARS_NR_UE *UE = (PHY_VARS_NR_UE *) arg;
// int tx_enabled = 0;
......@@ -680,6 +681,18 @@ void *UE_thread(void *arg) {
if (!UE->is_synchronized) {
readFrame(UE, &timestamp, false);
char filename[40];
sprintf(filename,"rxdata_frame_ue_%d.dat",f_name_idx);
FILE *output_fd = fopen(filename,"w");
if (output_fd) {
fwrite(&UE->common_vars.rxdata[0][0],
sizeof(int32_t),
UE->frame_parms.samples_per_subframe*20,
output_fd);
fclose(output_fd);
}
f_name_idx++;
notifiedFIFO_elt_t *Msg=newNotifiedFIFO_elt(sizeof(syncData_t),0,&nf,UE_synch);
syncData_t *syncMsg=(syncData_t *)NotifiedFifoData(Msg);
syncMsg->UE=UE;
......
......@@ -245,10 +245,10 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, PHY_VARS_NR_UE *ue, runmode_t mode,
else
ue->ssb_offset = sync_pos + (fp->samples_per_subframe * 10) - fp->nb_prefix_samples;
#ifdef DEBUG_INITIAL_SYNCH
//#ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"[UE%d] Initial sync : Estimated PSS position %d, Nid2 %d\n", ue->Mod_id, sync_pos,ue->common_vars.eNb_id);
LOG_I(PHY,"sync_pos %d ssb_offset %d \n",sync_pos,ue->ssb_offset);
#endif
LOG_I(PHY,"sync_pos %d ssb_offset %d frame %d\n",sync_pos,ue->ssb_offset,is);
//#endif
// digital compensation of FFO for SSB symbols
if (ue->UE_fo_compensation){
......
......@@ -334,6 +334,7 @@ int do_pss_sss_extract_nr(PHY_VARS_NR_UE *ue,
rxdataF = ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF;
unsigned int ofdm_symbol_size = frame_parms->ofdm_symbol_size;
write_output("pss_rxF.m","pss_rxF",rxdataF[aarx],ofdm_symbol_size,1,1);
pss_rxF = &rxdataF[aarx][pss_symbol*ofdm_symbol_size];
sss_rxF = &rxdataF[aarx][sss_symbol*ofdm_symbol_size];
......@@ -437,6 +438,7 @@ int rx_sss_nr(PHY_VARS_NR_UE *ue, int32_t *tot_metric,uint8_t *phase_max)
sss_ext,
0); /* subframe */
write_output("pss_ext.m","pss_ext",pss_ext,LENGTH_PSS_NR,1,1);
#ifdef DEBUG_PLOT_SSS
write_output("rxsig0.m","rxs0",&ue->common_vars.rxdata[0][0],ue->frame_parms.samples_per_subframe,1,1);
......
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