SSB related minor aesthetical corrections

master
Xavier Arteaga 4 years ago committed by Xavier Arteaga
parent 60d1708b80
commit d9586015f5

@ -35,7 +35,7 @@
#define SRSRAN_SSB_DEFAULT_BETA 1.0f #define SRSRAN_SSB_DEFAULT_BETA 1.0f
/** /**
* @brief Describes SSB object initializatoion 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 (common for gNb and UE), set to zero to use default
@ -75,19 +75,12 @@ typedef struct SRSRAN_API {
uint32_t cp_sz; ///< Other symbol cyclic prefix size uint32_t cp_sz; ///< Other symbol cyclic prefix size
/// Internal Objects /// Internal Objects
// srsran_pbch_nr_t pbch; ///< PBCH object for encoding/decoding
// srsran_dmrs_pbch_nr_t dmrs; ///< PBCH DMRS object for channel estimation
srsran_dft_plan_t ifft; ///< IFFT object for modulating the SSB srsran_dft_plan_t ifft; ///< IFFT object for modulating the SSB
srsran_dft_plan_t fft; ///< FFT object for demodulate the SSB. srsran_dft_plan_t fft; ///< FFT object for demodulate the SSB.
/// Frequency/Time domain temporal data /// Frequency/Time domain temporal data
cf_t* tmp_freq; cf_t* tmp_freq;
cf_t* tmp_time; cf_t* tmp_time;
/// Time domain sequences
// cf_t* pss[SRSRAN_NOF_NID_2_NR]; ///< PSS signal for each possible N_id_2
// cf_t* sss[SRSRAN_NOF_NID_1_NR]; ///< SSS signal for each possible N_id_1
} srsran_ssb_t; } srsran_ssb_t;
/** /**

@ -253,7 +253,9 @@ int srsran_ssb_csi_measure(srsran_ssb_t* q, uint32_t N_id, const cf_t* in, srsra
return SRSRAN_ERROR; return SRSRAN_ERROR;
} }
cf_t ssb_grid[SRSRAN_SSB_NOF_RE] = {}; uint32_t N_id_1 = SRSRAN_NID_1_NR(N_id);
uint32_t N_id_2 = SRSRAN_NID_2_NR(N_id);
cf_t ssb_grid[SRSRAN_SSB_NOF_RE] = {};
// Demodulate // Demodulate
const cf_t* in_ptr = in; const cf_t* in_ptr = in;
@ -298,8 +300,8 @@ int srsran_ssb_csi_measure(srsran_ssb_t* q, uint32_t N_id, const cf_t* in, srsra
// Extract PSS LSE // Extract PSS LSE
cf_t pss_lse[SRSRAN_PSS_NR_LEN]; cf_t pss_lse[SRSRAN_PSS_NR_LEN];
cf_t sss_lse[SRSRAN_SSS_NR_LEN]; cf_t sss_lse[SRSRAN_SSS_NR_LEN];
if (srsran_pss_nr_extract_lse(ssb_grid, SRSRAN_NID_2_NR(N_id), pss_lse) < SRSRAN_SUCCESS || if (srsran_pss_nr_extract_lse(ssb_grid, N_id_2, pss_lse) < SRSRAN_SUCCESS ||
srsran_sss_nr_extract_lse(ssb_grid, SRSRAN_NID_1_NR(N_id), SRSRAN_NID_2_NR(N_id), sss_lse) < SRSRAN_SUCCESS) { srsran_sss_nr_extract_lse(ssb_grid, N_id_1, N_id_2, sss_lse) < SRSRAN_SUCCESS) {
ERROR("Error extracting LSE"); ERROR("Error extracting LSE");
return SRSRAN_ERROR; return SRSRAN_ERROR;
} }
@ -317,8 +319,8 @@ int srsran_ssb_csi_measure(srsran_ssb_t* q, uint32_t N_id, const cf_t* in, srsra
} }
// Extract LSE again // Extract LSE again
if (srsran_pss_nr_extract_lse(ssb_grid, SRSRAN_NID_2_NR(N_id), pss_lse) < SRSRAN_SUCCESS || if (srsran_pss_nr_extract_lse(ssb_grid, N_id_2, pss_lse) < SRSRAN_SUCCESS ||
srsran_sss_nr_extract_lse(ssb_grid, SRSRAN_NID_1_NR(N_id), SRSRAN_NID_2_NR(N_id), sss_lse) < SRSRAN_SUCCESS) { srsran_sss_nr_extract_lse(ssb_grid, N_id_1, N_id_2, sss_lse) < SRSRAN_SUCCESS) {
ERROR("Error extracting LSE"); ERROR("Error extracting LSE");
return SRSRAN_ERROR; return SRSRAN_ERROR;
} }

@ -11,11 +11,11 @@
*/ */
#include "srsran/common/test_common.h" #include "srsran/common/test_common.h"
#include "srsran/phy/channel/ch_awgn.h"
#include "srsran/phy/sync/ssb.h" #include "srsran/phy/sync/ssb.h"
#include "srsran/phy/utils/debug.h" #include "srsran/phy/utils/debug.h"
#include "srsran/phy/utils/vector.h" #include "srsran/phy/utils/vector.h"
#include <getopt.h> #include <getopt.h>
#include <srsran/phy/channel/ch_awgn.h>
#include <stdlib.h> #include <stdlib.h>
// NR parameters // NR parameters
@ -103,10 +103,8 @@ static int test_case_1(srsran_ssb_t* ssb)
run_channel(); run_channel();
// Measure // Measure
srsran_csi_trs_measurements_t meas = {};
TESTASSERT(srsran_ssb_csi_measure(ssb, pci, buffer, &meas) == SRSRAN_SUCCESS);
gettimeofday(&t[1], NULL); gettimeofday(&t[1], NULL);
srsran_csi_trs_measurements_t meas = {};
TESTASSERT(srsran_ssb_csi_measure(ssb, pci, buffer, &meas) == SRSRAN_SUCCESS); TESTASSERT(srsran_ssb_csi_measure(ssb, pci, buffer, &meas) == SRSRAN_SUCCESS);
gettimeofday(&t[2], NULL); gettimeofday(&t[2], NULL);
get_time_interval(t); get_time_interval(t);

Loading…
Cancel
Save