Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phy: Document what the various pss_signal_* fields represent #1328

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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