28 #include <libconfig.h++>
30 #include "srsran/srsran.h"
31 #include "srsran/interfaces/rrc_interface_types.h"
32 #include "srsran/common/gen_mch_tables.h"
33 #include "srsran/phy/common/phy_common.h"
47 typedef std::function<int(cf_t* data[SRSRAN_MAX_CHANNELS], uint32_t nsamples, srsran_timestamp_t* rx_time)>
get_samples_t;
57 Phy(
const libconfig::Config&
cfg,
get_samples_t cb, uint8_t cs_nof_prb, int8_t override_nof_prb, uint8_t rx_channels);
191 _ue_sync.cfo_correct_enable_find = enable;
264 if (
_cell.mbms_dedicated) {
265 switch (
_sib13.mbsfn_area_info_list[0].subcarrier_spacing) {
276 if (
_cell.mbms_dedicated) {
277 switch (
_sib13.mbsfn_area_info_list[0].subcarrier_spacing) {
278 case srsran::mbsfn_area_info_t::subcarrier_spacing_t::khz_1dot25:
return 1.25;
279 case srsran::mbsfn_area_info_t::subcarrier_spacing_t::khz_7dot5:
return 7.5;
317 std::map< uint32_t, std::map< int, std::string >>
_dests;
constexpr unsigned int MAX_PRB
float get_ue_sync_threshold_track()
srsran_mbsfn_cfg_t mbsfn_config_for_tti(uint32_t tti, unsigned &area)
Returns the MBSFN configuration (MCS, etc) for the subframe with the passed TTI.
void set_cfo_from_channel_estimation(float cfo)
Set the CFO value from channel estimation.
std::function< int(cf_t *data[SRSRAN_MAX_CHANNELS], uint32_t nsamples, srsran_timestamp_t *rx_time)> get_samples_t
Definition of the callback function used to fetch samples from the SDR.
std::map< uint32_t, std::map< int, std::string > > _dests
bool mcch_configured()
Return true if MCCH has been configured.
bool get_ue_sync_track_cfo_pss_enable()
SubcarrierSpacing mbsfn_subcarrier_spacing()
void set_ue_sync_track_cfo_ema(float ema)
Sets the ema alpha value used for the tracking of the CFO in the trackin sync object,...
unsigned nr_prb()
Get the current number of PRB.
uint8_t mbsfn_area_id()
Returns the current MBSFN area ID.
void set_decode_mcch(bool d)
Enable MCCH decoding.
const std::vector< mch_info_t > & mch_info()
void set_ue_sync_threshold_track(float threshold)
Sets the threshold of the peak found while tracking for synchronization.
bool get_ue_sync_find_cfo_pss_enable()
void set_mch_scheduling_info(const srsran::sib13_t &sib13)
Set the values received in SIB13.
float get_ue_sync_pss_cfo_ema_find()
float get_ue_sync_track_cfo_ema()
std::vector< mch_info_t > _mch_info
void set_ue_sync_find_cfo_ema(float ema)
Sets the ema alpha value used for the tracking of the CFO in the trackin sync object,...
cf_t * _mib_buffer[SRSRAN_MAX_CHANNELS]
bool get_next_frame(cf_t **buffer, uint32_t size)
Get the sample data for the next subframe.
srsran_cell_t cell()
Get the current cell (with params adjusted for MBSFN)
void set_ue_sync_track_cfo_pss_enable(bool enable)
Enables or disables the CFO estimation from the PSS in the tracking stage.
bool synchronize_subframe()
Synchronizes PSS/SSS and tries to deocode the MIB.
const libconfig::Config & _cfg
uint8_t nof_mbsfn_prb()
Get number of PRB in MBSFN/PMCH.
void set_ue_sync_pss_cfo_ema_find(float ema)
Sets the weight factor alpha for the exponential moving average of the PSS correlation output
float get_ue_sync_find_cfo_ema()
srsran_ue_cellsearch_t _cell_search
void reset()
Clear configuration values.
bool is_cas_subframe(unsigned tti)
uint32_t tti()
Get the current subframe TTI.
void set_ue_sync_track_sfo_ema(float ema)
Sets the ema alpha value used for the tracking of the SFO in ue_sync in the function track_peak_ok.
srsran_ue_sync_t _ue_sync
void set_ue_sync_pss_cfo_ema_track(float ema)
Sets the weight factor alpha for the exponential moving average of the PSS correlation output
void set_ue_sync_track_cfo_correct_enable(bool enable)
Enables the CFO correction while tracking the synchronization from previous estimations.
bool init()
Initialize the underlying components.
float get_ue_sync_cfo_loop_bw_pss()
float mbsfn_subcarrier_spacing_khz()
bool cell_search()
Search for a cell.
bool get_ue_sync_find_cfo_correct_enable()
virtual ~Phy()
Default destructor.
uint32_t _buffer_max_samples
void set_nof_mbsfn_prb(uint8_t prb)
Override number of PRB in MBSFN/PMCH.
void set_ue_sync_find_cfo_pss_enable(bool enable)
Enables or disables the CFO estimation from the PSS in the finding stage.
void set_dest_for_lcid(uint32_t mch_idx, int lcid, std::string dest)
void set_ue_sync_find_cfo_correct_enable(bool enable)
Enables the CFO correction while finding the synchronization from previous estimations.
float get_ue_sync_pss_cfo_ema_track()
srsran::mcch_msg_t & mcch()
bool is_mbsfn_subframe(unsigned tti)
void set_mbsfn_config(const srsran::mcch_msg_t &mcch)
Set MBSFN configuration values.
bool get_ue_sync_track_cfo_correct_enable()
void set_ue_sync_cfo_loop_bw_pss(float bw)
Set the factor for the PSS loopback.
float cfo()
Get the current CFO value.
float get_ue_sync_track_sfo_ema()
void set_ue_sync_threshold_find(float threshold)
Sets the threshold of the peak found while searching for synchronization.
srsran_ue_mib_sync_t _mib_sync
float get_ue_sync_threshold_find()
Phy(const libconfig::Config &cfg, get_samples_t cb, uint8_t cs_nof_prb, int8_t override_nof_prb, uint8_t rx_channels)
Default constructor.
static Config cfg
Global configuration object.
std::vector< mtch_info_t > mtchs