Agora
1.2.0
Agora project
|
Go to the documentation of this file.
6 #ifndef RADIO_SOAPYSDR_H_
7 #define RADIO_SOAPYSDR_H_
11 #include "SoapySDR/Device.hpp"
21 void Init(
const Config* cfg,
size_t id,
const std::string& serial,
22 const std::vector<size_t>& enabled_channels,
bool hw_framer)
final;
23 void Setup(
const std::vector<double>& tx_gains,
24 const std::vector<double>& rx_gains)
final;
26 long long act_time_ns = 0,
size_t samples = 0)
final;
32 long long& tx_time_ns)
final;
34 int Rx(std::vector<std::vector<std::complex<int16_t>>>&
rx_data,
35 size_t rx_size,
RxFlags& out_flags,
long long& rx_time_ns)
final;
37 int Rx(std::vector<std::vector<std::complex<int16_t>>*>& rx_buffs,
38 size_t rx_size,
RxFlags& out_flags,
long long& rx_time_ns)
final;
40 int Rx(std::vector<void*>& rx_locs,
size_t rx_size,
RxFlags& out_flags,
41 long long& rx_time_ns)
final;
56 void InitRefTx(
size_t channel,
double freq);
57 void InitCalRx(
size_t channel,
double center_freq);
61 void SetRxGain(
size_t channel,
const std::string& gain_stage,
double value);
62 void SetTxGain(
size_t channel,
const std::string& gain_stage,
double value);
65 void SetDcOffset(
int direction,
size_t channel, std::complex<double> dc_corr);
67 std::complex<double> i_qcorr);
69 void SetFreqBb(
size_t channel,
double freq);
70 void SetFreqRf(
size_t channel,
double freq);
72 void InitAgc(
bool enabled,
size_t setting);
74 std::vector<std::complex<float>>
SnoopSamples(
size_t channel,
85 std::unique_ptr<RadioDataPlane>
rxp_;
90 #endif // RADIO_SOAPYSDR_H_
virtual void Init(const Config *cfg, size_t id, const std::string &serial, const std::vector< size_t > &enabled_channels, bool hw_framer)=0
Definition: radio.cc:46
Defination file for the Radio class.
DataPlaneType
Definition: radio_data_plane.h:18
size_t Id() const
Definition: radio.h:27
const std::string & FrameIdentifier() const
Definition: framestats.h:70
static constexpr size_t kSoapyMakeMaxAttempts
Definition: radio_soapysdr.cc:17
double Freq() const
Definition: config.h:57
void StopRefTx(size_t channel)
Definition: radio_soapysdr.cc:772
size_t SampsPerSymbol() const
Definition: config.h:234
void ResetTxGains()
Definition: radio_soapysdr.cc:722
double Rate() const
Definition: config.h:58
std::string UeChannel() const
Definition: config.h:114
size_t NumChannels() const
Definition: config.h:98
std::unique_ptr< RadioDataPlane > rxp_
Definition: radio_soapysdr.h:85
void ResetRxGains()
Definition: radio_soapysdr.cc:732
std::vector< std::complex< float > > SnoopSamples(size_t channel, size_t read_size)
Definition: radio_soapysdr.cc:756
size_t GetPilotSymbol(size_t location) const
Definition: framestats.cc:122
size_t OfdmTxZeroPrefix() const
Definition: config.h:211
const std::string & IpAddress() const
Definition: radio_soapysdr.h:78
const std::vector< size_t > & EnabledChannels() const
Definition: radio.h:71
void InitCalRx(size_t channel, double center_freq)
Definition: radio_soapysdr.cc:713
std::string ip_address_
Definition: radio_soapysdr.h:84
static constexpr int kIrisDriverRelMinAPI
Definition: radio_soapysdr.cc:30
void SetTxCalGain(size_t channel)
Definition: radio_soapysdr.cc:742
GeneratorWrapper< T > value(T &&value)
Definition: catch.hpp:3999
void SetTimeAtTrigger(long long time_ns=0) final
Definition: radio_soapysdr.cc:579
void ReadSensor() const final
Definition: radio_soapysdr.cc:559
static constexpr int kSoapyMinorMinAPI
Definition: radio_soapysdr.cc:23
void SetDcOffset(int direction, size_t channel, std::complex< double > dc_corr)
Definition: radio_soapysdr.cc:777
static constexpr int kIrisDriverDayMinAPI
Definition: radio_soapysdr.cc:29
ActivationTypes
Definition: radio.h:23
const std::vector< uint32_t > & Beacon() const
Definition: config.h:350
SoapySDR::Device * SoapyDevice() const
Definition: radio_soapysdr.h:77
@ info
Definition: common.h:215
#define AGORA_LOG_ERROR(...)
Definition: logger.h:39
static constexpr int kIrisDriverYearMinAPI
Definition: radio_soapysdr.cc:27
double BwFilter() const
Definition: config.h:62
const FrameStats & Frame() const
Definition: config.h:340
bool fill(const std::vector< Numeric > &x, const std::vector< Numeric > &y, const std::map< std::string, std::string > &keywords)
Definition: matplotlibcpp.h:790
double RadioRfFreq() const
Definition: config.h:61
bool HwFramer() const
Definition: radio.h:29
#define AGORA_LOG_TRACE(...)
Definition: logger.h:92
const std::string & SerialNumber() const
Definition: radio.h:28
int Rx(std::vector< std::vector< std::complex< int16_t >>> &rx_data, size_t rx_size, RxFlags &out_flags, long long &rx_time_ns) final
Definition: radio_soapysdr.cc:522
double Nco() const
Definition: config.h:59
void ClearSyncDelay() final
Definition: radio_soapysdr.cc:706
SoapySDR::Device * dev_
Definition: radio_soapysdr.h:83
static constexpr bool kPrintRadioSettings
Definition: radio_soapysdr.cc:18
static constexpr int kSoapyBuildMinAPI
Definition: radio_soapysdr.cc:24
void Flush() final
Definition: radio_soapysdr.cc:972
void SetFreqRf(size_t channel, double freq)
Definition: radio_soapysdr.cc:796
void Deactivate() final
Definition: radio_soapysdr.cc:469
bool correlator_enabled_
Definition: radio_soapysdr.h:87
void Activate(Radio::ActivationTypes type=Radio::ActivationTypes::kActivate, long long act_time_ns=0, size_t samples=0) final
Definition: radio_soapysdr.cc:419
void Trigger() final
Definition: radio_soapysdr.cc:557
virtual void Close()=0
Definition: radio.cc:35
TxFlags
Definition: radio.h:20
void InitRefTx(size_t channel, double freq)
Definition: radio_soapysdr.cc:708
auto find(Ptr first, Ptr last, T value, Ptr &out) -> bool
Definition: core.h:2258
Defination file for the RadioSoapySdr class.
void Init(const Config *cfg, size_t id, const std::string &serial, const std::vector< size_t > &enabled_channels, bool hw_framer) final
Definition: radio_soapysdr.cc:108
for i
Definition: generate_data.m:107
j template void())
Definition: json.hpp:4744
void SetRxGain(size_t channel, const std::string &gain_stage, double value)
Definition: radio_soapysdr.cc:751
static constexpr int kIrisDriverMonthMinAPI
Definition: radio_soapysdr.cc:28
const Config * cfg_
Definition: radio.h:78
string_t dump(const int indent=-1, const char indent_char=' ', const bool ensure_ascii=false, const error_handler_t error_handler=error_handler_t::strict) const
serialization
Definition: json.hpp:20228
Communications Library: a) Generate pilot/preamble sequences b) OFDM modulation.
long long GetTimeNs() final
Definition: radio_soapysdr.cc:596
void InitAgc(bool enabled, size_t setting)
Definition: radio_soapysdr.cc:945
static int Hadamard2(int i, int j)
Definition: comms-lib.h:95
static constexpr bool kUseUHD
Definition: symbols.h:162
void SetIQBalance(int direction, size_t channel, std::complex< double > i_qcorr)
Definition: radio_soapysdr.cc:782
end start
Definition: inspect_agora_results.m:95
SoapySDR::Stream * txs_
Definition: radio_soapysdr.h:86
void SetFreqBb(size_t channel, double freq)
Definition: radio_soapysdr.cc:791
a class to store JSON values
Definition: json.hpp:3367
RxFlags
Definition: radio.h:19
static constexpr size_t kUhdInitTimeSec
Definition: radio_soapysdr.cc:33
void AdjustDelay(const std::string &delay) final
Definition: radio_soapysdr.cc:787
bool Beamsweep() const
Definition: config.h:105
Definition: radio_data_plane.h:16
static std::vector< std::complex< float > > Uint32tocfloat(const std::vector< uint32_t > &in, const std::string &order)
Definition: utils.cc:243
size_t NumUeChannels() const
Definition: config.h:99
#define AGORA_LOG_INFO(...)
Definition: logger.h:62
#define AGORA_LOG_FRAME(...)
Definition: logger.h:72
void PrintSettings() const final
Definition: radio_soapysdr.cc:609
#define AGORA_LOG_WARN(...)
Definition: logger.h:53
size_t BeaconLen() const
Definition: config.h:103
std::string to_string() const
Definition: eth_common.h:64
Declaration file for the configuration class which importants json configuration values into class va...
bool SingleGain() const
Definition: config.h:63
void Correlator(bool enable)
Definition: radio_soapysdr.cc:955
case QPSK rx_data
Definition: generate_data.m:160
void ConfigureTddModeBs(bool is_ref_radio) final
Definition: radio_soapysdr.cc:801
static constexpr double kAttnMax
Definition: radio_soapysdr.cc:19
RadioSoapySdr(RadioDataPlane::DataPlaneType rx_dp_type)
Definition: radio_soapysdr.cc:35
void Setup(const std::vector< double > &tx_gains, const std::vector< double > &rx_gains) final
Definition: radio_soapysdr.cc:291
size_t NumRadios() const
Definition: config.h:95
static constexpr bool kDebugRadioTX
Definition: symbols.h:208
sched
Definition: mm_gui.py:111
void SetTxGain(size_t channel, const std::string &gain_stage, double value)
Definition: radio_soapysdr.cc:746
int Tx(const void *const *tx_buffs, size_t tx_size, Radio::TxFlags tx_flags, long long &tx_time_ns) final
Definition: radio_soapysdr.cc:486
~RadioSoapySdr() final
Definition: radio_soapysdr.cc:81
void ConfigureTddModeUe() final
Definition: radio_soapysdr.cc:878
void StartRefTx(size_t channel)
Definition: radio_soapysdr.cc:765
size_t BeaconAnt() const
Definition: config.h:102
void Close() final
Definition: radio_soapysdr.cc:89
const std::vector< uint32_t > & Pilot() const
Definition: config.h:349
static constexpr int kSoapyMajorMinAPI
Definition: radio_soapysdr.cc:22
Definition: radio_soapysdr.h:16
size_t NumTotalSyms() const
Definition: framestats.cc:93
Declaration file for the RadioDataPlane Class.
type
Definition: core.h:1131
const std::vector< uint32_t > & Coeffs() const
Definition: config.h:347