Agora  1.2.0
Agora project
recorder_worker_hdf5.h
Go to the documentation of this file.
1 
5 #ifndef AGORA_RECORDER_WORKER_HDF5_H_
6 #define AGORA_RECORDER_WORKER_HDF5_H_
7 
8 #include <memory>
9 #include <string>
10 
11 #include "hdf5_lib.h"
12 #include "recorder_worker.h"
13 
14 namespace Agora_recorder {
15 
17  public:
18  explicit RecorderWorkerHDF5(const Config* in_cfg, size_t antenna_offset,
19  size_t num_antennas, size_t record_interval,
20  Direction rx_direction);
21  ~RecorderWorkerHDF5() override;
22 
23  void Init() final;
24  void Finalize() final;
25  int Record(const Packet* pkt) final;
26 
27  inline size_t NumAntennas() const final { return num_antennas_; }
28  inline size_t AntennaOffset() const final { return antenna_offset_; }
29 
30  private:
31  void Open();
32  void Close();
33 
34  void WriteDatasetValue(const Packet* pkt, size_t symbol_index,
35  size_t dataset_index);
36 
37  const Config* cfg_;
38 
40  size_t num_antennas_;
41  size_t interval_;
43 
44  std::unique_ptr<Hdf5Lib> hdf5_;
46  std::vector<std::pair<std::string, std::array<hsize_t, kDsDimsNum>>>
48  const std::array<hsize_t, kDsDimsNum> data_chunk_dims_;
49 };
50 }; /* End namespace Agora_recorder */
51 
52 #endif /* AGORA_RECORDER_WORKER_HDF5_H_ */
FrameStats::NumPilotSyms
size_t NumPilotSyms() const
Definition: framestats.cc:91
FrameStats::GetDLSymbolIdx
size_t GetDLSymbolIdx(size_t symbol_number) const
Definition: framestats.cc:152
CommsLib::GetPilotScValue
static std::vector< std::complex< float > > GetPilotScValue(size_t fft_size, size_t data_sc_num, size_t pilot_sc_offset, size_t pilot_sc_spacing)
Definition: comms-lib.cc:369
FrameStats::NumDLCalSyms
size_t NumDLCalSyms() const
Definition: framestats.cc:79
FrameStats::FrameIdentifier
const std::string & FrameIdentifier() const
Definition: framestats.h:70
Packet::frame_id_
uint32_t frame_id_
Definition: message.h:168
Config::UeAntNum
size_t UeAntNum() const
Definition: config.h:41
Config::Freq
double Freq() const
Definition: config.h:57
Agora_recorder::RecorderWorkerHDF5::Init
void Init() final
Definition: recorder_worker_hdf5.cc:47
FrameStats::IsRecCalEnabled
bool IsRecCalEnabled() const
Definition: framestats.cc:97
Config::SampsPerSymbol
size_t SampsPerSymbol() const
Definition: config.h:234
hdf5_lib.h
fmt::v8::printf
auto printf(const S &fmt, const T &... args) -> int
Definition: printf.h:631
version_config.h
Agora project version configuration file.
Config::Rate
double Rate() const
Definition: config.h:58
Config::RadioId
const std::vector< std::string > & RadioId() const
Definition: config.h:356
Config::NumChannels
size_t NumChannels() const
Definition: config.h:98
FrameStats::NumBeaconSyms
size_t NumBeaconSyms() const
Definition: framestats.cc:87
Config::OfdmTxZeroPrefix
size_t OfdmTxZeroPrefix() const
Definition: config.h:211
Agora_recorder::RecorderWorker
Definition: recorder_worker.h:18
Config::ClientTxGainA
double ClientTxGainA(size_t id) const
Definition: config.h:70
CommsLib::GetPilotScIdx
static std::vector< size_t > GetPilotScIdx(size_t fft_size, size_t data_sc_num, size_t pilot_sc_offset, size_t pilot_sc_spacing)
Definition: comms-lib.cc:390
Agora_recorder::RecorderWorkerHDF5::max_frame_number_
size_t max_frame_number_
Definition: recorder_worker_hdf5.h:45
Agora_recorder::kDebugPrint
static constexpr bool kDebugPrint
Definition: recorder_worker_hdf5.cc:19
Direction
Direction
Definition: symbols.h:39
Config::OfdmTxZeroPostfix
size_t OfdmTxZeroPostfix() const
Definition: config.h:212
GetAgoraProjectVersion
const std::string & GetAgoraProjectVersion()
Definition: version_config.h:10
SymbolType::kPilot
@ kPilot
Agora_recorder::RecorderWorkerHDF5::RecorderWorkerHDF5
RecorderWorkerHDF5(const Config *in_cfg, size_t antenna_offset, size_t num_antennas, size_t record_interval, Direction rx_direction)
Definition: recorder_worker_hdf5.cc:29
Agora_recorder::kFixedDimensions
static constexpr ssize_t kFixedDimensions
Definition: recorder_worker_hdf5.cc:21
Config::CpLen
size_t CpLen() const
Definition: config.h:46
Config::HubId
const std::vector< std::string > & HubId() const
Definition: config.h:359
CommsLib::GetDataSc
static std::vector< size_t > GetDataSc(size_t fft_size, size_t data_sc_num, size_t pilot_sc_offset, size_t pilot_sc_spacing)
Definition: comms-lib.cc:325
Agora_recorder::RecorderWorkerHDF5::data_chunk_dims_
const std::array< hsize_t, kDsDimsNum > data_chunk_dims_
Definition: recorder_worker_hdf5.h:48
Packet::data_
short data_[]
Definition: message.h:173
Agora_recorder::RecorderWorkerHDF5::Close
void Close()
Config::UeRadioId
const std::vector< std::string > & UeRadioId() const
Definition: config.h:362
recorder_worker.h
Recorder worker interface factory.
fft_size
fft_size
Definition: inspect_agora_results.m:19
FrameStats::GetULSymbolIdx
size_t GetULSymbolIdx(size_t symbol_number) const
Definition: framestats.cc:156
Config::BsAntNum
size_t BsAntNum() const
Definition: config.h:35
Packet::ant_id_
uint32_t ant_id_
Definition: message.h:171
Agora_recorder::kUplinkDatasetIndex
static constexpr size_t kUplinkDatasetIndex
Definition: recorder_worker_hdf5.cc:27
Agora_recorder::kDownlinkDatasetIndex
static constexpr size_t kDownlinkDatasetIndex
Definition: recorder_worker_hdf5.cc:25
Config::RxGainB
double RxGainB() const
Definition: config.h:67
AGORA_LOG_ERROR
#define AGORA_LOG_ERROR(...)
Definition: logger.h:39
Agora_recorder
Definition: hdf5_lib.cc:17
Agora_recorder::RecorderWorkerHDF5::num_antennas_
size_t num_antennas_
Definition: recorder_worker_hdf5.h:40
Direction::kUplink
@ kUplink
Config::Frame
const FrameStats & Frame() const
Definition: config.h:340
AGORA_LOG_TRACE
#define AGORA_LOG_TRACE(...)
Definition: logger.h:92
Agora_recorder::RecorderWorkerHDF5::antenna_offset_
size_t antenna_offset_
Definition: recorder_worker_hdf5.h:39
Config::MCSParams
const nlohmann::json & MCSParams(Direction dir) const
Definition: config.h:288
Agora_recorder::RecorderWorkerHDF5::~RecorderWorkerHDF5
~RecorderWorkerHDF5() override
Config::OfdmDataNum
size_t OfdmDataNum() const
Definition: config.h:47
Config::TraceFilename
const std::string & TraceFilename() const
Definition: config.h:566
Packet::cell_id_
uint32_t cell_id_
Definition: message.h:170
Config::UlTxFreqDataFiles
const std::vector< std::string > & UlTxFreqDataFiles(void) const
Definition: config.h:568
Agora_recorder::kPilotDatasetIndex
static constexpr size_t kPilotDatasetIndex
Definition: recorder_worker_hdf5.cc:26
FrameStats::ClientUlPilotSymbols
size_t ClientUlPilotSymbols() const
Definition: framestats.h:73
Agora_recorder::RecorderWorkerHDF5
Definition: recorder_worker_hdf5.h:16
i
for i
Definition: generate_data.m:107
Config::OfdmCaNum
size_t OfdmCaNum() const
Definition: config.h:45
SymbolType::kBeacon
@ kBeacon
u
Plot Rx waveform for u
Definition: inspect_single_frame.m:108
nlohmann::json_v3_11_1NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON::basic_json::dump
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
comms-lib.h
Communications Library: a) Generate pilot/preamble sequences b) OFDM modulation.
Config::OfdmPilotSpacing
size_t OfdmPilotSpacing() const
Definition: config.h:51
spdlog::details::os::localtime
SPDLOG_INLINE std::tm localtime(const std::time_t &time_tt) SPDLOG_NOEXCEPT
Definition: os-inl.h:84
Agora_recorder::RecorderWorkerHDF5::NumAntennas
size_t NumAntennas() const final
Definition: recorder_worker_hdf5.h:27
Config::ClientTxGainB
double ClientTxGainB(size_t id) const
Definition: config.h:76
Packet
Definition: message.h:164
Direction::kDownlink
@ kDownlink
Packet::symbol_id_
uint32_t symbol_id_
Definition: message.h:169
start
end start
Definition: inspect_agora_results.m:95
Config::FramesToTest
size_t FramesToTest() const
Definition: config.h:309
Agora_recorder::RecorderWorkerHDF5::rx_direction_
Direction rx_direction_
Definition: recorder_worker_hdf5.h:42
Agora_recorder::RecorderWorkerHDF5::Open
void Open()
nlohmann::json_v3_11_1NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON::basic_json
a class to store JSON values
Definition: json.hpp:3367
Config::ConfigFilename
const std::string & ConfigFilename() const
Definition: config.h:565
Agora_recorder::RecorderWorkerHDF5::cfg_
const Config * cfg_
Definition: recorder_worker_hdf5.h:37
Config::OfdmDataStart
size_t OfdmDataStart() const
Definition: config.h:48
FrameStats::NumULCalSyms
size_t NumULCalSyms() const
Definition: framestats.cc:81
FrameStats::ClientDlPilotSymbols
size_t ClientDlPilotSymbols() const
Definition: framestats.h:76
FrameStats::NumDLSyms
size_t NumDLSyms() const
Definition: framestats.cc:83
json.hpp
extract_version.data
dictionary data
Definition: extract_version.py:8
FrameStats::GetPilotSymbolIdx
size_t GetPilotSymbolIdx(size_t symbol_number) const
Definition: framestats.cc:160
Agora_recorder::RecorderWorkerHDF5::Record
int Record(const Packet *pkt) final
Definition: recorder_worker_hdf5.cc:399
Agora_recorder::kBeaconDatasetIndex
static constexpr size_t kBeaconDatasetIndex
Definition: recorder_worker_hdf5.cc:24
Config::GetSymbolType
SymbolType GetSymbolType(size_t symbol_id) const
Return the symbol type of this symbol in this frame.
Definition: config.cc:1557
FrameStats::GetBeaconSymbolIdx
size_t GetBeaconSymbolIdx(size_t symbol_number) const
Definition: framestats.cc:148
Agora_recorder::kFrameInc
static constexpr size_t kFrameInc
Definition: recorder_worker_hdf5.cc:20
FrameStats::NumULSyms
size_t NumULSyms() const
Definition: framestats.cc:85
Agora_recorder::RecorderWorkerHDF5::datasets_
std::vector< std::pair< std::string, std::array< hsize_t, kDsDimsNum > > > datasets_
Definition: recorder_worker_hdf5.h:47
Config::Beamsweep
bool Beamsweep() const
Definition: config.h:105
Config::ClientRxGainB
double ClientRxGainB(size_t id) const
Definition: config.h:79
Config::NumUeChannels
size_t NumUeChannels() const
Definition: config.h:99
Config
Definition: config.h:26
AGORA_LOG_INFO
#define AGORA_LOG_INFO(...)
Definition: logger.h:62
Agora_recorder::RecorderWorkerHDF5::WriteDatasetValue
void WriteDatasetValue(const Packet *pkt, size_t symbol_index, size_t dataset_index)
Definition: recorder_worker_hdf5.cc:376
RtAssert
static void RtAssert(bool condition, const char *throw_str)
Definition: utils.h:104
Config::Modulation
std::string Modulation(Direction dir) const
Definition: config.h:243
Config::NumCells
size_t NumCells() const
Definition: config.h:94
Agora_recorder::RecorderWorkerHDF5::AntennaOffset
size_t AntennaOffset() const final
Definition: recorder_worker_hdf5.h:28
Config::ClientRxGainA
double ClientRxGainA(size_t id) const
Definition: config.h:73
Config::RxGainA
double RxGainA() const
Definition: config.h:65
SymbolType::kUL
@ kUL
Agora_recorder::kHdf5Group
static const std::string kHdf5Group
Definition: recorder_worker_hdf5.cc:22
Config::TxGainB
double TxGainB() const
Definition: config.h:66
recorder_worker_hdf5.h
Config::BeaconAnt
size_t BeaconAnt() const
Definition: config.h:102
Config::CommonPilot
const std::vector< std::complex< float > > & CommonPilot() const
Definition: config.h:353
Config::OfdmDataStop
size_t OfdmDataStop() const
Definition: config.h:50
FrameStats::NumTotalSyms
size_t NumTotalSyms() const
Definition: framestats.cc:93
Config::TxGainA
double TxGainA() const
Definition: config.h:64
Agora_recorder::RecorderWorkerHDF5::hdf5_
std::unique_ptr< Hdf5Lib > hdf5_
Definition: recorder_worker_hdf5.h:44
SymbolType::kDL
@ kDL
Agora_recorder::RecorderWorkerHDF5::Finalize
void Finalize() final
Definition: recorder_worker_hdf5.cc:374
Agora_recorder::RecorderWorkerHDF5::interval_
size_t interval_
Definition: recorder_worker_hdf5.h:41