Agora
1.2.0
Agora project
|
Go to the documentation of this file.
15 #include "SoapySDR/Device.hpp"
32 const std::vector<std::vector<std::complex<int16_t>>>&
tx_data,
36 std::vector<std::vector<std::complex<int16_t>>>&
rx_data,
40 std::vector<std::vector<std::complex<int16_t>>*>& rx_buffs,
43 int RadioRx(
size_t radio_id, std::vector<void*>& rx_locs,
size_t rx_size,
65 auto TxArrayToRef(
const std::vector<std::complex<int16_t>>& tx_vec);
69 auto TxRefToArray(
const std::vector<std::complex<int16_t>>& tx_vec);
71 const std::vector<std::vector<std::complex<int16_t>>>&
rx_mat,
72 std::vector<int>& offset);
76 size_t channel,
double rx_center_tone,
77 double tx_center_tone);
81 Radio* tx_dev,
size_t channel,
82 double fft_bin,
bool plot =
false);
85 std::vector<SoapySDR::Device*>
hubs_;
86 std::vector<std::unique_ptr<Radio>>
radios_;
99 #endif // RADIO_LIB_H_
Config * cfg_
Definition: radio_lib.h:84
static void AdjustCalibrationGains(std::vector< Radio * > &rx_devs, Radio *tx_dev, size_t channel, double fft_bin, bool plot=false)
Definition: radio_calibrate_analog.cc:123
Defination file for the Radio class.
int RadioRx(size_t radio_id, std::vector< std::vector< std::complex< int16_t >>> &rx_data, size_t rx_size, Radio::RxFlags &out_flags, long long &rx_time_ns)
Definition: radio_lib.cc:326
bool CalibrateSampleOffsetDownlink(size_t max_attempts)
Definition: radio_calibrate_digital.cc:395
void Calloc(size_t dim1, size_t dim2, Agora_memory::Alignment_t alignment)
Definition: memory_manage.h:45
arma::cx_float * init_calib_dl_processed_
Definition: radio_lib.h:88
std::atomic< size_t > num_radios_configured_
Definition: radio_lib.h:97
size_t SampsPerSymbol() const
Definition: config.h:234
auto printf(const S &fmt, const T &... args) -> int
Definition: printf.h:631
bool plot(const std::vector< Numeric > &x, const std::vector< Numeric > &y, const std::map< std::string, std::string > &keywords)
Definition: matplotlibcpp.h:442
void ReadSensors()
Definition: radio_lib.cc:344
static void FreeBuffer1d(T **buffer)
Definition: memory_manage.h:116
const std::vector< std::string > & RadioId() const
Definition: config.h:356
void CalibrateSampleOffset()
Definition: radio_calibrate_digital.cc:341
size_t calib_meas_num_
Definition: radio_lib.h:94
const std::vector< std::string > & HubId() const
Definition: config.h:359
std::atomic< size_t > num_radios_initialized_
Definition: radio_lib.h:96
Table< arma::cx_float > init_calib_ul_
Definition: radio_lib.h:89
bool InitialCalib()
Definition: radio_calibrate_digital.cc:438
static constexpr size_t kHubMissingWaitMs
Definition: radio_lib.cc:15
size_t BsAntNum() const
Definition: config.h:35
void Go()
Definition: radio_lib.cc:293
static constexpr bool kRecordCalibrationMats
Definition: symbols.h:203
double RxGainB() const
Definition: config.h:67
@ info
Definition: common.h:215
#define AGORA_LOG_ERROR(...)
Definition: logger.h:39
size_t antenna_num_
Definition: radio_lib.h:92
size_t RefRadio(size_t id) const
Definition: config.h:101
const FrameStats & Frame() const
Definition: config.h:340
bool CalibrateSampleOffsetUplink(size_t max_attempts)
Definition: radio_calibrate_digital.cc:349
static constexpr size_t kSoapyMakeMaxAttempts
Definition: radio_lib.cc:14
arma::cx_float * GetCalibUl()
Definition: radio_lib.h:48
#define AGORA_LOG_TRACE(...)
Definition: logger.h:92
bool FindTimeOffset(const std::vector< std::vector< std::complex< int16_t >>> &rx_mat, std::vector< int > &offset)
Definition: radio_calibrate_digital.cc:210
static void AllocBuffer1d(T **buffer, U dim, Agora_memory::Alignment_t alignment, int init_zero)
Definition: memory_manage.h:105
static double mean(const std::vector< double > in_vec)
Definition: timer.h:103
Declaration file for the RadioConfig class.
arma::cx_float * init_calib_ul_processed_
Definition: radio_lib.h:87
bool RadioStart()
Definition: radio_lib.cc:177
size_t OfdmDataNum() const
Definition: config.h:47
void InitBsRadio(size_t radio_id)
Definition: radio_lib.cc:157
virtual void Close()=0
Definition: radio.cc:35
TxFlags
Definition: radio.h:20
Definition: radio_lib.h:21
std::vector< std::unique_ptr< Radio > > radios_
Definition: radio_lib.h:86
static constexpr bool kPrintCalibrationMats
Definition: radio_lib.cc:13
RadioType
Definition: radio.h:17
void Free()
Definition: memory_manage.h:84
RadioConfig(Config *cfg, Radio::RadioType radio_type)
Definition: radio_lib.cc:17
static std::unique_ptr< Radio > Create(RadioType type)
Definition: radio.cc:11
for i
Definition: generate_data.m:107
j template void())
Definition: json.hpp:4744
bool ImbalanceCalEn() const
Definition: config.h:107
void RadioStop()
Definition: radio_lib.cc:350
Plot Rx waveform for u
Definition: inspect_single_frame.m:108
Rx data rx_mat
Definition: generate_data.m:115
static constexpr bool kUseUHD
Definition: symbols.h:162
std::string Channel() const
Definition: config.h:113
arma::cx_float * GetCalibDl()
Definition: radio_lib.h:49
~RadioConfig()
Definition: radio_lib.cc:400
Table< arma::cx_float > init_calib_dl_
Definition: radio_lib.h:90
size_t InitCalibRepeat() const
Definition: config.h:96
std::vector< SoapySDR::Device * > hubs_
Definition: radio_lib.h:85
int RadioTx(size_t radio_id, const void *const *buffs, Radio::TxFlags flags, long long &tx_time)
Definition: radio_lib.cc:306
RxFlags
Definition: radio.h:19
void AdjustDelays(const std::vector< int > &ch0_offsets)
Definition: radio_calibrate_digital.cc:251
static void SetIqBalance(Radio *dev, int direction, size_t channel, int gcorr, int iqcorr)
Definition: radio_calibrate_analog.cc:181
static void DciqMinimize(Radio *target_dev, Radio *ref_dev, int direction, size_t channel, double rx_center_tone, double tx_center_tone)
Definition: radio_calibrate_analog.cc:192
static std::vector< size_t > StrToChannels(const std::string &channel)
Definition: utils.cc:207
size_t NumDLSyms() const
Definition: framestats.cc:83
const std::vector< size_t > & CellId() const
Definition: config.h:368
static void SaveMat(const arma::cx_fmat &c, const std::string &filename, const std::string &ss, const bool append)
Definition: utils.cc:428
bool calib_
Definition: radio_lib.h:93
bool HwFramer() const
Definition: config.h:53
#define AGORA_LOG_INFO(...)
Definition: logger.h:62
bool SampleCalEn() const
Definition: config.h:106
auto TxArrayToRef(const std::vector< std::complex< int16_t >> &tx_vec)
Definition: radio_calibrate_digital.cc:24
N_SC, NUM_UE, NUM_UE zeros()
end Generate data if GENERATE_DATA tx_data
Definition: generate_data.m:38
#define AGORA_LOG_WARN(...)
Definition: logger.h:53
void ConfigureBsRadio(size_t radio_id)
Definition: radio_lib.cc:164
auto TxRefToArray(const std::vector< std::complex< int16_t >> &tx_vec)
Definition: radio_calibrate_digital.cc:118
std::string to_string() const
Definition: eth_common.h:64
size_t radio_num_
Definition: radio_lib.h:91
size_t NumCells() const
Definition: config.h:94
Declaration file for the configuration class which importants json configuration values into class va...
case QPSK rx_data
Definition: generate_data.m:160
virtual void Activate(Radio::ActivationTypes type=Radio::ActivationTypes::kActivate, long long act_time_ns=0, size_t samples=0)=0
Definition: radio.cc:62
virtual void Deactivate()=0
Definition: radio.cc:71
long long SyncArrayTime()
Definition: radio_lib.cc:364
bool DoCalib() const
Definition: radio_lib.h:46
double RxGainA() const
Definition: config.h:65
static void PrintMat(const arma::cx_fmat &c, const std::string &ss)
Definition: utils.cc:452
size_t NumRadios() const
Definition: config.h:95
double TxGainB() const
Definition: config.h:66
double TxGainA() const
Definition: config.h:64
size_t BfAntNum() const
Definition: config.h:39
void DciqCalibrationProc(size_t channel)
Definition: radio_calibrate_analog.cc:330