|
|
|
@ -23,7 +23,10 @@
|
|
|
|
|
// NR parameters
|
|
|
|
|
static uint32_t carrier_nof_prb = 52;
|
|
|
|
|
static srsran_subcarrier_spacing_t carrier_scs = srsran_subcarrier_spacing_15kHz;
|
|
|
|
|
static double carrier_freq_hz = 3.5e9 + 960e3;
|
|
|
|
|
static srsran_subcarrier_spacing_t ssb_scs = srsran_subcarrier_spacing_30kHz;
|
|
|
|
|
static double ssb_freq_hz = 3.5e9;
|
|
|
|
|
static srsran_ssb_patern_t ssb_pattern = SRSRAN_SSB_PATTERN_A;
|
|
|
|
|
|
|
|
|
|
// Channel parameters
|
|
|
|
|
static cf_t wideband_gain = 1.0f + 0.5 * I;
|
|
|
|
@ -42,14 +45,17 @@ static void usage(char* prog)
|
|
|
|
|
{
|
|
|
|
|
printf("Usage: %s [v]\n", prog);
|
|
|
|
|
printf("\t-s SSB subcarrier spacing [default, %s kHz]\n", srsran_subcarrier_spacing_to_str(ssb_scs));
|
|
|
|
|
printf("\t-f SSB center frequency [default, %.3f MHz]\n", ssb_freq_hz / 1e6);
|
|
|
|
|
printf("\t-S cell/carrier subcarrier spacing [default, %s kHz]\n", srsran_subcarrier_spacing_to_str(carrier_scs));
|
|
|
|
|
printf("\t-F cell/carrier center frequency in Hz [default, %.3f MHz]\n", carrier_freq_hz / 1e6);
|
|
|
|
|
printf("\t-P SSB pattern [default, %s]\n", srsran_ssb_pattern_to_str(ssb_pattern));
|
|
|
|
|
printf("\t-v [set srsran_verbose to debug, default none]\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void parse_args(int argc, char** argv)
|
|
|
|
|
{
|
|
|
|
|
int opt;
|
|
|
|
|
while ((opt = getopt(argc, argv, "Ssv")) != -1) {
|
|
|
|
|
while ((opt = getopt(argc, argv, "SsFfv")) != -1) {
|
|
|
|
|
switch (opt) {
|
|
|
|
|
case 's':
|
|
|
|
|
ssb_scs = srsran_subcarrier_spacing_from_str(argv[optind]);
|
|
|
|
@ -58,6 +64,9 @@ static void parse_args(int argc, char** argv)
|
|
|
|
|
exit(-1);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 'f':
|
|
|
|
|
ssb_freq_hz = strtod(argv[optind], NULL);
|
|
|
|
|
break;
|
|
|
|
|
case 'S':
|
|
|
|
|
carrier_scs = srsran_subcarrier_spacing_from_str(argv[optind]);
|
|
|
|
|
if (carrier_scs == srsran_subcarrier_spacing_invalid) {
|
|
|
|
@ -65,6 +74,12 @@ static void parse_args(int argc, char** argv)
|
|
|
|
|
exit(-1);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 'F':
|
|
|
|
|
carrier_freq_hz = strtod(argv[optind], NULL);
|
|
|
|
|
break;
|
|
|
|
|
case 'P':
|
|
|
|
|
ssb_pattern = srsran_ssb_pattern_fom_str(argv[optind]);
|
|
|
|
|
break;
|
|
|
|
|
case 'v':
|
|
|
|
|
srsran_verbose++;
|
|
|
|
|
break;
|
|
|
|
@ -114,10 +129,10 @@ static int test_case_1(srsran_ssb_t* ssb)
|
|
|
|
|
// SSB configuration
|
|
|
|
|
srsran_ssb_cfg_t ssb_cfg = {};
|
|
|
|
|
ssb_cfg.srate_hz = srate_hz;
|
|
|
|
|
ssb_cfg.center_freq_hz = 3.5e9;
|
|
|
|
|
ssb_cfg.ssb_freq_hz = 3.5e9 - 960e3;
|
|
|
|
|
ssb_cfg.center_freq_hz = carrier_freq_hz;
|
|
|
|
|
ssb_cfg.ssb_freq_hz = ssb_freq_hz;
|
|
|
|
|
ssb_cfg.scs = ssb_scs;
|
|
|
|
|
ssb_cfg.pattern = SRSRAN_SSB_PATTERN_C;
|
|
|
|
|
ssb_cfg.pattern = ssb_pattern;
|
|
|
|
|
|
|
|
|
|
TESTASSERT(srsran_ssb_set_cfg(ssb, &ssb_cfg) == SRSRAN_SUCCESS);
|
|
|
|
|
|
|
|
|
|