Agora  1.2.0
Agora project
dofft.h
Go to the documentation of this file.
1 
5 #ifndef DOFFT_H_
6 #define DOFFT_H_
7 
8 #include <complex>
9 #include <cstdint>
10 
11 #include "common_typedef_sdk.h"
12 #include "config.h"
13 #include "doer.h"
14 #include "memory_manage.h"
15 #include "message.h"
16 #include "mkl_dfti.h"
17 #include "phy_stats.h"
18 #include "stats.h"
19 #include "symbols.h"
20 
21 class DoFFT : public Doer {
22  public:
23  DoFFT(Config* config, size_t tid, Table<complex_float>& data_buffer,
25  Table<complex_float>& calib_dl_buffer,
26  Table<complex_float>& calib_ul_buffer, PhyStats* in_phy_stats,
27  Stats* stats_manager);
28  ~DoFFT() override;
29 
62  EventData Launch(size_t tag) override;
63 
94  void PartialTranspose(complex_float* out_buf, size_t ant_id,
95  SymbolType symbol_type) const;
96 
97  private:
102  DFTI_DESCRIPTOR_HANDLE mkl_handle_;
103  complex_float* fft_inout_; // Buffer for both FFT input and output
104  complex_float* fft_shift_tmp_; // Buffer for both FFT input and output
105 
106  // Buffer for store 16-bit IQ converted from 12-bit IQ
107  uint16_t* temp_16bits_iq_;
108  std::complex<float>* rx_samps_tmp_; // Temp buffer for received samples
109 
113 };
114 
115 #endif // DOFFT_H_
PhyStats
Definition: phy_stats.h:15
DoFFT::duration_stat_csi_
DurationStat * duration_stat_csi_
Definition: dofft.h:111
Packet::frame_id_
uint32_t frame_id_
Definition: message.h:168
complex_float
Definition: test_transpose.cc:22
SymbolType::kCalDL
@ kCalDL
Config::SampsPerSymbol
size_t SampsPerSymbol() const
Definition: config.h:234
fmt::v8::printf
auto printf(const S &fmt, const T &... args) -> int
Definition: printf.h:631
datatype_conversion.h
DoFFT::mkl_handle_
DFTI_DESCRIPTOR_HANDLE mkl_handle_
Definition: dofft.h:102
Config::NumChannels
size_t NumChannels() const
Definition: config.h:98
DoFFT::fft_shift_tmp_
complex_float * fft_shift_tmp_
Definition: dofft.h:104
kUse12BitIQ
static constexpr bool kUse12BitIQ
Definition: symbols.h:178
CommsLib::Abs2Avx
static std::vector< float > Abs2Avx(std::vector< std::complex< float >> const &f)
Definition: comms-lib-avx.cc:364
SymbolType::kPilot
@ kPilot
Stats
Definition: stats.h:63
DurationStat::task_duration_
std::array< size_t, kMaxStatBreakdown > task_duration_
Definition: stats.h:23
SimdConvertFloat16ToFloat32
static void SimdConvertFloat16ToFloat32(float *out_buf, const float *in_buf, size_t n_elems)
Definition: datatype_conversion.h:547
concurrent_queue_wrapper.h
Config::OfdmRxZeroPrefixBs
size_t OfdmRxZeroPrefixBs() const
Definition: config.h:215
kFrameWnd
static constexpr size_t kFrameWnd
Definition: symbols.h:18
DoFFT::calib_dl_buffer_
Table< complex_float > & calib_dl_buffer_
Definition: dofft.h:100
Agora_memory::PaddedAlignedAlloc
void * PaddedAlignedAlloc(Alignment_t alignment, size_t size)
Definition: memory_manage.cc:15
Packet::data_
short data_[]
Definition: message.h:173
DoFFT::Launch
EventData Launch(size_t tag) override
Definition: dofft.cc:89
fft_req_tag_t
rx_tag_t fft_req_tag_t
Definition: message.h:241
Config::OfdmRxZeroPrefixCalUl
size_t OfdmRxZeroPrefixCalUl() const
Definition: config.h:219
memory_manage.h
Config::BsAntNum
size_t BsAntNum() const
Definition: config.h:35
Packet::ant_id_
uint32_t ant_id_
Definition: message.h:171
kTransposeBlockSize
static constexpr size_t kTransposeBlockSize
Definition: symbols.h:340
Config::RefRadio
size_t RefRadio(size_t id) const
Definition: config.h:101
Config::Frame
const FrameStats & Frame() const
Definition: config.h:340
DoerType::kCSI
@ kCSI
AGORA_LOG_TRACE
#define AGORA_LOG_TRACE(...)
Definition: logger.h:92
Config::GetDataBuf
complex_float * GetDataBuf(Table< complex_float > &data_buffers, size_t frame_id, size_t symbol_id) const
Definition: config.h:471
kSCsPerCacheline
static constexpr size_t kSCsPerCacheline
Definition: symbols.h:312
Doer
Definition: doer.h:17
mean
static double mean(const std::vector< double > in_vec)
Definition: timer.h:103
Doer::tid_
int tid_
Definition: doer.h:65
Table< complex_float >
DoFFT::fft_inout_
complex_float * fft_inout_
Definition: dofft.h:103
Config::OfdmRxZeroPrefixCalDl
size_t OfdmRxZeroPrefixCalDl() const
Definition: config.h:225
kUsePartialTrans
static constexpr bool kUsePartialTrans
Definition: symbols.h:183
Config::PilotCf32
const std::vector< std::complex< float > > & PilotCf32() const
Definition: config.h:341
Config::PilotsSgn
const complex_float * PilotsSgn() const
Definition: config.h:352
fmt::v8::detail::abs
constexpr std::chrono::duration< Rep, Period > abs(std::chrono::duration< Rep, Period > d)
Definition: chrono.h:1488
Config::OfdmDataNum
size_t OfdmDataNum() const
Definition: config.h:47
kDebugPrintInTask
static constexpr bool kDebugPrintInTask
Definition: symbols.h:201
DoFFT::temp_16bits_iq_
uint16_t * temp_16bits_iq_
Definition: dofft.h:107
SimdConvertShortToFloat
static void SimdConvertShortToFloat(const short *in_buf, float *out_buf, size_t n_elems)
Definition: datatype_conversion.h:126
stats.h
Declaration file for the Stats class. Includes definations for DurationStat and FrameSummery types.
EventData
Definition: message.h:142
DoFFT::phy_stats_
PhyStats * phy_stats_
Definition: dofft.h:112
DurationStat::task_count_
size_t task_count_
Definition: stats.h:24
PtrGrid< kFrameWnd, kMaxUEs, complex_float >
Config::FftInRru
bool FftInRru() const
Definition: config.h:311
DoFFT::rx_samps_tmp_
std::complex< float > * rx_samps_tmp_
Definition: dofft.h:108
dofft.h
Declaration file for the DoFFT class.
Packet::cell_id_
uint32_t cell_id_
Definition: message.h:170
PhyStats::UpdateCalibPilotSnr
void UpdateCalibPilotSnr(size_t frame_id, size_t calib_sym_id, size_t ant_id, complex_float *fft_data)
Definition: phy_stats.cc:438
EventType::kFFT
@ kFFT
message.h
Self defined functions for message storage and passing.
i
for i
Definition: generate_data.m:107
Config::OfdmCaNum
size_t OfdmCaNum() const
Definition: config.h:45
DoFFT
Definition: dofft.h:21
Catch::cout
std::ostream & cout()
PhyStats::UpdateUlPilotSnr
void UpdateUlPilotSnr(size_t frame_id, size_t ue_id, size_t ant_id, complex_float *fft_data)
Definition: phy_stats.cc:456
comms-lib.h
Communications Library: a) Generate pilot/preamble sequences b) OFDM modulation.
Agora_memory::Alignment_t::kAlign64
@ kAlign64
Packet
Definition: message.h:164
Packet::symbol_id_
uint32_t symbol_id_
Definition: message.h:169
gen_tag_t::tag_
size_t tag_
Definition: message.h:43
fmt::v8::arg
auto arg(const Char *name, const T &arg) -> detail::named_arg< Char, T >
Definition: core.h:1887
kPrintFFTInput
static constexpr bool kPrintFFTInput
Definition: dofft.cc:12
DoFFT::csi_buffers_
PtrGrid< kFrameWnd, kMaxUEs, complex_float > & csi_buffers_
Definition: dofft.h:99
SimdConvert12bitIqToFloat
static void SimdConvert12bitIqToFloat(const uint8_t *in_buf, float *out_buf, const uint16_t *in_16bits_buf, size_t n_elems)
Definition: datatype_conversion.h:405
Config::OfdmDataStart
size_t OfdmDataStart() const
Definition: config.h:48
symbols.h
DurationStat
Definition: stats.h:22
DoFFT::calib_ul_buffer_
Table< complex_float > & calib_ul_buffer_
Definition: dofft.h:101
RxPacket::RawPacket
Packet * RawPacket()
Definition: message.h:213
kPrintInputPilot
static constexpr bool kPrintInputPilot
Definition: dofft.cc:13
Doer::cfg_
Config * cfg_
Definition: doer.h:64
ofdmtxrx.x0
x0
Definition: ofdmtxrx.py:399
FrameStats::GetPilotSymbolIdx
size_t GetPilotSymbolIdx(size_t symbol_number) const
Definition: framestats.cc:160
Config::GetSymbolType
SymbolType GetSymbolType(size_t symbol_id) const
Return the symbol type of this symbol in this frame.
Definition: config.cc:1557
Config::RecipCalUlRxIndex
size_t RecipCalUlRxIndex(size_t frame_id, size_t ant) const
Definition: config.h:145
CalibRegressionEstimate
static void CalibRegressionEstimate(const arma::cx_fvec &in_vec, arma::cx_fvec &out_vec, size_t x0)
Definition: dofft.cc:60
GetTime::WorkerRdtsc
static size_t WorkerRdtsc()
Definition: gettime.h:34
kPrintPilotCorrStats
static constexpr bool kPrintPilotCorrStats
Definition: dofft.cc:14
Config
Definition: config.h:26
doer.h
Declaration file for the Doer class. The is the base class for all agora doers.
Config::RefAnt
size_t RefAnt(size_t id) const
Definition: config.h:100
DoFFT::data_buffer_
Table< complex_float > & data_buffer_
Definition: dofft.h:98
RtAssert
static void RtAssert(bool condition, const char *throw_str)
Definition: utils.h:104
DoFFT::DoFFT
DoFFT(Config *config, size_t tid, Table< complex_float > &data_buffer, PtrGrid< kFrameWnd, kMaxUEs, complex_float > &csi_buffers, Table< complex_float > &calib_dl_buffer, Table< complex_float > &calib_ul_buffer, PhyStats *in_phy_stats, Stats *stats_manager)
Definition: dofft.cc:16
kCollectPhyStats
static constexpr bool kCollectPhyStats
Definition: symbols.h:192
gen_tag_t::FrmSym
static gen_tag_t FrmSym(size_t frame_id, size_t symbol_id)
Definition: message.h:128
to_string
std::string to_string() const
Definition: eth_common.h:64
config.h
Declaration file for the configuration class which importants json configuration values into class va...
SymbolType
SymbolType
Definition: symbols.h:261
DoFFT::~DoFFT
~DoFFT() override
Definition: dofft.cc:48
Config::RecipCalDlAnt
size_t RecipCalDlAnt(size_t frame_id, size_t dl_cal_symbol) const
Definition: config.h:119
SymbolType::kCalUL
@ kCalUL
CommsLib::M256ComplexCf32Mult
static __m256 M256ComplexCf32Mult(__m256 data1, __m256 data2, bool conj)
Definition: comms-lib-avx.cc:196
phy_stats.h
Declaration file for the PhyStats class.
DoFFT::PartialTranspose
void PartialTranspose(complex_float *out_buf, size_t ant_id, SymbolType symbol_type) const
Definition: dofft.cc:269
DoFFT::duration_stat_fft_
DurationStat * duration_stat_fft_
Definition: dofft.h:110
SymbolType::kUL
@ kUL
RxPacket::Free
void Free()
Definition: message.h:216
CommsLib::CorrelateAvx
static std::vector< std::complex< float > > CorrelateAvx(std::vector< std::complex< float >> const &f, std::vector< std::complex< float >> const &g)
Definition: comms-lib-avx.cc:463
DoerType::kFFT
@ kFFT
Stats::GetDurationStat
DurationStat * GetDurationStat(DoerType doer_type, size_t thread_id)
Definition: stats.h:162
rx_tag_t::rx_packet_
RxPacket * rx_packet_
Definition: message.h:228