Minor changes

master
Xavier Arteaga 3 years ago committed by Andre Puschmann
parent e3bd92d87c
commit c9d7db7314

@ -15,7 +15,6 @@
#include "srsran/phy/common/phy_common_nr.h"
#include <array>
#include <set>
#include <stdint.h>
#include <vector>
@ -83,6 +82,13 @@ public:
*/
srsran_ssb_patern_t get_ssb_pattern(uint16_t band, srsran_subcarrier_spacing_t scs) const;
/**
* @brief Select the lower SSB subcarrier spacing valid for this band
* @param band NR band number
* @return The SSB subcarrier spacing
*/
srsran_subcarrier_spacing_t get_ssb_scs(uint16_t band) const;
/**
* @brief gets the NR band duplex mode
* @param band Given band

@ -1370,7 +1370,7 @@ bool make_phy_carrier_cfg(const freq_info_dl_s& asn1_freq_info_dl, srsran_carrie
// As the carrier structure requires parameters from different objects, set fields separately
srsran::srsran_band_helper bands;
out_carrier_nr->ssb_center_freq_hz = srsran::srsran_band_helper().nr_arfcn_to_freq(absolute_frequency_ssb);
out_carrier_nr->ssb_center_freq_hz = bands.nr_arfcn_to_freq(absolute_frequency_ssb);
out_carrier_nr->dl_center_frequency_hz = bands.get_center_freq_from_abs_freq_point_a(
asn1_freq_info_dl.scs_specific_carrier_list[0].carrier_bw, asn1_freq_info_dl.absolute_freq_point_a);
out_carrier_nr->ul_center_frequency_hz = out_carrier_nr->dl_center_frequency_hz; // needs to be updated for FDD
@ -1416,10 +1416,15 @@ bool make_phy_ssb_cfg(const srsran_carrier_nr_t& carrier,
ssb.scs = srsran_subcarrier_spacing_30kHz;
break;
default:
asn1::log_error("SSB SCS not supported");
asn1::log_error("SSB SCS %s not supported", serv_cell_cfg.ssb_subcarrier_spacing.to_string());
return false;
}
} else {
ssb.scs = bands.get_ssb_scs(band);
if (ssb.scs == srsran_subcarrier_spacing_invalid) {
asn1::log_error("SSB SCS not available for band %d", band);
return false;
}
}
// Get the SSB pattern

@ -152,6 +152,23 @@ srsran_ssb_patern_t srsran_band_helper::get_ssb_pattern(uint16_t band, srsran_su
return SRSRAN_SSB_PATTERN_INVALID;
}
srsran_subcarrier_spacing_t srsran_band_helper::get_ssb_scs(uint16_t band) const
{
// Look for the given band and SCS
for (const nr_band_ss_raster& ss_raster : nr_band_ss_raster_table) {
// Check if band and SCS match!
if (ss_raster.band == band) {
return ss_raster.scs;
}
// As bands are in ascending order, do not waste more time if the current band is bigger
if (ss_raster.band > band) {
return srsran_subcarrier_spacing_invalid;
}
}
return srsran_subcarrier_spacing_invalid;
}
srsran_duplex_mode_t srsran_band_helper::get_duplex_mode(uint16_t band) const
{
// Look for the given band

@ -486,7 +486,8 @@ int main(int argc, char** argv)
return SRSRAN_ERROR;
}
srsran_vec_apply_cfo(baseband_buffer.data(), args.file_freq_offset_hz/args.srate_hz, baseband_buffer.data(), (int)sf_len);
srsran_vec_apply_cfo(
baseband_buffer.data(), args.file_freq_offset_hz / args.srate_hz, baseband_buffer.data(), (int)sf_len);
} else if (radio) {
// Receive radio
srsran::rf_buffer_t radio_buffer(baseband_buffer.data(), sf_len);

@ -776,8 +776,6 @@ bool rrc_nr::apply_dl_common_cfg(const asn1::rrc_nr::dl_cfg_common_s& dl_cfg_com
// Load CORESET Zero
if (pdcch_cfg_common.ctrl_res_set_zero_present) {
srsran::srsran_band_helper bands;
// Get pointA and SSB absolute frequencies
double pointA_abs_freq_Hz =
phy_cfg.carrier.dl_center_frequency_hz -
@ -897,9 +895,11 @@ bool rrc_nr::apply_dl_common_cfg(const asn1::rrc_nr::dl_cfg_common_s& dl_cfg_com
bool rrc_nr::apply_ul_common_cfg(const asn1::rrc_nr::ul_cfg_common_s& ul_cfg_common)
{
srsran::srsran_band_helper bands;
if (ul_cfg_common.freq_info_ul_present && ul_cfg_common.freq_info_ul.absolute_freq_point_a_present) {
// Update UL frequency point if provided
phy_cfg.carrier.ul_center_frequency_hz = srsran::srsran_band_helper().get_center_freq_from_abs_freq_point_a(
phy_cfg.carrier.ul_center_frequency_hz = bands.get_center_freq_from_abs_freq_point_a(
phy_cfg.carrier.nof_prb, ul_cfg_common.freq_info_ul.absolute_freq_point_a);
}
if (ul_cfg_common.init_ul_bwp_present) {

Loading…
Cancel
Save