Agora  1.2.0
Agora project
CommsLib Class Reference

#include <comms-lib.h>

Public Types

enum  SequenceType {
  kStsSeq, kLtsSeq, kLtsFSeq, kLteZadoffChu,
  kGoldIfft, kHadamard
}
 
enum  ModulationOrder {
  kBpsk = 1, kQpsk = 2, kQaM16 = 4, kQaM64 = 6,
  kQaM256 = 8
}
 
enum  BeamformingAlgorithm { kZF = 0, kMMSE = 1, kMRC = 2 }
 

Public Member Functions

 CommsLib (std::string)
 
 ~CommsLib ()
 

Static Public Member Functions

static std::vector< std::vector< double > > GetSequence (size_t seq_len, int type)
 
static std::vector< std::complex< float > > Modulate (const std::vector< int8_t > &in, int type)
 
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)
 
static std::vector< size_t > GetNullSc (size_t fft_size, size_t data_sc_num)
 
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)
 
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)
 
static MKL_LONG FFT (std::vector< std::complex< float >> &in_out, int fft_size)
 
static MKL_LONG IFFT (std::vector< std::complex< float >> &in_out, int fft_size, bool normalize=true)
 
static MKL_LONG FFT (complex_float *in_out, int fft_size)
 
static MKL_LONG IFFT (complex_float *in_out, int fft_size, bool normalize=true)
 
static std::vector< std::complex< float > > FFTShift (const std::vector< std::complex< float >> &in)
 
static std::vector< complex_floatFFTShift (const std::vector< complex_float > &in)
 
static void FFTShift (complex_float *in, complex_float *tmp, int fft_size)
 
static float ComputeOfdmSnr (const std::vector< std::complex< float >> &data_t, size_t data_start_index, size_t data_stop_index)
 
static size_t FindPilotSeq (const std::vector< std::complex< float >> &iq, const std::vector< std::complex< float >> &pilot, size_t seq_len)
 
static int FindLts (const std::vector< std::complex< double >> &iq, int seq_len)
 
template<typename T >
static std::vector< TConvolve (std::vector< std::complex< T >> const &f, std::vector< std::complex< T >> const &g)
 
template<typename T >
static std::vector< std::complex< T > > Csign (std::vector< std::complex< T >> iq)
 
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)
 
static int Hadamard2 (int i, int j)
 
static std::vector< float > MagnitudeFft (std::vector< std::complex< float >> const &samps, std::vector< float > const &win, size_t fft_size)
 
static std::vector< float > HannWindowFunction (size_t fft_size)
 
static double WindowFunctionPower (std::vector< float > const &win)
 
static float FindTone (std::vector< float > const &magnitude, double win_gain, double fft_bin, size_t fft_size, const size_t delta=10)
 
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)
 
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)
 
static std::vector< std::complex< float > > SeqCyclicShift (const std::vector< std::complex< float >> &in, float alpha)
 
static float FindMaxAbs (const complex_float *in, size_t len)
 
static float FindMaxAbs (const Table< complex_float > &in, size_t dim1, size_t dim2)
 
static float FindMeanAbs (const complex_float *in, size_t len)
 
static float FindMeanAbs (const Table< complex_float > &in, size_t dim1, size_t dim2)
 
static void Ifft2tx (const complex_float *in, std::complex< short > *out, size_t N, size_t prefix, size_t cp, float scale)
 
static float AbsCf (complex_float d)
 
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) More...
 
static ssize_t FindBeaconAvx (const std::complex< int16_t > *iq, const std::vector< std::complex< float >> &seq, size_t sample_window, float corr_scale=1.f)
 Find Beacon with raw samples from the radio. More...
 
static std::vector< float > CorrelateAvxS (std::vector< float > const &f, std::vector< float > const &g)
 
static std::vector< float > Abs2Avx (std::vector< std::complex< float >> const &f)
 
static std::vector< int32_t > Abs2Avx (std::vector< std::complex< int16_t >> const &f)
 
static std::vector< std::complex< float > > AutoCorrMultAvx (std::vector< std::complex< float >> const &f, const int dly, const bool conj=true)
 
static std::vector< std::complex< int16_t > > AutoCorrMultAvx (std::vector< std::complex< int16_t >> const &f, const int dly, const bool conj=true)
 
static std::vector< std::complex< float > > CorrelateAvx (std::vector< std::complex< float >> const &f, std::vector< std::complex< float >> const &g)
 
static std::vector< std::complex< float > > ComplexMultAvx (std::vector< std::complex< float >> const &f, std::vector< std::complex< float >> const &g, const bool conj)
 
