Agora
1.2.0
Agora project
|
Go to the documentation of this file.
21 #include "common_typedef_sdk.h"
22 #include "immintrin.h"
27 {
"ZF", 0}, {
"MMSE", 1}, {
"MRC", 2}};
53 static std::vector<std::vector<double>>
GetSequence(
size_t seq_len,
int type);
54 static std::vector<std::complex<float>>
Modulate(
55 const std::vector<int8_t>& in,
int type);
58 size_t pilot_sc_offset,
59 size_t pilot_sc_spacing);
62 size_t fft_size,
size_t data_sc_num,
size_t pilot_sc_offset,
63 size_t pilot_sc_spacing);
65 size_t pilot_sc_offset,
66 size_t pilot_sc_spacing);
68 static MKL_LONG
FFT(std::vector<std::complex<float>>& in_out,
int fft_size);
69 static MKL_LONG
IFFT(std::vector<std::complex<float>>& in_out,
int fft_size,
74 static std::vector<std::complex<float>>
FFTShift(
75 const std::vector<std::complex<float>>& in);
76 static std::vector<complex_float>
FFTShift(
77 const std::vector<complex_float>& in);
80 static float ComputeOfdmSnr(
const std::vector<std::complex<float>>& data_t,
81 size_t data_start_index,
size_t data_stop_index);
82 static size_t FindPilotSeq(
const std::vector<std::complex<float>>& iq,
83 const std::vector<std::complex<float>>& pilot,
85 static int FindLts(
const std::vector<std::complex<double>>& iq,
int seq_len);
87 static std::vector<T>
Convolve(std::vector<std::complex<T>>
const& f,
88 std::vector<std::complex<T>>
const& g);
90 static std::vector<std::complex<T>>
Csign(std::vector<std::complex<T>> iq);
91 static void Meshgrid(
const std::vector<int>& x_in,
92 const std::vector<int>& y_in,
93 std::vector<std::vector<int>>&
x,
94 std::vector<std::vector<int>>&
y);
96 return (__builtin_parity(
i & j) != 0 ? -1 : 1);
99 std::vector<std::complex<float>>
const& samps,
100 std::vector<float>
const& win,
size_t fft_size);
103 static float FindTone(std::vector<float>
const& magnitude,
double win_gain,
105 const size_t delta = 10);
106 static float MeasureTone(std::vector<std::complex<float>>
const& samps,
107 std::vector<float>
const& win,
double win_gain,
109 const size_t delta = 10);
111 const std::vector<std::complex<float>>& pilot,
size_t offset,
113 size_t cp_len,
bool interleaved_pilot,
bool time_domain =
true);
115 const std::vector<std::complex<float>>& in,
float alpha);
123 size_t N,
size_t prefix,
size_t cp,
float scale);
125 return std::abs(std::complex<float>(
d.re,
d.im));
127 static int FindBeaconAvx(
const std::vector<std::complex<float>>& iq,
128 const std::vector<std::complex<float>>& seq,
129 float corr_scale = 1.f);
132 static ssize_t
FindBeaconAvx(
const std::complex<int16_t>* iq,
133 const std::vector<std::complex<float>>& seq,
134 size_t sample_window,
float corr_scale = 1.f);
136 static std::vector<float>
CorrelateAvxS(std::vector<float>
const& f,
137 std::vector<float>
const& g);
138 static std::vector<float>
Abs2Avx(std::vector<std::complex<float>>
const& f);
139 static std::vector<int32_t>
Abs2Avx(
140 std::vector<std::complex<int16_t>>
const& f);
142 std::vector<std::complex<float>>
const& f,
const int dly,
143 const bool conj =
true);
145 std::vector<std::complex<int16_t>>
const& f,
const int dly,
146 const bool conj =
true);
148 std::vector<std::complex<float>>
const& f,
149 std::vector<std::complex<float>>
const& g);
151 std::vector<std::complex<float>>
const& f,
152 std::vector<std::complex<float>>
const& g,
const bool conj);
154 std::vector<std::complex<int16_t>>
const& f,
155 std::vector<std::complex<int16_t>>
const& g,
const bool conj);
157 std::vector<std::complex<int16_t>>
const& f,
158 std::vector<std::complex<int16_t>>
const& g);
162 static __m512 M512ComplexCf32Mult(__m512 data1, __m512 data2,
bool conj);
166 #endif // COMMSLIB_H_
class RadioSocket __attribute__
static float AbsCf(complex_float d)
Definition: comms-lib.h:124
int main(int argc, char *argv[])
Definition: user-main.cc:18
static MKL_LONG IFFT(std::vector< std::complex< float >> &in_out, int fft_size, bool normalize=true)
Definition: comms-lib.cc:410
static void Meshgrid(const std::vector< int > &x_in, const std::vector< int > &y_in, std::vector< std::vector< int >> &x, std::vector< std::vector< int >> &y)
Definition: comms-lib.cc:163
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
Definition: test_transpose.cc:22
auto printf(const S &fmt, const T &... args) -> int
Definition: printf.h:631
Definition: signal_handler.h:14
Agora project version configuration file.
static void ConvertShortToFloat(const short *in_buf, float *out_buf, size_t n_elems)
Produces outputs -1->+0.999.
Definition: datatype_conversion.h:41
static size_t FindPilotSeq(const std::vector< std::complex< float >> &iq, const std::vector< std::complex< float >> &pilot, size_t seq_len)
Definition: comms-lib.cc:32
static int FindLts(const std::vector< std::complex< double >> &iq, int seq_len)
Definition: comms-lib.cc:54
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
#define AVX_PACKED_CS
Definition: comms-lib-avx.cc:24
static std::vector< float > Abs2Avx(std::vector< std::complex< float >> const &f)
Definition: comms-lib-avx.cc:364
@ kZF
Definition: comms-lib.h:48
BeamformingAlgorithm
Definition: comms-lib.h:48
const std::string & GetAgoraProjectVersion()
Definition: version_config.h:10
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
const T * At(size_t dim1) const
Definition: memory_manage.h:93
#define AGORA_LOG_INIT()
Definition: logger.h:35
@ kQpsk
Definition: comms-lib.h:42
ModulationOrder
Definition: comms-lib.h:40
fft_size
Definition: inspect_agora_results.m:19
SequenceType
Definition: comms-lib.h:31
#define AVX_PACKED_SI
Definition: comms-lib-avx.cc:23
#define ALIGNMENT
Definition: comms-lib-avx.cc:21
end IFFT Reshape the symbol vector into two different spatial streams length(tx_syms)/NUM_UE
static float FindMaxAbs(const complex_float *in, size_t len)
Definition: comms-lib.cc:135
@ kStsSeq
Definition: comms-lib.h:32
#define AGORA_LOG_ERROR(...)
Definition: logger.h:39
#define TOSTRING(x)
Definition: symbols.h:14
static const std::map< std::string, size_t > kBeamformingStr
Definition: comms-lib.h:26
index
Definition: parse_all_dl.m:11
@ kQaM64
Definition: comms-lib.h:44
@ kBpsk
Definition: comms-lib.h:41
filename
Definition: parse_all_dl.m:14
constexpr std::chrono::duration< Rep, Period > abs(std::chrono::duration< Rep, Period > d)
Definition: chrono.h:1488
static std::vector< std::complex< float > > ComposePartialPilotSym(const std::vector< std::complex< float >> &pilot, size_t offset, size_t pilot_sc_num, size_t fft_size, size_t data_size, size_t data_start, size_t cp_len, bool interleaved_pilot, bool time_domain=true)
Definition: comms-lib.cc:634
@ kGoldIfft
Definition: comms-lib.h:36
static std::vector< T > Convolve(std::vector< std::complex< T >> const &f, std::vector< std::complex< T >> const &g)
Definition: comms-lib.cc:215
@ kQaM16
Definition: comms-lib.h:43
Aligned types for SIMD compatibility.
@ kLtsSeq
Definition: comms-lib.h:33
static std::vector< std::complex< float > > FFTShift(const std::vector< std::complex< float >> &in)
Definition: comms-lib.cc:581
static std::vector< std::complex< float > > ComplexMultAvx(std::vector< std::complex< float >> const &f, std::vector< std::complex< float >> const &g, const bool conj)
Definition: comms-lib-avx.cc:290
data_start
Definition: inspect_agora_results.m:17
uint16_t len
Definition: eth_common.h:62
for i
Definition: generate_data.m:107
@ kLtsFSeq
Definition: comms-lib.h:34
Plot Rx waveform for u
Definition: inspect_single_frame.m:108
Communications Library: a) Generate pilot/preamble sequences b) OFDM modulation.
static int Hadamard2(int i, int j)
Definition: comms-lib.h:95
static std::vector< float > HannWindowFunction(size_t fft_size)
Definition: comms-lib.cc:266
static void Ifft2tx(const complex_float *in, std::complex< short > *out, size_t N, size_t prefix, size_t cp, float scale)
Definition: comms-lib.cc:656
cp_len
Definition: inspect_agora_results.m:20
@ kLteZadoffChu
Definition: comms-lib.h:35
static float ComputeOfdmSnr(const std::vector< std::complex< float >> &data_t, size_t data_start_index, size_t data_stop_index)
Definition: comms-lib.cc:608
static MKL_LONG FFT(std::vector< std::complex< float >> &in_out, int fft_size)
Definition: comms-lib.cc:460
static std::vector< float > MagnitudeFft(std::vector< std::complex< float >> const &samps, std::vector< float > const &win, size_t fft_size)
Definition: comms-lib.cc:237
static float FindTone(std::vector< float > const &magnitude, double win_gain, double fft_bin, size_t fft_size, const size_t delta=10)
Definition: comms-lib.cc:295
static std::vector< std::complex< T > > Csign(std::vector< std::complex< T >> iq)
Definition: comms-lib.cc:190
static std::vector< std::complex< float > > Modulate(const std::vector< int8_t > &in, int type)
Definition: comms-lib.cc:663
static int FindBeaconAvx(const std::vector< std::complex< float >> &iq, const std::vector< std::complex< float >> &seq, float corr_scale=1.f)
Correlation and Peak detection of a beacon with Gold code (2 repetitions)
Definition: comms-lib-avx.cc:46
data_size
Definition: inspect_agora_results.m:16
x0
Definition: ofdmtxrx.py:399
for d
Definition: process_rx_frame.m:53
static std::vector< std::complex< float > > SeqCyclicShift(const std::vector< std::complex< float >> &in, float alpha)
Definition: comms-lib.cc:725
@ kQaM256
Definition: comms-lib.h:45
Definition: comms-lib.h:29
const T & first(const T &value, const Tail &...)
Definition: compile.h:178
@ kHadamard
Definition: comms-lib.h:37
Declaration file for the phy ue class.
fwrite(fileID, pilot_f, 'float')
fp normalize(fp value)
Definition: format-inl.h:288
static float FindMeanAbs(const complex_float *in, size_t len)
Definition: comms-lib.cc:155
static void RtAssert(bool condition, const char *throw_str)
Definition: utils.h:104
#define AGORA_LOG_SHUTDOWN()
Definition: logger.h:36
static std::vector< float > CorrelateAvxS(std::vector< float > const &f, std::vector< float > const &g)
Definition: comms-lib-avx.cc:505
noise
Definition: generate_data_dl.m:131
void PrintCoreAssignmentSummary()
Definition: utils.cc:85
static float MeasureTone(std::vector< std::complex< float >> const &samps, std::vector< float > const &win, double win_gain, double fft_bin, size_t fft_size, const size_t delta=10)
Definition: comms-lib.cc:317
Declaration file for the configuration class which importants json configuration values into class va...
static std::vector< std::complex< float > > AutoCorrMultAvx(std::vector< std::complex< float >> const &f, const int dly, const bool conj=true)
Definition: comms-lib-avx.cc:322
static double WindowFunctionPower(std::vector< float > const &win)
Definition: comms-lib.cc:285
static __m256 M256ComplexCf32Mult(__m256 data1, __m256 data2, bool conj)
Definition: comms-lib-avx.cc:196
@ kMRC
Definition: comms-lib.h:48
Utility functions for file and text processing.
DEFINE_string(conf_file, TOSTRING(PROJECT_DIRECTORY) "/files/config/ci/chsim.json", "Config filename")
void SetupSignalHandlers()
Definition: signal_handler.cc:44
static std::vector< size_t > GetNullSc(size_t fft_size, size_t data_sc_num)
Definition: comms-lib.cc:350
@ kMMSE
Definition: comms-lib.h:48
static std::vector< std::complex< float > > DoubleToCfloat(const std::vector< std::vector< double >> &in)
Definition: utils.cc:232
Definition: signal_handler.h:8
static __m256i M256ComplexCs16Mult(__m256i data1, __m256i data2, bool conj)
Definition: comms-lib-avx.cc:131
static std::vector< std::vector< double > > GetSequence(size_t seq_len, int type)
Definition: comms-lib.cc:734
static void ConvertFloatToShort(const float *in_buf, short *out_buf, size_t n_elems, size_t n_prefix=0, float scale_down_factor=1.0f)
Definition: datatype_conversion.h:237
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
result
Definition: format-inl.h:640
type
Definition: core.h:1131
#define AVX_PACKED_SP
Definition: comms-lib-avx.cc:22