Added band helper for getting band from ARFCN

master
Xavier Arteaga 3 years ago committed by Xavier Arteaga
parent 7377496417
commit e07263ee26

@ -52,6 +52,13 @@ public:
*/
uint16_t get_band_from_dl_freq_Hz(double dl_freq_Hz) const;
/**
* @brief Get the lowest band that includes a given Downlink ARFCN
* @param arfcn Given ARFCN
* @return The band number if the ARFCN is bounded in a band, UINT16_MAX otherwise
*/
uint16_t get_band_from_dl_arfcn(uint32_t arfcn) const;
/**
* @brief Selects the SSB pattern case according to the band number and subcarrier spacing
* @remark Described by TS 38.101-1 Table 5.4.3.3-1: Applicable SS raster entries per operating band

@ -67,6 +67,18 @@ uint16_t srsran_band_helper::get_band_from_dl_freq_Hz(double freq) const
return UINT16_MAX;
}
uint16_t srsran_band_helper::get_band_from_dl_arfcn(uint32_t arfcn) const
{
for (const nr_band& band : nr_band_table_fr1) {
// Check given ARFCN is between the first and last possible ARFCN and matches step
if (arfcn >= band.dl_nref_first and arfcn <= band.dl_nref_last and
(arfcn - band.dl_nref_first) % band.dl_nref_step == 0) {
return band.band;
}
}
return UINT16_MAX;
}
srsran_ssb_patern_t srsran_band_helper::get_ssb_pattern(uint16_t band, srsran_subcarrier_spacing_t scs) const
{
// Look for the given band and SCS

Loading…
Cancel
Save