static std::vector< std::complex< int16_t > > ComplexMultAvx (std::vector< std::complex< int16_t >> const &f, std::vector< std::complex< int16_t >> const &g, const bool conj)
 
static std::vector< std::complex< int16_t > > CorrelateAvx (std::vector< std::complex< int16_t >> const &f, std::vector< std::complex< int16_t >> const &g)
 
static __m256 M256ComplexCf32Mult (__m256 data1, __m256 data2, bool conj)
 

Member Enumeration Documentation

◆ BeamformingAlgorithm

Enumerator
kZF 
kMMSE 
kMRC 

◆ ModulationOrder

Enumerator
kBpsk 
kQpsk 
kQaM16 
kQaM64 
kQaM256 

◆ SequenceType

Enumerator
kStsSeq 
kLtsSeq 
kLtsFSeq 
kLteZadoffChu 
kGoldIfft 
kHadamard 

Constructor & Destructor Documentation

◆ CommsLib()

CommsLib::CommsLib ( std::string  )
explicit

◆ ~CommsLib()

CommsLib::~CommsLib ( )

Member Function Documentation

◆ Abs2Avx() [1/2]

std::vector< float > CommsLib::Abs2Avx ( std::vector< std::complex< float >> const &  f)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abs2Avx() [2/2]

std::vector< int32_t > CommsLib::Abs2Avx ( std::vector< std::complex< int16_t >> const &  f)
static

◆ AbsCf()

static float CommsLib::AbsCf ( complex_float  d)
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AutoCorrMultAvx() [1/2]

