Add test for ssb from band calculation.

This commit is contained in:
Fabian Eckermann 2021-10-04 08:56:07 +02:00 committed by Andre Puschmann
parent 95abfbfec8
commit 5f40d4fd99
1 changed files with 16 additions and 10 deletions

View File

@ -20,20 +20,20 @@ int bands_test_nr()
TESTASSERT(bands.nr_arfcn_to_freq(632628) == 3489.42e6);
TESTASSERT(bands.nr_arfcn_to_freq(633928) == 3508.92e6); // default refPointA
TESTASSERT(bands.nr_arfcn_to_freq(634240) == 3513.6e6); // default ARFCN with freq divisible by 11.52 MHz
// b28 b67
// n28 n67
TESTASSERT(bands.nr_arfcn_to_freq(140600) == 703.0e6);
TESTASSERT(bands.nr_arfcn_to_freq(145800) == 729.0e6);
TESTASSERT(bands.nr_arfcn_to_freq(153600) == 768.0e6);
TESTASSERT(bands.nr_arfcn_to_freq(157600) == 788.0e6);
// b20
// n20
TESTASSERT(bands.nr_arfcn_to_freq(158200) == 791.0e6);
TESTASSERT(bands.nr_arfcn_to_freq(160200) == 801.0e6);
TESTASSERT(bands.nr_arfcn_to_freq(162200) == 811.0e6);
TESTASSERT(bands.nr_arfcn_to_freq(168400) == 842.0e6);
// b32 b75
// n32 n75
TESTASSERT(bands.nr_arfcn_to_freq(290400) == 1452.0e6);
TESTASSERT(bands.nr_arfcn_to_freq(294400) == 1472.0e6);
// b5
// n5
TESTASSERT(bands.get_duplex_mode(5) == SRSRAN_DUPLEX_MODE_FDD);
TESTASSERT(bands.nr_arfcn_to_freq(176300) == 881.5e6);
TESTASSERT(bands.freq_to_nr_arfcn(881.5e6) == 176300);
@ -44,21 +44,30 @@ int bands_test_nr()
TESTASSERT(bands.get_center_freq_from_abs_freq_point_a(52, 175364) == 881.5e6);
TESTASSERT(bands.get_center_freq_from_abs_freq_point_a(52, 166364) == 836.5e6);
// b3
// n3
TESTASSERT(bands.nr_arfcn_to_freq(342000) == 1710.0e6);
TESTASSERT(bands.nr_arfcn_to_freq(348000) == 1740.0e6);
TESTASSERT(bands.nr_arfcn_to_freq(361000) == 1805.0e6);
TESTASSERT(bands.nr_arfcn_to_freq(376000) == 1880.0e6);
// b1
// n1
TESTASSERT(bands.nr_arfcn_to_freq(384000) == 1920.0e6);
TESTASSERT(bands.nr_arfcn_to_freq(388030) == 1940.15e6);
TESTASSERT(bands.nr_arfcn_to_freq(391830) == 1959.15e6);
TESTASSERT(bands.nr_arfcn_to_freq(434000) == 2170.0e6);
// b7 b38
// n7 n38
TESTASSERT(bands.get_duplex_mode(7) == SRSRAN_DUPLEX_MODE_FDD);
TESTASSERT(bands.nr_arfcn_to_freq(500000) == 2500.0e6);
TESTASSERT(bands.nr_arfcn_to_freq(508000) == 2540.0e6);
TESTASSERT(bands.nr_arfcn_to_freq(522000) == 2610.0e6);
TESTASSERT(bands.nr_arfcn_to_freq(538000) == 2690.0e6);
TESTASSERT(bands.get_abs_freq_point_a_arfcn(52, 529920) == 528984);
TESTASSERT(bands.get_abs_freq_ssb_arfcn(7, srsran_subcarrier_spacing_15kHz, 528984) > 529344);
// n78
TESTASSERT(bands.get_duplex_mode(78) == SRSRAN_DUPLEX_MODE_TDD);
TESTASSERT(bands.nr_arfcn_to_freq(634240) == 3513.6e6);
TESTASSERT(bands.get_abs_freq_point_a_arfcn(52, 634240) == 633928);
TESTASSERT(bands.get_abs_freq_ssb_arfcn(78, srsran_subcarrier_spacing_30kHz, 633928) > 634168);
const uint32_t max_valid_nr_arfcn = 3279165;
@ -73,9 +82,6 @@ int bands_test_nr()
TESTASSERT(band_vector.at(0) == 77);
TESTASSERT(band_vector.at(1) == 78);
// n78
TESTASSERT(bands.get_abs_freq_point_a_arfcn(52, 634240) == 633928);
// Invalid configs
// For 30 kHz, 620001 is not a valid ARFCN, only every 2nd
band_vector = bands.get_bands_nr(620001, srsran::srsran_band_helper::KHZ_30);