// Consider the CPs 10 normal length + 1 longer due to first symbol in slot
primary_synch0_time_NB_IoT=(int16_t*)malloc16((frame_parms->ofdm_symbol_size*11+frame_parms->nb_prefix_samples*10+frame_parms->nb_prefix_samples0)*sizeof(int16_t)*2);// 11 symbols per subframe dedicated to primary synchro
msg("[SYNC TIME] sync_corr_ue0 not yet allocated! Exiting.\n");
return(-1);
}
// if (sync_corr_ue1 == NULL) {
// msg("[SYNC TIME] sync_corr_ue1 not yet allocated! Exiting.\n");
// return(-1);
// }
// if (sync_corr_ue2 == NULL) {
// msg("[SYNC TIME] sync_corr_ue2 not yet allocated! Exiting.\n");
// return(-1);
// }
peak_val=0;
peak_pos=0;
// sync_source = 0;
for(n=0;n<length;n+=4){
#ifdef RTAI_ENABLED
// This is necessary since the sync takes a long time and it seems to block all other threads thus screwing up RTAI. If we pause it for a little while during its execution we give RTAI a chance to catch up with its other tasks.