std::vector< std::complex< float > > CommsLib::AutoCorrMultAvx ( std::vector< std::complex< float >> const &  f,
const int  dly,
const bool  conj = true 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AutoCorrMultAvx() [2/2]

std::vector< std::complex< int16_t > > CommsLib::AutoCorrMultAvx ( std::vector< std::complex< int16_t >> const &  f,
const int  dly,
const bool  conj = true 
)
static
Here is the call graph for this function:

◆ ComplexMultAvx() [1/2]

std::vector< std::complex< float > > CommsLib::ComplexMultAvx ( std::vector< std::complex< float >> const &  f,
std::vector< std::complex< float >> const &  g,
const bool  conj 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComplexMultAvx() [2/2]

std::vector< std::complex< int16_t > > CommsLib::ComplexMultAvx ( std::vector< std::complex< int16_t >> const &  f,
std::vector< std::complex< int16_t >> const &  g,
const bool  conj 
)
static
Here is the call graph for this function:

◆ ComposePartialPilotSym()

std::vector< std::complex< float > > CommsLib::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 
)
static
Here is the call graph for this function:

◆ ComputeOfdmSnr()

float CommsLib::ComputeOfdmSnr ( const std::vector< std::complex< float >> &  data_t,
size_t  data_start_index,
size_t  data_stop_index 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Convolve()

template<typename T >
std::vector< T > CommsLib::Convolve ( std::vector< std::complex< T >> const &  f,
std::vector< std::complex< T >> const &  g 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CorrelateAvx() [1/2]

std::vector< std::complex< float > > CommsLib::CorrelateAvx ( std::vector< std::complex< float >> const &  f,
std::vector< std::complex< float >> const &  g 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CorrelateAvx() [2/2]

std::vector< std::complex< int16_t > > CommsLib::CorrelateAvx ( std::vector< std::complex< int16_t >> const &  f,
std::vector< std::complex< int16_t >> const &  g 
)
static
Here is the call graph for this function:

◆ CorrelateAvxS()

std::vector< float > CommsLib::CorrelateAvxS ( std::vector< float > const &  f,
std::vector< float > const &  g 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Csign()

template<typename T >
std::vector< std::complex< T > > CommsLib::Csign ( std::vector< std::complex< T >>  iq)
static
Here is the caller graph for this function:

◆ FFT() [1/2]

MKL_LONG CommsLib::FFT ( complex_float in_out,
int  fft_size 
)
static

◆ FFT() [2/2]

MKL_LONG CommsLib::FFT ( std::vector< std::complex< float >> &  in_out,
int  fft_size 
)
static
Here is the caller graph for this function:

◆ FFTShift() [1/3]

void CommsLib::FFTShift ( complex_float in,
complex_float tmp,
int  fft_size 
)
static

◆ FFTShift() [2/3]

std::vector< complex_float > CommsLib::FFTShift ( const std::vector< complex_float > &  in)
static

◆ FFTShift() [3/3]

std::vector< std::complex< float > > CommsLib::FFTShift ( const std::vector< std::complex< float >> &  in)
static
Here is the caller graph for this function:

◆ FindBeaconAvx() [1/2]

ssize_t CommsLib::FindBeaconAvx ( const std::complex< int16_t > *  iq,
const std::vector< std::complex< float >> &  seq,
size_t  sample_window,
float  corr_scale = 1.f 
)
static

Find Beacon with raw samples from the radio.

Here is the call graph for this function:

◆ FindBeaconAvx() [2/2]

int CommsLib::FindBeaconAvx ( const std::vector< std::complex< float >> &  iq,
const std::vector< std::complex< float >> &  seq,
float  corr_scale = 1.f 
)
static

Correlation and Peak detection of a beacon with Gold code (2 repetitions)

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindLts()

int CommsLib::FindLts ( const std::vector< std::complex< double >> &  iq,
int  seq_len 
)
static
Here is the call graph for this function:

◆ FindMaxAbs() [1/2]

float CommsLib::FindMaxAbs ( const complex_float in,
size_t  len 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindMaxAbs() [2/2]

float CommsLib::FindMaxAbs ( const Table< complex_float > &  in,
size_t  dim1,
size_t  dim2 
)
static
Here is the call graph for this function:

◆ FindMeanAbs() [1/2]

float CommsLib::FindMeanAbs ( const complex_float in,
size_t  len 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindMeanAbs() [2/2]

float CommsLib::FindMeanAbs ( const Table< complex_float > &  in,
size_t  dim1,
size_t  dim2 
)
static
Here is the call graph for this function:

◆ FindPilotSeq()

size_t CommsLib::FindPilotSeq ( const std::vector< std::complex< float >> &  iq,
const std::vector< std::complex< float >> &  pilot,
size_t  seq_len 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindTone()

float CommsLib::FindTone ( std::vector< float > const &  magnitude,
double  win_gain,
double  fft_bin,
size_t  fft_size,
const size_t  delta = 10 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDataSc()

std::vector< size_t > CommsLib::GetDataSc ( size_t  fft_size,
size_t  data_sc_num,
size_t  pilot_sc_offset,
size_t  pilot_sc_spacing 
)
static
Here is the caller graph for this function:

◆ GetNullSc()

std::vector< size_t > CommsLib::GetNullSc ( size_t  fft_size,
size_t  data_sc_num 
)
static

◆ GetPilotScIdx()

std::vector< size_t > CommsLib::GetPilotScIdx ( size_t  fft_size,
size_t  data_sc_num,
size_t  pilot_sc_offset,
size_t  pilot_sc_spacing 
)
static
Here is the caller graph for this function:

◆ GetPilotScValue()

std::vector< std::complex< float > > CommsLib::GetPilotScValue ( size_t  fft_size,
size_t  data_sc_num,
size_t  pilot_sc_offset,
size_t  pilot_sc_spacing 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetSequence()

std::vector< std::vector< double > > CommsLib::GetSequence ( size_t  seq_len,
int  type 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Hadamard2()

static int CommsLib::Hadamard2 ( int  i,
int  j 
)
inlinestatic
Here is the caller graph for this function:

◆ HannWindowFunction()

std::vector< float > CommsLib::HannWindowFunction ( size_t  fft_size)
static
Here is the caller graph for this function:

◆ IFFT() [1/2]

MKL_LONG CommsLib::IFFT ( complex_float in_out,
int  fft_size,
bool  normalize = true 
)
static
Here is the call graph for this function:

◆ IFFT() [2/2]

MKL_LONG CommsLib::IFFT ( std::vector< std::complex< float >> &  in_out,
int  fft_size,
bool  normalize = true 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Ifft2tx()

void CommsLib::Ifft2tx ( const complex_float in,
std::complex< short > *  out,
size_t  N,
size_t  prefix,
size_t  cp,
float  scale 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ M256ComplexCf32Mult()

__m256 CommsLib::M256ComplexCf32Mult ( __m256  data1,
__m256  data2,
bool  conj 
)
static
Here is the caller graph for this function:

◆ MagnitudeFft()

std::vector< float > CommsLib::MagnitudeFft ( std::vector< std::complex< float >> const &  samps,
std::vector< float > const &  win,
size_t  fft_size 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MeasureTone()

float CommsLib::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 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Meshgrid()

void CommsLib::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 
)
static
Here is the caller graph for this function:

◆ Modulate()

std::vector< std::complex< float > > CommsLib::Modulate ( const std::vector< int8_t > &  in,
int  type 
)
static
Here is the call graph for this function:

◆ SeqCyclicShift()

std::vector< std::complex< float > > CommsLib::SeqCyclicShift ( const std::vector< std::complex< float >> &  in,
float  alpha 
)
static
Here is the caller graph for this function:

◆ WindowFunctionPower()

double CommsLib::WindowFunctionPower ( std::vector< float > const &  win)
static
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: