diff --git a/lib/include/srsran/phy/sync/pss.h b/lib/include/srsran/phy/sync/pss.h index 49737d1cfa..afaa0672bb 100644 --- a/lib/include/srsran/phy/sync/pss.h +++ b/lib/include/srsran/phy/sync/pss.h @@ -76,12 +76,15 @@ typedef struct SRSRAN_API { uint32_t frame_size; uint32_t N_id_2; uint32_t fft_size; - cf_t* pss_signal_freq_full[3]; - cf_t* pss_signal_time[3]; - cf_t* pss_signal_time_scale[3]; + // pss_signal_freq: One raw ZC sequence for each N_id_2, without the DC bin + // pss_signal_time: conj(IDFT{pss_signal_freq outer frequencies padded to fft_size}) right-padded to frame_size+fft_size + // pss_signal_freq_full: DFT{pss_signal_time} + // Note: Conjugate is applied so we can find the correlation with convolution functions + cf_t pss_signal_freq[3][SRSRAN_PSS_LEN]; + cf_t* pss_signal_time[3]; + cf_t* pss_signal_freq_full[3]; - cf_t pss_signal_freq[3][SRSRAN_PSS_LEN]; // One sequence for each N_id_2 cf_t* tmp_input; cf_t* conv_output; float* conv_output_abs; diff --git a/lib/src/phy/sync/pss.c b/lib/src/phy/sync/pss.c index 02241fb6d6..3ed49e5946 100644 --- a/lib/src/phy/sync/pss.c +++ b/lib/src/phy/sync/pss.c @@ -437,7 +437,7 @@ float compute_peak_sidelobe(srsran_pss_t* q, uint32_t corr_peak_pos, uint32_t co } /** Performs time-domain PSS correlation. - * Returns the index of the PSS correlation peak in a subframe. + * Returns the end index of the PSS correlation peak in a subframe. * The frame starts at corr_peak_pos-subframe_size/2. * The value of the correlation is stored in corr_peak_value. * @@ -458,9 +458,10 @@ int srsran_pss_find_pss(srsran_pss_t* q, const cf_t* input, float* corr_peak_val /* Correlate input with PSS sequence * - * We do not reverse time-domain PSS signal because it's conjugate is symmetric. * The conjugate operation on pss_signal_time has been done in srsran_pss_init_N_id_2 - * This is why we can use FFT-based convolution + * This is why we can use FFT-based convolution. + * We do not reverse time-domain PSS signal because its conjugate is symmetric, but + * it does mean the correlation peak is on the end of the signal rather than start */ if (q->frame_size >= q->fft_size) { #ifdef CONVOLUTION_FFT