Skip to content

Commit cdec513

Browse files
committed
phy: Document what the various pss_signal_* fields represent
Between the padding and conjugation applied, it's non-obvious what the contents of these fields are. Also get rid of unused pss_signal_time_scale
1 parent ec29b0c commit cdec513

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

lib/include/srsran/phy/sync/pss.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,15 @@ typedef struct SRSRAN_API {
7676
uint32_t frame_size;
7777
uint32_t N_id_2;
7878
uint32_t fft_size;
79-
cf_t* pss_signal_freq_full[3];
8079

81-
cf_t* pss_signal_time[3];
82-
cf_t* pss_signal_time_scale[3];
80+
// pss_signal_freq: One raw ZC sequence for each N_id_2, without the DC bin
81+
// pss_signal_time: conj(IDFT{pss_signal_freq outer frequencies padded to fft_size}) right-padded to frame_size+fft_size
82+
// pss_signal_freq_full: DFT{pss_signal_time}
83+
// Note: Conjugate is applied so we can find the correlation with convolution functions
84+
cf_t pss_signal_freq[3][SRSRAN_PSS_LEN];
85+
cf_t* pss_signal_time[3];
86+
cf_t* pss_signal_freq_full[3];
8387

84-
cf_t pss_signal_freq[3][SRSRAN_PSS_LEN]; // One sequence for each N_id_2
8588
cf_t* tmp_input;
8689
cf_t* conv_output;
8790
float* conv_output_abs;

lib/src/phy/sync/pss.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ float compute_peak_sidelobe(srsran_pss_t* q, uint32_t corr_peak_pos, uint32_t co
437437
}
438438

439439
/** Performs time-domain PSS correlation.
440-
* Returns the index of the PSS correlation peak in a subframe.
440+
* Returns the end index of the PSS correlation peak in a subframe.
441441
* The frame starts at corr_peak_pos-subframe_size/2.
442442
* The value of the correlation is stored in corr_peak_value.
443443
*
@@ -458,9 +458,10 @@ int srsran_pss_find_pss(srsran_pss_t* q, const cf_t* input, float* corr_peak_val
458458

459459
/* Correlate input with PSS sequence
460460
*
461-
* We do not reverse time-domain PSS signal because it's conjugate is symmetric.
462461
* The conjugate operation on pss_signal_time has been done in srsran_pss_init_N_id_2
463-
* This is why we can use FFT-based convolution
462+
* This is why we can use FFT-based convolution.
463+
* We do not reverse time-domain PSS signal because its conjugate is symmetric, but
464+
* it does mean the correlation peak is on the end of the signal rather than start
464465
*/
465466
if (q->frame_size >= q->fft_size) {
466467
#ifdef CONVOLUTION_FFT

0 commit comments

Comments
 (0)