@@ -877,27 +879,58 @@ int pss_search_time_nr(int **rxdata, ///rx data in time domain
...
@@ -877,27 +879,58 @@ int pss_search_time_nr(int **rxdata, ///rx data in time domain
}
}
}
}
/* calculate the absolute value of sync_corr[n] */
/* calculate the absolute value of sync_corr[n] */
avg[pss_index]+=pss_corr_ue[pss_index][n];
avg[pss_index]+=pss_corr_ue[pss_index][n];
if(pss_corr_ue[pss_index][n]>peak_value){
if(pss_corr_ue[pss_index][n]>peak_value){
peak_value=pss_corr_ue[pss_index][n];
peak_value=pss_corr_ue[pss_index][n];
peak_position=n;
peak_position=n;
pss_source=pss_index;
pss_source=pss_index;
ffo_est=angle64(result)/M_PI;
//#ifdef DEBUG_PSS_NR
#ifdef DEBUG_PSS_NR
printf("pss_index %d: n %6d peak_value %15llu ffo %lf\n",pss_index,n,(unsignedlonglong)pss_corr_ue[pss_index][n],ffo_est);
printf("pss_index %d: n %6d peak_value %15llu\n",pss_index,n,(unsignedlonglong)pss_corr_ue[pss_index][n]);
//#endif
#endif
}
}
}
}
}
}
// fractional frequency offser computation according to Cross-correlation Synchronization Algorithm Using PSS
// Shoujun Huang, Yongtao Su, Ying He and Shan Tang, "Joint time and frequency offset estimation in LTE downlink," 7th International Conference on Communications and Networking in China, 2012.
// Computing cross-correlation at peak on half the symbol size for first half of data