Minor SSB fix and changes

master
Xavier Arteaga 4 years ago committed by Xavier Arteaga
parent c8cb128317
commit 11d925c0b2

@ -43,12 +43,12 @@
* @brief Describes SSB object initialization arguments * @brief Describes SSB object initialization arguments
*/ */
typedef struct SRSRAN_API { typedef struct SRSRAN_API {
double max_srate_hz; ///< Maximum sampling rate in Hz (common for gNb and UE), set to zero to use default double max_srate_hz; ///< Maximum sampling rate in Hz, set to zero to use default
srsran_subcarrier_spacing_t min_scs; ///< Minimum subcarrier spacing srsran_subcarrier_spacing_t min_scs; ///< Minimum subcarrier spacing
bool enable_correlate; ///< Enables PSS/SSS correlation and peak search (UE cell search) bool enable_search; ///< Enables PSS/SSS blind search
bool enable_encode; ///< Enables PBCH Encoder (intended for gNb) bool enable_measure; ///< Enables PSS/SSS CSI measurements and frequency domain search
bool enable_decode; ///< Enables PBCH Decoder (intented for UE) bool enable_encode; ///< Enables PBCH Encoder
bool enable_measure; ///< Enables PSS/SSS CSI measurements and frequency domain search bool enable_decode; ///< Enables PBCH Decoder
} srsran_ssb_args_t; } srsran_ssb_args_t;
/** /**

@ -35,14 +35,14 @@
static int ssb_init_corr(srsran_ssb_t* q) static int ssb_init_corr(srsran_ssb_t* q)
{ {
// Initialise correlation only if it is enabled // Initialise correlation only if it is enabled
if (!q->args.enable_correlate) { if (!q->args.enable_search) {
return SRSRAN_SUCCESS; return SRSRAN_SUCCESS;
} }
// For each PSS sequence allocate // For each PSS sequence allocate
for (uint32_t N_id_2 = 0; N_id_2 < SRSRAN_NOF_NID_2_NR; N_id_2++) { for (uint32_t N_id_2 = 0; N_id_2 < SRSRAN_NOF_NID_2_NR; N_id_2++) {
// Allocate sequences // Allocate sequences
q->pss_seq[N_id_2] = srsran_vec_cf_malloc(2 * q->max_symbol_sz); q->pss_seq[N_id_2] = srsran_vec_cf_malloc(SSB_CORR_SZ * q->max_symbol_sz);
if (q->pss_seq[N_id_2] == NULL) { if (q->pss_seq[N_id_2] == NULL) {
ERROR("Malloc"); ERROR("Malloc");
return SRSRAN_ERROR; return SRSRAN_ERROR;
@ -301,7 +301,7 @@ static void ssb_modulate_symbol(srsran_ssb_t* q, cf_t ssb_grid[SRSRAN_SSB_NOF_RE
static int ssb_setup_corr(srsran_ssb_t* q) static int ssb_setup_corr(srsran_ssb_t* q)
{ {
// Skip if disabled // Skip if disabled
if (!q->args.enable_correlate) { if (!q->args.enable_search) {
return SRSRAN_SUCCESS; return SRSRAN_SUCCESS;
} }
@ -417,7 +417,7 @@ int srsran_ssb_set_cfg(srsran_ssb_t* q, const srsran_ssb_cfg_t* cfg)
} }
// Replan iFFT // Replan iFFT
if ((q->args.enable_encode || q->args.enable_correlate) && q->symbol_sz != symbol_sz) { if ((q->args.enable_encode || q->args.enable_search) && q->symbol_sz != symbol_sz) {
// free the current IFFT, it internally checks if the plan was created // free the current IFFT, it internally checks if the plan was created
srsran_dft_plan_free(&q->ifft); srsran_dft_plan_free(&q->ifft);
@ -430,7 +430,7 @@ int srsran_ssb_set_cfg(srsran_ssb_t* q, const srsran_ssb_cfg_t* cfg)
} }
// Replan FFT // Replan FFT
if ((q->args.enable_measure || q->args.enable_decode) && q->symbol_sz != symbol_sz) { if ((q->args.enable_measure || q->args.enable_decode || q->args.enable_search) && q->symbol_sz != symbol_sz) {
// free the current FFT, it internally checks if the plan was created // free the current FFT, it internally checks if the plan was created
srsran_dft_plan_free(&q->fft); srsran_dft_plan_free(&q->fft);
@ -740,7 +740,7 @@ int srsran_ssb_csi_search(srsran_ssb_t* q,
return SRSRAN_ERROR_INVALID_INPUTS; return SRSRAN_ERROR_INVALID_INPUTS;
} }
if (!q->args.enable_correlate) { if (!q->args.enable_search) {
ERROR("SSB is not configured for search"); ERROR("SSB is not configured for search");
return SRSRAN_ERROR; return SRSRAN_ERROR;
} }

@ -174,7 +174,7 @@ int main(int argc, char** argv)
srsran_ssb_args_t ssb_args = {}; srsran_ssb_args_t ssb_args = {};
ssb_args.enable_encode = true; ssb_args.enable_encode = true;
ssb_args.enable_measure = true; ssb_args.enable_measure = true;
ssb_args.enable_correlate = true; ssb_args.enable_search = true;
if (buffer == NULL) { if (buffer == NULL) {
ERROR("Malloc"); ERROR("Malloc");

Loading…
Cancel
Save