Commit 2b970281 authored by Raymond Knopp's avatar Raymond Knopp

more modifications for initial synchronization

parent 226e7fb3
......@@ -40,9 +40,9 @@
#endif
//#define DEBUG_PHY
int32_t* sync_corr_ue0 = NULL;
int32_t* sync_corr_ue1 = NULL;
int32_t* sync_corr_ue2 = NULL;
int64_t* sync_corr_ue0 = NULL;
int64_t* sync_corr_ue1 = NULL;
int64_t* sync_corr_ue2 = NULL;
extern int16_t s6n_kHz_7_5[1920];
......@@ -64,8 +64,8 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com
int32_t sync_tmp[2048*4] __attribute__((aligned(32)));
int16_t syncF_tmp[2048*2] __attribute__((aligned(32)));
sync_corr_ue0 = (int32_t *)malloc16(4*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(int32_t)*frame_parms->samples_per_tti);
sync_corr_ue1 = (int32_t *)malloc16(4*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(int32_t)*frame_parms->samples_per_tti);
sync_corr_ue0 = (int64_t *)malloc16(4*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(int64_t)*frame_parms->samples_per_tti);
sync_corr_ue1 = (int64_t *)malloc16(4*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(int64_t)*frame_parms->samples_per_tti);
sync_corr_ue2 = (int32_t *)malloc16(LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(int32_t)*frame_parms->samples_per_tti);
if (sync_corr_ue0) {
......@@ -773,8 +773,8 @@ int lte_sync_timeSL(PHY_VARS_UE *ue,
avg0 += magtmp0;
avg1 += magtmp1;
if (n<4*FRAME_LENGTH_COMPLEX_SAMPLES) {
sync_corr_ue1[n] = (int32_t)(magtmp1>>31);
sync_corr_ue0[n] = (int32_t)(magtmp0>>31);
sync_corr_ue1[n] = magtmp1;
sync_corr_ue0[n] = magtmp0;
}
}
avg0/=(length/4);
......
......@@ -62,8 +62,8 @@ int initial_syncSL(PHY_VARS_UE *ue) {
ue->slbch_errors++;
write_output("rxsig0.m","rxs0",&ue->common_vars.rxdata_syncSL[0][0],40*ue->frame_parms.samples_per_tti,1,1);
write_output("corr0.m","rxsync0",sync_corr_ue0,40*ue->frame_parms.samples_per_tti,1,2);
write_output("corr1.m","rxsync1",sync_corr_ue1,40*ue->frame_parms.samples_per_tti,1,2);
write_output("corr0.m","rxsync0",sync_corr_ue0,40*ue->frame_parms.samples_per_tti,1,6);
write_output("corr1.m","rxsync1",sync_corr_ue1,40*ue->frame_parms.samples_per_tti,1,6);
exit(-1);
return(-1);
......
......@@ -330,7 +330,7 @@ int rx_slsss(PHY_VARS_UE *ue,int32_t *tot_metric,uint8_t *phase_max,int Nid2)
ru_tmp.common.rxdata = (int32_t**)malloc16(ue->frame_parms.nb_antennas_rx*sizeof(int32_t*));
for (int aa=0;aa<ue->frame_parms.nb_antennas_rx;aa++) {
ru_tmp.common.rxdata_7_5kHz[aa] = (int32_t*)ue->sl_rxdata_7_5kHz[aa];
ru_tmp.common.rxdata[aa] = (int32_t*)ue->common_vars.rxdata_syncSL[aa];
ru_tmp.common.rxdata[aa] = (int32_t*)&ue->common_vars.rxdata_syncSL[aa][2*ue->rx_offsetSL];
}
ru_tmp.common.rxdataF = (int32_t**)rxdataF;
ru_tmp.nb_rx = ue->frame_parms.nb_antennas_rx;
......
......@@ -68,9 +68,9 @@ extern int16_t *primary_synch1SL_time;
extern int16_t *primary_synch0SL_time_rx;
extern int16_t *primary_synch1SL_time_rx;
extern int *sync_corr_ue0; //!< index [0..10*samples_per_tti[
extern int *sync_corr_ue1; //!< index [0..10*samples_per_tti[
extern int *sync_corr_ue2; //!< index [0..10*samples_per_tti[
extern int64_t *sync_corr_ue0; //!< index [0..10*samples_per_tti[
extern int64_t *sync_corr_ue1; //!< index [0..10*samples_per_tti[
extern int64_t *sync_corr_ue2; //!< index [0..10*samples_per_tti[
extern int flagMag;
//extern short **txdataF_rep_tmp;
......
......@@ -1227,7 +1227,7 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, int frame_tx, int subframe_tx, uin
//LOG_E(PHY,"ul-signal [subframe: %d, ulsch_start %d]\n",subframe_tx, ulsch_start);
#else //this is the normal case
ulsch_start = (frame_parms->samples_per_tti*subframe_tx)-ue->N_TA_offset; //-ue->timing_advance;
ulsch_start = ue->rx_offset+(frame_parms->samples_per_tti*subframe_tx)-ue->N_TA_offset; //-ue->timing_advance;
#endif //else EXMIMO
......
......@@ -65,6 +65,7 @@ int main(int argc, char **argv) {
channel_desc_t *UE2UE[2][2][2];
PHY_VARS_UE *UE;
int log_level = LOG_INFO;
int tx_offset=0;
SLSCH_t slsch;
SLDCH_t sldch;
SLSS_t slss;
......@@ -94,7 +95,7 @@ int main(int argc, char **argv) {
char c;
while ((c = getopt (argc, argv, "hf:m:n:g:r:z:w:s:S")) != -1) {
while ((c = getopt (argc, argv, "hf:m:n:g:r:z:w:s:S:")) != -1) {
switch (c) {
case 'f':
snr_step= atof(optarg);
......@@ -189,6 +190,8 @@ int main(int argc, char **argv) {
break;
case 'S':
do_SLSS=1;
tx_offset=atoi(optarg);
printf("Running TX/RX synchornization signals with timing offset %d\n",tx_offset);
break;
case 'h':
......@@ -374,7 +377,7 @@ int main(int argc, char **argv) {
&UE->frame_parms,frame,0);
// write_output("rxsig0.m","rxs0",&UE->common_vars.rxdata[0][UE->frame_parms.samples_per_tti*subframe],UE->frame_parms.samples_per_tti,1,1);
if (do_SLSS==1)
memcpy((void*)&UE->common_vars.rxdata_syncSL[0][(((frame&3)*10)+subframe)*2*UE->frame_parms.samples_per_tti],
memcpy((void*)&UE->common_vars.rxdata_syncSL[0][2*tx_offset+(((frame&3)*10)+subframe)*2*UE->frame_parms.samples_per_tti],
(void*)&UE->common_vars.rxdata[0][subframe*UE->frame_parms.samples_per_tti],
2*UE->frame_parms.samples_per_tti*sizeof(int16_t));
// write_output("rxsyncb0.m","rxsyncb0",(void*)UE->common_vars.rxdata_syncSL[0],(UE->frame_parms.samples_per_tti),1,1);
......
......@@ -635,7 +635,7 @@ static void *UE_thread_synch(void *arg)
return &UE_thread_synch_retval;
}
extern int32_t* sync_corr_ue1;
extern int64_t* sync_corr_ue1;
static void *UE_thread_synchSL(void *arg)
{
......
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