Skip to content

Commit

Permalink
phy: Document what the various pss_signal_* fields represent
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kotarou3 committed Apr 28, 2024
1 parent ec29b0c commit cdec513
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
11 changes: 7 additions & 4 deletions lib/include/srsran/phy/sync/pss.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 4 additions & 3 deletions lib/src/phy/sync/pss.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand All @@ -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
Expand Down

0 comments on commit cdec513

Please sign in to comment.