SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
leansdr Namespace Reference

Namespaces

 filtergen
 

Classes

struct  adder
 
struct  auto_notch
 
struct  bbframe
 
struct  bch_engine
 
struct  bch_interface
 
struct  bitpath
 
struct  bitvect
 
struct  buffer_reader
 
struct  buffer_writer
 
struct  cconverter
 
struct  cfft_engine
 
struct  cnr_fft
 
struct  complex
 
struct  convol_multipoly
 
struct  convol_poly2
 
struct  crc8_engine
 
struct  cstln_base
 
struct  cstln_lut
 
struct  cstln_receiver
 
struct  cstln_transmitter
 
struct  datvconstellation
 
struct  datvdvbs2constellation
 
struct  datvvideoplayer
 
struct  decimator
 
struct  deconvol_poly
 
struct  deconvol_poly2
 
struct  deconvol_sync
 
struct  deinterleaver
 
struct  derandomizer
 
struct  dvb_convol
 
struct  dvb_deconvol_sync
 
struct  etr192_descrambler
 
struct  eucl_ss
 
struct  fast_qpsk_receiver
 
struct  fecframe
 
struct  file_carrayprinter
 
struct  file_printer
 
struct  file_reader
 
struct  file_vectorprinter
 
struct  file_writer
 
struct  fir_filter
 
struct  fir_resampler
 
struct  fir_sampler
 
struct  full_ss
 
struct  gf2n
 
struct  gf2x_p
 
struct  hdlc_dec
 
struct  hdlc_sync
 
struct  interleaver
 
struct  itemcounter
 
struct  ldpc_engine
 
struct  ldpc_table
 
struct  linear_sampler
 
struct  llr_sb
 
struct  llr_ss
 
struct  modcod_info
 
struct  mpeg_sync
 
struct  naive_lowpass
 
struct  nearest_sampler
 
struct  pipebuf
 
struct  pipebuf_common
 
struct  pipereader
 
struct  pipewriter
 
struct  plslot
 
struct  randomizer
 
struct  rate_estimator
 
struct  rotator
 
struct  rs_decoder
 
struct  rs_encoder
 
struct  rs_engine
 
struct  rspacket
 
struct  runnable
 
struct  runnable_common
 
struct  s2_bbscrambling
 
struct  s2_bch_engines
 
struct  s2_deframer
 
struct  s2_deinterleaver
 
struct  s2_fecdec
 
struct  s2_fecdec_helper
 
struct  s2_fecenc
 
struct  s2_frame_receiver
 
struct  s2_frame_transmitter
 
struct  s2_framer
 
struct  s2_interleaver
 
struct  s2_ldpc_engines
 
struct  s2_pls
 
struct  s2_plscodes
 
struct  s2_scrambling
 
struct  s2_sof
 
struct  sampler_interface
 
struct  scaler
 
struct  scheduler
 
struct  serializer
 
struct  simple_agc
 
struct  simplequeue
 
struct  softsymbol
 
struct  spectrum
 
struct  ss_amp_estimator
 
struct  ss_estimator
 
struct  trellis
 
struct  trig16
 
struct  tspacket
 
struct  viterbi_dec
 
struct  viterbi_dec_interface
 
struct  viterbi_sync
 
struct  wgn_c
 
struct  window_placement
 

Typedefs

typedef deconvol_sync< u8, 0 > deconvol_sync_simple
 
typedef dvb_deconvol_sync< eucl_ssdvb_deconvol_sync_soft
 
typedef dvb_deconvol_sync< u8dvb_deconvol_sync_hard
 
typedef ldpc_table< uint16_ts2_ldpc_table
 
typedef ldpc_engine< bool, hard_sb, 8, uint16_ts2_ldpc_engine
 
typedef unsigned char u8
 
typedef unsigned short u16
 
typedef unsigned long u32
 
typedef signed char s8
 
typedef signed short s16
 
typedef signed long s32
 
typedef float f32
 
typedef complex< u8cu8
 
typedef complex< s8cs8
 
typedef complex< u16cu16
 
typedef complex< s16cs16
 
typedef complex< f32cf32
 
typedef uint16_t u_angle
 
typedef int16_t s_angle
 
typedef uint8_t hard_ss
 
typedef int8_t llr_t
 
typedef uint8_t hard_sb
 

Enumerations

enum  code_rate {
  FEC12, FEC23, FEC46, FEC34,
  FEC56, FEC78, FEC45, FEC89,
  FEC910, FEC14, FEC13, FEC25,
  FEC35, FEC_COUNT
}
 

Functions

uint32_t crc32 (const uint8_t *buf, int len)
 
template<typename T , int N, typename Tm >
bitvect< T, N > divmod (const Tm *m, size_t nm, const bitvect< T, N > &p)
 
template<typename T , int N, typename Tm >
bitvect< T, N > shiftdivmod (const Tm *m, size_t nm, const bitvect< T, N > &p, T init=0)
 
template<typename T , int N>
bool operator== (const bitvect< T, N > &a, const bitvect< T, N > &b)
 
template<typename T , int N>
bitvect< T, N > operator+ (const bitvect< T, N > &a, const bitvect< T, N > &b)
 
template<typename T , int N, int NB>
bitvect< T, N > operator* (bitvect< T, N > a, const bitvect< T, NB > &b)
 
deconvol_sync_simplemake_deconvol_sync_simple (scheduler *sch, pipebuf< eucl_ss > &_in, pipebuf< u8 > &_out, enum code_rate rate)
 
const modcod_infocheck_modcod (int m)
 
void fatal (const char *s)
 
void fail (const char *s)
 
template<typename T >
pipewriter< T > * opt_writer (pipebuf< T > *buf, unsigned long min_write=1)
 
template<typename T >
bool opt_writable (pipewriter< T > *p, int n=1)
 
template<typename T >
void opt_write (pipewriter< T > *p, T val)
 
template<typename T >
gen_sqrt (T x)
 
float gen_sqrt (float x)
 
unsigned int gen_sqrt (unsigned int x)
 
long double gen_sqrt (long double x)
 
template<typename T >
gen_abs (T x)
 
float gen_abs (float x)
 
int gen_abs (int x)
 
long int gen_abs (long int x)
 
template<typename T >
gen_hypot (T x, T y)
 
float gen_hypot (float x, float y)
 
long double gen_hypot (long double x, long double y)
 
template<typename T >
gen_atan2 (T y, T x)
 
float gen_atan2 (float y, float x)
 
long double gen_atan2 (long double y, long double x)
 
template<typename T >
min (const T &x, const T &y)
 
template<typename T >
max (const T &x, const T &y)
 
int hamming_weight (uint8_t x)
 
int hamming_weight (uint16_t x)
 
int hamming_weight (uint32_t x)
 
int hamming_weight (uint64_t x)
 
unsigned char parity (uint8_t x)
 
unsigned char parity (uint16_t x)
 
unsigned char parity (uint32_t x)
 
unsigned char parity (uint64_t x)
 
int log2i (uint64_t x)
 
template<typename T >
complex< T > operator+ (const complex< T > &a, const complex< T > &b)
 
template<typename T >
complex< T > operator* (const complex< T > &a, const complex< T > &b)
 
template<typename T >
complex< T > operator* (const complex< T > &a, const T &k)
 
template<typename T >
complex< T > operator* (const T &k, const complex< T > &a)
 
template<typename T >
dotprod (const T *u, const T *v, int n)
 
template<typename T >
cnorm2 (const complex< T > &u)
 
template<typename T >
cnorm2 (const complex< T > *p, int n)
 
template<typename T >
complex< T > conjprod (const complex< T > &u, const complex< T > &v)
 
template<typename T >
complex< T > conjprod (const complex< T > *u, const complex< T > *v, int n)
 
void softsymb_harden (llr_ss *ss)
 
void softsymb_harden (hard_ss *ss)
 
void softsymb_harden (eucl_ss *ss)
 
uint8_t softsymb_to_dump (const llr_ss &ss, int bit)
 
uint8_t softsymb_to_dump (const hard_ss &ss, int bit)
 
uint8_t softsymb_to_dump (const eucl_ss &ss, int bit)
 
void to_softsymb (const full_ss *fss, hard_ss *ss)
 
void to_softsymb (const full_ss *fss, eucl_ss *ss)
 
void to_softsymb (const full_ss *fss, llr_ss *ss)
 
bool llr_harden (llr_t v)
 
bool softword_get (const hard_sb &p, int b)
 
void softword_set (hard_sb *p, int b, bool v)
 
void softword_clear (hard_sb *p)
 
bool softword_weight (const bool &l)
 
void softbit_set (bool *p, bool v)
 
bool softbit_harden (bool b)
 
uint8_t softbyte_harden (const hard_sb &b)
 
bool softbit_xor (bool x, bool y)
 
void softbit_clear (bool *p)
 
bool softwords_xor (const hard_sb p1[], const hard_sb p2[], int b)
 
void softword_zero (hard_sb *p)
 
void softwords_set (hard_sb p[], int b)
 
void softword_write (hard_sb &p, int b, bool v)
 
void softwords_write (hard_sb p[], int b, bool v)
 
void softwords_flip (hard_sb p[], int b)
 
uint8_tsoftbytes_harden (hard_sb p[], int nbytes, uint8_t storage[])
 
float prob (llr_t l)
 
llr_t llr (float p)
 
llr_t llr_xor (llr_t lx, llr_t ly)
 
llr_t softword_get (const llr_sb &p, int b)
 
llr_t softwords_get (const llr_sb p[], int b)
 
void softword_set (llr_sb *p, int b, llr_t v)
 
void softword_clear (llr_sb *p)
 
llr_t softword_weight (llr_t l)
 
void softbit_set (llr_t *p, bool v)
 
bool softbit_harden (llr_t l)
 
uint8_t softbyte_harden (const llr_sb &b)
 
llr_t softbit_xor (llr_t x, llr_t y)
 
void softbit_clear (llr_t *p)
 
llr_t softwords_xor (const llr_sb p1[], const llr_sb p2[], int b)
 
void softword_zero (llr_sb *p)
 
void softwords_set (llr_sb p[], int b)
 
void softword_write (llr_sb &p, int b, llr_t v)
 
void softwords_write (llr_sb p[], int b, llr_t v)
 
void softwords_flip (llr_sb p[], int b)
 
uint8_tsoftbytes_harden (llr_sb p[], int nbytes, uint8_t storage[])
 
template<typename SOFTBIT , typename SOFTBYTE >
SOFTBIT softwords_get (const SOFTBYTE p[], int b)
 
template<typename SOFTBIT , typename SOFTBYTE >
void softwords_set (SOFTBYTE p[], int b, SOFTBIT v)
 
template<typename SOFTBIT , typename SOFTBYTE >
SOFTBIT softwords_weight (const SOFTBYTE p[], int b)
 

Variables

const struct leansdr::modcod_info modcod_infos [32]
 
const float cstln_amp = 75
 

Typedef Documentation

◆ cf32

Definition at line 34 of file sdr.h.

◆ cs16

Definition at line 33 of file sdr.h.

◆ cs8

Definition at line 31 of file sdr.h.

◆ cu16

Definition at line 32 of file sdr.h.

◆ cu8

Definition at line 30 of file sdr.h.

◆ deconvol_sync_simple

Definition at line 586 of file dvb.h.

◆ dvb_deconvol_sync_hard

Definition at line 827 of file dvb.h.

◆ dvb_deconvol_sync_soft

Definition at line 826 of file dvb.h.

◆ f32

typedef float leansdr::f32

Definition at line 28 of file sdr.h.

◆ hard_sb

Definition at line 21 of file softword.h.

◆ hard_ss

Definition at line 423 of file sdr.h.

◆ llr_t

Definition at line 444 of file sdr.h.

◆ s16

typedef signed short leansdr::s16

Definition at line 457 of file framework.h.

◆ s2_ldpc_engine

Definition at line 1868 of file dvbs2.h.

◆ s2_ldpc_table

Definition at line 1867 of file dvbs2.h.

◆ s32

typedef signed long leansdr::s32

Definition at line 458 of file framework.h.

◆ s8

typedef signed char leansdr::s8

Definition at line 456 of file framework.h.

◆ s_angle

Definition at line 385 of file sdr.h.

◆ u16

typedef unsigned short leansdr::u16

Definition at line 454 of file framework.h.

◆ u32

typedef unsigned long leansdr::u32

Definition at line 455 of file framework.h.

◆ u8

typedef unsigned char leansdr::u8

Definition at line 453 of file framework.h.

◆ u_angle

Definition at line 384 of file sdr.h.

Enumeration Type Documentation

◆ code_rate

Enumerator
FEC12 
FEC23 
FEC46 
FEC34 
FEC56 
FEC78 
FEC45 
FEC89 
FEC910 
FEC14 
FEC13 
FEC25 
FEC35 
FEC_COUNT 

Definition at line 41 of file dvb.h.

42 {
43  FEC12,
44  FEC23,
45  FEC46,
46  FEC34,
47  FEC56,
48  FEC78, // DVB-S
49  FEC45,
50  FEC89,
51  FEC910, // DVB-S2
52  FEC14,
53  FEC13,
54  FEC25,
55  FEC35, // DVB-S2
56  FEC_COUNT
57 };

Function Documentation

◆ check_modcod()

const modcod_info* leansdr::check_modcod ( int  m)

Definition at line 285 of file dvbs2.h.

References fail(), modcod_infos, and leansdr::modcod_info::nslots_nf.

Referenced by leansdr::s2_fecdec_helper< SOFTBIT, SOFTBYTE >::receive_frame(), leansdr::s2_frame_transmitter< T >::run(), leansdr::s2_interleaver::run(), leansdr::s2_deinterleaver< SOFTSYMB, SOFTBYTE >::run(), leansdr::s2_fecdec< SOFTBIT, SOFTBYTE >::run(), leansdr::s2_framer::run(), and leansdr::s2_fecenc::run_frame().

286 {
287  if (m < 0 || m > 31)
288  fail("Invalid MODCOD number");
289  const modcod_info *r = &modcod_infos[m];
290  if (!r->nslots_nf)
291  fail("Unsupported MODCOD");
292  return r;
293 }
void fail(const char *s)
Definition: framework.cpp:11
const struct leansdr::modcod_info modcod_infos[32]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cnorm2() [1/2]

template<typename T >
T leansdr::cnorm2 ( const complex< T > &  u)
inline

Definition at line 89 of file math.h.

References leansdr::complex< T >::im, and leansdr::complex< T >::re.

Referenced by cnorm2(), and leansdr::s2_frame_receiver< T, SOFTSYMB >::init_agc().

90 {
91  return u.re * u.re + u.im * u.im;
92 }
+ Here is the caller graph for this function:

◆ cnorm2() [2/2]

template<typename T >
T leansdr::cnorm2 ( const complex< T > *  p,
int  n 
)

Definition at line 95 of file math.h.

References cnorm2().

96 {
97  T res = 0;
98  for (; n--; ++p)
99  res += cnorm2(*p);
100  return res;
101 }
T cnorm2(const complex< T > *p, int n)
Definition: math.h:95
+ Here is the call graph for this function:

◆ conjprod() [1/2]

template<typename T >
complex<T> leansdr::conjprod ( const complex< T > &  u,
const complex< T > &  v 
)
inline

Definition at line 105 of file math.h.

References leansdr::complex< T >::im, and leansdr::complex< T >::re.

Referenced by conjprod(), and leansdr::s2_frame_receiver< T, SOFTSYMB >::run_frame_locked().

106 {
107  return complex<T>(u.re * v.re + u.im * v.im,
108  u.re * v.im - u.im * v.re);
109 }
+ Here is the caller graph for this function:

◆ conjprod() [2/2]

template<typename T >
complex<T> leansdr::conjprod ( const complex< T > *  u,
const complex< T > *  v,
int  n 
)

Definition at line 113 of file math.h.

References conjprod(), hamming_weight(), log2i(), and parity().

114 {
115  complex<T> acc = 0;
116  while (n--)
117  acc += conjprod(*u++, *v++);
118  return acc;
119 }
complex< T > conjprod(const complex< T > *u, const complex< T > *v, int n)
Definition: math.h:113
+ Here is the call graph for this function:

◆ crc32()

uint32_t leansdr::crc32 ( const uint8_t buf,
int  len 
)

Definition at line 58 of file crc.h.

References i.

Referenced by FileRecord::readHeader(), UDPSinkFEC::write(), and FileRecord::writeHeader().

59 {
60  static const uint32_t poly = 0xedb88320;
61  uint32_t c = 0xffffffff;
62  for (int i = 0; i < len; ++i)
63  {
64  c ^= buf[i];
65  for (int bit = 8; bit--;)
66  c = (c & 1) ? (c >> 1) ^ poly : (c >> 1);
67  }
68  return c ^ 0xffffffff;
69 }
unsigned int uint32_t
Definition: rtptypes_win.h:46
int32_t i
Definition: decimators.h:244
+ Here is the caller graph for this function:

◆ divmod()

template<typename T , int N, typename Tm >
bitvect<T, N> leansdr::divmod ( const Tm *  m,
size_t  nm,
const bitvect< T, N > &  p 
)

Definition at line 111 of file discrmath.h.

References leansdr::bitvect< T, N >::v.

Referenced by leansdr::bch_engine< T, N, NP, DP, TGF, GFTRUNCGEN >::decode().

112 {
113  bitvect<T, N> res = 0;
114  const Tm bitmask = (Tm)1 << (sizeof(Tm) * 8 - 1);
115  for (; nm--; ++m)
116  {
117  Tm mi = *m;
118  for (int bit = sizeof(Tm) * 8; bit--; mi <<= 1)
119  {
120  // Multiply by X, save outgoing coeff of degree N
121  bool resN = res[N - 1];
122  res <<= 1;
123  // Add m[i]
124  if (mi & bitmask)
125  res.v[0] ^= 1;
126  // Modulo X^N+p
127  if (resN)
128  res += p;
129  }
130  }
131  return res;
132 }
+ Here is the caller graph for this function:

◆ dotprod()

template<typename T >
T leansdr::dotprod ( const T *  u,
const T *  v,
int  n 
)

Definition at line 80 of file math.h.

81 {
82  T acc = 0;
83  while (n--)
84  acc += (*u++) * (*v++);
85  return acc;
86 }

◆ fail()

void leansdr::fail ( const char *  s)

Definition at line 11 of file framework.cpp.

Referenced by leansdr::scheduler::add_pipe(), leansdr::pipebuf< leansdr::complex< leansdr::f32 > >::add_reader(), leansdr::scheduler::add_runnable(), leansdr::s2_frame_receiver< T, SOFTSYMB >::add_syncs(), leansdr::bch_engine< T, N, NP, DP, TGF, GFTRUNCGEN >::bch_engine(), check_modcod(), leansdr::cnr_fft< leansdr::f32 >::cnr_fft(), leansdr::cstln_lut< SOFTSYMB, 256 >::cstln_lut(), leansdr::ldpc_engine< SOFTBIT, SOFTWORD, SWSIZE, Taddr >::decode_bitflip(), leansdr::s2_deinterleaver< SOFTSYMB, SOFTBYTE >::deinterleave(), leansdr::s2_deinterleaver< SOFTSYMB, SOFTBYTE >::deserialize_qpsk(), leansdr::dvb_convol::dvb_convol(), leansdr::fir_resampler< T, Tc >::fir_resampler(), leansdr::gf2n< TGF, DP, 2, GFTRUNCGEN >::gf2n(), leansdr::gf2x_p< unsigned char, unsigned short, 0x11d, 8, 2 >::gf2x_p(), leansdr::s2_interleaver::interleave(), leansdr::deconvol_sync< leansdr::u8, 0 >::inverse_convolution(), leansdr::ldpc_engine< SOFTBIT, SOFTWORD, SWSIZE, Taddr >::ldpc_engine(), leansdr::deconvol_sync< leansdr::u8, 0 >::next_sync(), leansdr::bitvect< T, DP >::operator<<=(), leansdr::deconvol_poly2< Tin, uint32_t, uint64_t, 0x3ba, 0x38f70 >::run(), leansdr::s2_frame_transmitter< T >::run(), leansdr::cstln_receiver< leansdr::f32, leansdr::eucl_ss >::run(), leansdr::rs_decoder< leansdr::u8, 0 >::run(), leansdr::fast_qpsk_receiver< T >::run(), leansdr::s2_deinterleaver< SOFTSYMB, SOFTBYTE >::run(), leansdr::cstln_transmitter< Tout, Zout >::run(), leansdr::viterbi_sync::run(), leansdr::s2_framer::run(), leansdr::s2_frame_transmitter< T >::run_frame(), leansdr::s2_interleaver::serialize_qpsk(), leansdr::serializer< Tin, Tout >::serializer(), and leansdr::viterbi_sync::viterbi_sync().

12 {
13  fprintf(stderr, "** %s\n", s);
14 }
+ Here is the caller graph for this function:

◆ fatal()

void leansdr::fatal ( const char *  s)

◆ gen_abs() [1/4]

template<typename T >
T leansdr::gen_abs ( x)

Referenced by leansdr::auto_notch< leansdr::f32 >::detect(), and gen_sqrt().

+ Here is the caller graph for this function:

◆ gen_abs() [2/4]

float leansdr::gen_abs ( float  x)
inline

Definition at line 400 of file framework.h.

401 {
402  return fabsf(x);
403 }

◆ gen_abs() [3/4]

int leansdr::gen_abs ( int  x)
inline

Definition at line 405 of file framework.h.

References abs().

406 {
407  return abs(x);
408 }
Fixed< IntType, IntBits > abs(Fixed< IntType, IntBits > const &x)
Definition: fixed.h:2313
+ Here is the call graph for this function:

◆ gen_abs() [4/4]

long int leansdr::gen_abs ( long int  x)
inline

Definition at line 410 of file framework.h.

References gen_hypot().

411 {
412  return labs(x);
413 }
+ Here is the call graph for this function:

◆ gen_atan2() [1/3]

template<typename T >
T leansdr::gen_atan2 ( y,
x 
)

Referenced by gen_hypot().

+ Here is the caller graph for this function:

◆ gen_atan2() [2/3]

float leansdr::gen_atan2 ( float  y,
float  x 
)
inline

Definition at line 429 of file framework.h.

430 {
431  return atan2f(y, x);
432 }

◆ gen_atan2() [3/3]

long double leansdr::gen_atan2 ( long double  y,
long double  x 
)
inline

Definition at line 434 of file framework.h.

435 {
436  return atan2l(y, x);
437 }

◆ gen_hypot() [1/3]

template<typename T >
T leansdr::gen_hypot ( x,
y 
)

Referenced by gen_abs().

+ Here is the caller graph for this function:

◆ gen_hypot() [2/3]

float leansdr::gen_hypot ( float  x,
float  y 
)
inline

Definition at line 417 of file framework.h.

418 {
419  return hypotf(x, y);
420 }

◆ gen_hypot() [3/3]

long double leansdr::gen_hypot ( long double  x,
long double  y 
)
inline

Definition at line 422 of file framework.h.

References gen_atan2().

423 {
424  return hypotl(x, y);
425 }
+ Here is the call graph for this function:

◆ gen_sqrt() [1/4]

template<typename T >
T leansdr::gen_sqrt ( x)

◆ gen_sqrt() [2/4]

float leansdr::gen_sqrt ( float  x)
inline

Definition at line 383 of file framework.h.

384 {
385  return sqrtf(x);
386 }

◆ gen_sqrt() [3/4]

unsigned int leansdr::gen_sqrt ( unsigned int  x)
inline

Definition at line 388 of file framework.h.

389 {
390  return sqrtl(x);
391 }

◆ gen_sqrt() [4/4]

long double leansdr::gen_sqrt ( long double  x)
inline

Definition at line 393 of file framework.h.

References gen_abs().

394 {
395  return sqrtl(x);
396 }
+ Here is the call graph for this function:

◆ hamming_weight() [1/4]

int leansdr::hamming_weight ( uint8_t  x)

◆ hamming_weight() [2/4]

int leansdr::hamming_weight ( uint16_t  x)

Definition at line 12 of file math.cpp.

References hamming_weight().

13 {
14  return hamming_weight((uint8_t)x) + hamming_weight((uint8_t)(x >> 8));
15 }
int hamming_weight(uint64_t x)
Definition: math.cpp:22
unsigned char uint8_t
Definition: rtptypes_win.h:42
+ Here is the call graph for this function:

◆ hamming_weight() [3/4]

int leansdr::hamming_weight ( uint32_t  x)

Definition at line 17 of file math.cpp.

References hamming_weight().

18 {
19  return hamming_weight((uint16_t)x) + hamming_weight((uint16_t)(x >> 16));
20 }
int hamming_weight(uint64_t x)
Definition: math.cpp:22
unsigned short uint16_t
Definition: rtptypes_win.h:44
+ Here is the call graph for this function:

◆ hamming_weight() [4/4]

int leansdr::hamming_weight ( uint64_t  x)

Definition at line 22 of file math.cpp.

References hamming_weight().

23 {
24  return hamming_weight((uint32_t)x) + hamming_weight((uint32_t)(x >> 32));
25 }
int hamming_weight(uint64_t x)
Definition: math.cpp:22
unsigned int uint32_t
Definition: rtptypes_win.h:46
+ Here is the call graph for this function:

◆ llr()

llr_t leansdr::llr ( float  p)

Definition at line 83 of file softword.h.

Referenced by llr_xor().

84 {
85  int r = -127 + 254 * p;
86  if (r < -127)
87  r = -127;
88  if (r > 127)
89  r = 127;
90  return r;
91 }
+ Here is the caller graph for this function:

◆ llr_harden()

bool leansdr::llr_harden ( llr_t  v)
inline

Definition at line 446 of file sdr.h.

Referenced by leansdr::s2_deinterleaver< SOFTSYMB, SOFTBYTE >::pack_qpsk_symbol(), and leansdr::s2_deinterleaver< SOFTSYMB, SOFTBYTE >::split_symbol().

447 {
448  return v & 128;
449 }
+ Here is the caller graph for this function:

◆ llr_xor()

llr_t leansdr::llr_xor ( llr_t  lx,
llr_t  ly 
)
inline

Definition at line 92 of file softword.h.

References llr(), and prob().

Referenced by softbit_xor(), and softwords_xor().

93 {
94  float px = prob(lx), py = prob(ly);
95  return llr(px * (1 - py) + (1 - px) * py);
96 }
float prob(llr_t l)
Definition: softword.h:79
llr_t llr(float p)
Definition: softword.h:83
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ log2i()

int leansdr::log2i ( uint64_t  x)

Definition at line 48 of file math.cpp.

Referenced by conjprod(), leansdr::trellis< TS, NSTATES, TUS, NUS, NCS >::init_convolutional(), and leansdr::viterbi_sync::viterbi_sync().

49 {
50  int n = -1;
51  for (; x; ++n, x >>= 1)
52  ;
53  return n;
54 }
+ Here is the caller graph for this function:

◆ make_deconvol_sync_simple()

deconvol_sync_simple * leansdr::make_deconvol_sync_simple ( scheduler sch,
pipebuf< eucl_ss > &  _in,
pipebuf< u8 > &  _out,
enum code_rate  rate 
)

Definition at line 6 of file dvb.cpp.

References FEC12, FEC23, FEC34, FEC46, FEC56, and FEC78.

10 {
11  // EN 300 421, section 4.4.3 Inner coding
12  uint32_t pX, pY;
13  switch (rate)
14  {
15  case FEC12:
16  pX = 0x1; // 1
17  pY = 0x1; // 1
18  break;
19  case FEC23:
20  case FEC46:
21  pX = 0xa; // 1010 (Handle as FEC4/6, no half-symbols)
22  pY = 0xf; // 1111
23  break;
24  case FEC34:
25  pX = 0x5; // 101
26  pY = 0x6; // 110
27  break;
28  case FEC56:
29  pX = 0x15; // 10101
30  pY = 0x1a; // 11010
31  break;
32  case FEC78:
33  pX = 0x45; // 1000101
34  pY = 0x7a; // 1111010
35  break;
36  default:
37  //fail("Code rate not implemented");
38  // For testing DVB-S2 constellations.
39  fprintf(stderr, "Code rate not implemented; proceeding anyway\n");
40  pX = pY = 1;
41  }
42 
43  return new deconvol_sync_simple(sch, _in, _out, DVBS_G1, DVBS_G2, pX, pY);
44 }
unsigned int uint32_t
Definition: rtptypes_win.h:46
deconvol_sync< u8, 0 > deconvol_sync_simple
Definition: dvb.h:586

◆ max()

template<typename T >
T leansdr::max ( const T &  x,
const T &  y 
)

Definition at line 446 of file framework.h.

Referenced by FreeDVDemod::FreeDVSNR::accumulate(), FreeDVDemod::LevelRMS::accumulate(), Bladerf1Output::applySettings(), HackRFOutput::applySettings(), BladeRF2Output::applySettings(), SoapySDROutput::applySettings(), BladeRF2Input::applySettings(), LimeSDROutput::applySettings(), BladeRF2InputGui::BladeRF2InputGui(), BladeRF2OutputGui::BladeRF2OutputGui(), ScaleEngine::calcCharSize(), UDPSource::calculateLevel(), WFMMod::calculateLevel(), AMMod::calculateLevel(), NFMMod::calculateLevel(), FreeDVMod::calculateLevel(), SSBMod::calculateLevel(), ATVMod::calculateLevel(), clamp(), AudioCompressorSnd::clampf(), SoapySDRInputGui::createGlobalGainControl(), SoapySDROutputGui::createGlobalGainControl(), Interpolator::createPolyphaseLowPass(), decimation(), BladeRF2InputGui::displaySampleRate(), BladeRF2OutputGui::displaySampleRate(), LoRaDemod::dumpRaw(), SpectrumVis::feed(), PlutoSDROutput::getbbLPRange(), PlutoSDRInput::getbbLPRange(), DeviceBladeRF2::getDev(), PlutoSDROutput::getLORange(), PlutoSDRInput::getLORange(), ScaleEngine::getScaleWidth(), ArgInfoGUI::getValueType(), BladeRF2InputGui::handleMessage(), BladeRF2OutputGui::handleMessage(), BladeRF2Input::handleMessage(), qrtplib::RTPPacketBuilder::Init(), DATVDemod::InitDATVFramework(), DATVDemod::InitDATVS2Framework(), polar(), PhaseLock::process(), PhaseLock::process_phasor(), UDPSourceUDPHandler::resizeBuffer(), LevelMeterSignalDB::setColorTheme(), qrtplib::RTPSessionParams::SetMaximumPacketSize(), qrtplib::RTPPacketBuilder::SetMaximumPacketSize(), ArgInfoGUI::setRange(), BladeRF2Output::setSampleRate(), SoapySDROutput::setSampleRate(), BladeRF2Input::setSampleRate(), SoapySDRInput::setSampleRate(), ValueDial::setValueRange(), ValueDialZ::setValueRange(), Max2D< double >::storeAndGetMax(), BladeRF2Output::webapiFormatDeviceReport(), and BladeRF2Input::webapiFormatDeviceReport().

447 {
448  return (x < y) ? y : x;
449 }
+ Here is the caller graph for this function:

◆ min()

template<typename T >
T leansdr::min ( const T &  x,
const T &  y 
)

Definition at line 440 of file framework.h.

Referenced by SSBDemodGUI::applyBandwidths(), GLScope::applyConfig(), AMMod::applyFeedbackAudioSampleRate(), NFMMod::applyFeedbackAudioSampleRate(), SSBMod::applyFeedbackAudioSampleRate(), BladeRF2Output::applySettings(), BladeRF2Input::applySettings(), BladeRF2InputGui::BladeRF2InputGui(), BladeRF2OutputGui::BladeRF2OutputGui(), clamp(), SoapySDRInputGui::createGlobalGainControl(), SoapySDROutputGui::createGlobalGainControl(), BladeRF2InputGui::displaySampleRate(), BladeRF2OutputGui::displaySampleRate(), PlutoSDROutput::getbbLPRange(), PlutoSDRInput::getbbLPRange(), DeviceBladeRF2::getDev(), PlutoSDROutput::getLORange(), PlutoSDRInput::getLORange(), ArgInfoGUI::getValueType(), BladeRF2InputGui::handleMessage(), BladeRF2OutputGui::handleMessage(), BladeRF2Input::handleMessage(), GLScope::paintGL(), PhaseLock::process(), PhaseLock::process_phasor(), leansdr::etr192_descrambler::run(), leansdr::cconverter< Tin, Zin, Tout, Zout, Gn, Gd >::run(), leansdr::scaler< Tscale, Tin, Tout >::run(), leansdr::naive_lowpass< T >::run(), leansdr::fir_filter< leansdr::complex, float >::run(), leansdr::decimator< leansdr::complex >::run(), leansdr::rate_estimator< float >::run(), leansdr::fir_resampler< T, Tc >::run(), leansdr::buffer_reader< T >::run(), leansdr::buffer_writer< T >::run(), leansdr::dvb_convol::run(), leansdr::cstln_transmitter< Tout, Zout >::run(), leansdr::rotator< leansdr::f32 >::run(), LevelMeterSignalDB::setColorTheme(), GLScope::setPolarDisplays(), ArgInfoGUI::setRange(), BladeRF2Output::setSampleRate(), SoapySDROutput::setSampleRate(), BladeRF2Input::setSampleRate(), SoapySDRInput::setSampleRate(), ValueDial::setValueRange(), ValueDialZ::setValueRange(), FileSinkThread::tick(), BladeRF2Output::webapiFormatDeviceReport(), and BladeRF2Input::webapiFormatDeviceReport().

441 {
442  return (x < y) ? x : y;
443 }
+ Here is the caller graph for this function:

◆ operator*() [1/4]

template<typename T >
complex<T> leansdr::operator* ( const complex< T > &  a,
const complex< T > &  b 
)

Definition at line 62 of file math.h.

References leansdr::complex< T >::im, and leansdr::complex< T >::re.

63 {
64  return complex<T>(a.re * b.re - a.im * b.im, a.re * b.im + a.im * b.re);
65 }

◆ operator*() [2/4]

template<typename T >
complex<T> leansdr::operator* ( const complex< T > &  a,
const T &  k 
)

Definition at line 68 of file math.h.

References leansdr::complex< T >::im, and leansdr::complex< T >::re.

69 {
70  return complex<T>(a.re * k, a.im * k);
71 }

◆ operator*() [3/4]

template<typename T >
complex<T> leansdr::operator* ( const T &  k,
const complex< T > &  a 
)

Definition at line 74 of file math.h.

References leansdr::complex< T >::im, and leansdr::complex< T >::re.

75 {
76  return complex<T>(k * a.re, k * a.im);
77 }

◆ operator*() [4/4]

template<typename T , int N, int NB>
bitvect<T, N> leansdr::operator* ( bitvect< T, N >  a,
const bitvect< T, NB > &  b 
)

Definition at line 186 of file discrmath.h.

References i.

187 {
188  bitvect<T, N> res = 0;
189  for (int i = 0; i < NB; ++i, a <<= 1)
190  if (b[i])
191  res += a;
192  // TBD If truncation is needed, do it only once at the end.
193  return res;
194 }
int32_t i
Definition: decimators.h:244

◆ operator+() [1/2]

template<typename T >
complex<T> leansdr::operator+ ( const complex< T > &  a,
const complex< T > &  b 
)

Definition at line 56 of file math.h.

References leansdr::complex< T >::im, and leansdr::complex< T >::re.

57 {
58  return complex<T>(a.re + b.re, a.im + b.im);
59 }

◆ operator+() [2/2]

template<typename T , int N>
bitvect<T, N> leansdr::operator+ ( const bitvect< T, N > &  a,
const bitvect< T, N > &  b 
)

Definition at line 175 of file discrmath.h.

References i, leansdr::bitvect< T, N >::NW, and leansdr::bitvect< T, N >::v.

176 {
177  bitvect<T, N> res;
178  for (int i = 0; i < a.NW; ++i)
179  res.v[i] = a.v[i] ^ b.v[i];
180  return res;
181 }
int32_t i
Definition: decimators.h:244

◆ operator==()

template<typename T , int N>
bool leansdr::operator== ( const bitvect< T, N > &  a,
const bitvect< T, N > &  b 
)

Definition at line 164 of file discrmath.h.

References i, leansdr::bitvect< T, N >::NW, and leansdr::bitvect< T, N >::v.

Referenced by qrtplib::RTPAddress::GetAddressType().

165 {
166  for (int i = 0; i < a.NW; ++i)
167  if (a.v[i] != b.v[i])
168  return false;
169  return true;
170 }
int32_t i
Definition: decimators.h:244
+ Here is the caller graph for this function:

◆ opt_writable()

template<typename T >
bool leansdr::opt_writable ( pipewriter< T > *  p,
int  n = 1 
)

Definition at line 335 of file framework.h.

References leansdr::pipewriter< T >::writable().

Referenced by leansdr::hdlc_sync::run(), leansdr::s2_frame_receiver< T, SOFTSYMB >::run(), leansdr::s2_fecdec< SOFTBIT, SOFTBYTE >::run(), leansdr::s2_fecdec_helper< SOFTBIT, SOFTBYTE >::run(), and leansdr::s2_deframer::run().

336 {
337  return (p == NULL) || p->writable() >= n;
338 }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ opt_write()

template<typename T >
void leansdr::opt_write ( pipewriter< T > *  p,
val 
)

◆ opt_writer()

template<typename T >
pipewriter<T>* leansdr::opt_writer ( pipebuf< T > *  buf,
unsigned long  min_write = 1 
)

Definition at line 329 of file framework.h.

330 {
331  return buf ? new pipewriter<T>(*buf, min_write) : NULL;
332 }

◆ parity() [1/4]

unsigned char leansdr::parity ( uint8_t  x)

◆ parity() [2/4]

unsigned char leansdr::parity ( uint16_t  x)

Definition at line 33 of file math.cpp.

References parity().

34 {
35  return parity((uint8_t)(x ^ (x >> 8)));
36 }
unsigned char parity(uint64_t x)
Definition: math.cpp:43
unsigned char uint8_t
Definition: rtptypes_win.h:42
+ Here is the call graph for this function:

◆ parity() [3/4]

unsigned char leansdr::parity ( uint32_t  x)

Definition at line 38 of file math.cpp.

References parity().

39 {
40  return parity((uint16_t)(x ^ (x >> 16)));
41 }
unsigned char parity(uint64_t x)
Definition: math.cpp:43
unsigned short uint16_t
Definition: rtptypes_win.h:44
+ Here is the call graph for this function:

◆ parity() [4/4]

unsigned char leansdr::parity ( uint64_t  x)

Definition at line 43 of file math.cpp.

References parity().

44 {
45  return parity((uint32_t)(x ^ (x >> 32)));
46 }
unsigned char parity(uint64_t x)
Definition: math.cpp:43
unsigned int uint32_t
Definition: rtptypes_win.h:46
+ Here is the call graph for this function:

◆ prob()

float leansdr::prob ( llr_t  l)

Definition at line 79 of file softword.h.

Referenced by llr_xor().

80 {
81  return (127.0 + l) / 254;
82 }
+ Here is the caller graph for this function:

◆ shiftdivmod()

template<typename T , int N, typename Tm >
bitvect<T, N> leansdr::shiftdivmod ( const Tm *  m,
size_t  nm,
const bitvect< T, N > &  p,
init = 0 
)

Definition at line 138 of file discrmath.h.

References i, leansdr::bitvect< T, N >::NW, and leansdr::bitvect< T, N >::v.

Referenced by leansdr::crc8_engine::crc8_engine(), and leansdr::bch_engine< T, N, NP, DP, TGF, GFTRUNCGEN >::encode().

140 {
141  bitvect<T, N> res;
142  for (int i = 0; i < res.NW; ++i)
143  res.v[i] = init;
144  const Tm bitmask = (Tm)1 << (sizeof(Tm) * 8 - 1);
145  for (; nm--; ++m)
146  {
147  Tm mi = *m;
148  for (int bit = sizeof(Tm) * 8; bit--; mi <<= 1)
149  {
150  // Multiply by X, save outgoing coeff of degree N
151  bool resN = res[N - 1];
152  res <<= 1;
153  // Add m[i]*X^N
154  resN ^= (bool)(mi & bitmask);
155  // Modulo X^N+p
156  if (resN)
157  res += p;
158  }
159  }
160  return res;
161 }
int32_t i
Definition: decimators.h:244
+ Here is the caller graph for this function:

◆ softbit_clear() [1/2]

void leansdr::softbit_clear ( bool *  p)
inline

Definition at line 41 of file softword.h.

Referenced by leansdr::ldpc_engine< SOFTBIT, SOFTWORD, SWSIZE, Taddr >::diff_bits(), and leansdr::ldpc_engine< SOFTBIT, SOFTWORD, SWSIZE, Taddr >::integrate_bits().

41 { *p = false; }
+ Here is the caller graph for this function:

◆ softbit_clear() [2/2]

void leansdr::softbit_clear ( llr_t p)
inline

Definition at line 135 of file softword.h.

135 { *p = -127; }

◆ softbit_harden() [1/2]

bool leansdr::softbit_harden ( bool  b)
inline

◆ softbit_harden() [2/2]

bool leansdr::softbit_harden ( llr_t  l)
inline

Definition at line 120 of file softword.h.

120 { return (l < 0); }

◆ softbit_set() [1/2]

void leansdr::softbit_set ( bool *  p,
bool  v 
)
inline

Definition at line 37 of file softword.h.

Referenced by leansdr::ldpc_engine< SOFTBIT, SOFTWORD, SWSIZE, Taddr >::decode_bitflip().

37 { *p = v; }
+ Here is the caller graph for this function:

◆ softbit_set() [2/2]

void leansdr::softbit_set ( llr_t p,
bool  v 
)
inline

Definition at line 119 of file softword.h.

119 { *p = v ? -127 : 127; }

◆ softbit_xor() [1/2]

bool leansdr::softbit_xor ( bool  x,
bool  y 
)
inline

Definition at line 40 of file softword.h.

Referenced by leansdr::ldpc_engine< SOFTBIT, SOFTWORD, SWSIZE, Taddr >::diff_bits(), and leansdr::ldpc_engine< SOFTBIT, SOFTWORD, SWSIZE, Taddr >::integrate_bits().

40 { return x ^ y; }
+ Here is the caller graph for this function:

◆ softbit_xor() [2/2]

llr_t leansdr::softbit_xor ( llr_t  x,
llr_t  y 
)
inline

Definition at line 134 of file softword.h.

References llr_xor().

134 { return llr_xor(x, y); }
llr_t llr_xor(llr_t lx, llr_t ly)
Definition: softword.h:92
+ Here is the call graph for this function:

◆ softbyte_harden() [1/2]

uint8_t leansdr::softbyte_harden ( const hard_sb b)
inline

Definition at line 39 of file softword.h.

Referenced by softbytes_harden().

39 { return b; }
+ Here is the caller graph for this function:

◆ softbyte_harden() [2/2]

uint8_t leansdr::softbyte_harden ( const llr_sb b)
inline

Definition at line 121 of file softword.h.

References leansdr::llr_sb::bits.

122 {
123  // Without conditional jumps
124  uint8_t r = (((b.bits[0] & 128) >> 0) |
125  ((b.bits[1] & 128) >> 1) |
126  ((b.bits[2] & 128) >> 2) |
127  ((b.bits[3] & 128) >> 3) |
128  ((b.bits[4] & 128) >> 4) |
129  ((b.bits[5] & 128) >> 5) |
130  ((b.bits[6] & 128) >> 6) |
131  ((b.bits[7] & 128) >> 7));
132  return r;
133 }
unsigned char uint8_t
Definition: rtptypes_win.h:42

◆ softbytes_harden() [1/2]

uint8_t* leansdr::softbytes_harden ( hard_sb  p[],
int  nbytes,
uint8_t  storage[] 
)

Definition at line 67 of file softword.h.

Referenced by leansdr::s2_fecdec_helper< SOFTBIT, SOFTBYTE >::receive_frame(), and leansdr::s2_fecdec< SOFTBIT, SOFTBYTE >::run().

68 {
69  return p;
70 }
+ Here is the caller graph for this function:

◆ softbytes_harden() [2/2]

uint8_t* leansdr::softbytes_harden ( llr_sb  p[],
int  nbytes,
uint8_t  storage[] 
)

Definition at line 161 of file softword.h.

References softbyte_harden().

162 {
163  for (uint8_t *q = storage; nbytes--; ++p, ++q)
164  *q = softbyte_harden(*p);
165  return storage;
166 }
uint8_t softbyte_harden(const llr_sb &b)
Definition: softword.h:121
unsigned char uint8_t
Definition: rtptypes_win.h:42
+ Here is the call graph for this function:

◆ softsymb_harden() [1/3]

void leansdr::softsymb_harden ( llr_ss ss)

Definition at line 20 of file sdr.cpp.

References leansdr::llr_ss::bits.

Referenced by leansdr::cstln_lut< SOFTSYMB, 256 >::harden().

21 {
22  for (int b = 0; b < 8; ++b)
23  ss->bits[b] = (ss->bits[b] < 0) ? -127 : 127;
24 }
+ Here is the caller graph for this function:

◆ softsymb_harden() [2/3]

void leansdr::softsymb_harden ( hard_ss ss)

Definition at line 26 of file sdr.cpp.

27 {
28  (void)ss; // NOP
29 }

◆ softsymb_harden() [3/3]

void leansdr::softsymb_harden ( eucl_ss ss)

Definition at line 31 of file sdr.cpp.

References leansdr::eucl_ss::dists2, leansdr::eucl_ss::MAX_SYMBOLS, and leansdr::eucl_ss::nearest.

32 {
33  for (int s = 0; s < ss->MAX_SYMBOLS; ++s)
34  ss->dists2[s] = (s == ss->nearest) ? 0 : 1;
35 }

◆ softsymb_to_dump() [1/3]

uint8_t leansdr::softsymb_to_dump ( const llr_ss ss,
int  bit 
)

Definition at line 38 of file sdr.cpp.

References leansdr::llr_ss::bits.

Referenced by leansdr::cstln_lut< SOFTSYMB, 256 >::dump().

39 {
40  return 128 - ss.bits[bit];
41 }
+ Here is the caller graph for this function:

◆ softsymb_to_dump() [2/3]

uint8_t leansdr::softsymb_to_dump ( const hard_ss ss,
int  bit 
)

Definition at line 43 of file sdr.cpp.

44 {
45  return ((ss >> bit) & 1) ? 255 : 0;
46 }

◆ softsymb_to_dump() [3/3]

uint8_t leansdr::softsymb_to_dump ( const eucl_ss ss,
int  bit 
)

Definition at line 48 of file sdr.cpp.

References leansdr::eucl_ss::dists2, and leansdr::eucl_ss::nearest.

49 {
50  (void)bit;
51  return ss.dists2[ss.nearest] >> 8;
52 }

◆ softword_clear() [1/2]

void leansdr::softword_clear ( hard_sb p)
inline

◆ softword_clear() [2/2]

void leansdr::softword_clear ( llr_sb p)
inline

Definition at line 111 of file softword.h.

References leansdr::llr_sb::bits.

112 {
113  memset(p->bits, 0, sizeof(p->bits));
114 }

◆ softword_get() [1/2]

bool leansdr::softword_get ( const hard_sb p,
int  b 
)
inline

◆ softword_get() [2/2]

llr_t leansdr::softword_get ( const llr_sb p,
int  b 
)
inline

Definition at line 98 of file softword.h.

References leansdr::llr_sb::bits.

99 {
100  return p.bits[b];
101 }

◆ softword_set() [1/2]

void leansdr::softword_set ( hard_sb p,
int  b,
bool  v 
)
inline

Definition at line 27 of file softword.h.

Referenced by softwords_set().

28 {
29  hard_sb mask = 1 << (7 - b);
30  *p = ((*p) & ~mask) | (v << (7 - b));
31 }
uint8_t hard_sb
Definition: softword.h:21
+ Here is the caller graph for this function:

◆ softword_set() [2/2]

void leansdr::softword_set ( llr_sb p,
int  b,
llr_t  v 
)
inline

Definition at line 107 of file softword.h.

References leansdr::llr_sb::bits.

108 {
109  p->bits[b] = v;
110 }

◆ softword_weight() [1/2]

bool leansdr::softword_weight ( const bool &  l)
inline

Definition at line 33 of file softword.h.

Referenced by softwords_weight().

34 {
35  return true;
36 }
+ Here is the caller graph for this function:

◆ softword_weight() [2/2]

llr_t leansdr::softword_weight ( llr_t  l)
inline

Definition at line 118 of file softword.h.

References abs().

118 { return abs(l); }
Fixed< IntType, IntBits > abs(Fixed< IntType, IntBits > const &x)
Definition: fixed.h:2313
+ Here is the call graph for this function:

◆ softword_write() [1/2]

void leansdr::softword_write ( hard_sb p,
int  b,
bool  v 
)
inline

Definition at line 54 of file softword.h.

Referenced by leansdr::ldpc_engine< SOFTBIT, SOFTWORD, SWSIZE, Taddr >::diff_bits(), leansdr::ldpc_engine< SOFTBIT, SOFTWORD, SWSIZE, Taddr >::integrate_bits(), and softwords_write().

55 {
56  hard_sb mask = 1 << (7 - b);
57  p = (p & ~mask) | (hard_sb)v << (7 - b);
58 }
uint8_t hard_sb
Definition: softword.h:21
+ Here is the caller graph for this function:

◆ softword_write() [2/2]

void leansdr::softword_write ( llr_sb p,
int  b,
llr_t  v 
)
inline

Definition at line 148 of file softword.h.

References leansdr::llr_sb::bits.

149 {
150  p.bits[b] = v;
151 }

◆ softword_zero() [1/2]

void leansdr::softword_zero ( hard_sb p)
inline

Definition at line 46 of file softword.h.

Referenced by leansdr::ldpc_engine< SOFTBIT, SOFTWORD, SWSIZE, Taddr >::count_edges(), and leansdr::ldpc_engine< SOFTBIT, SOFTWORD, SWSIZE, Taddr >::encode().

47 {
48  *p = 0;
49 }
+ Here is the caller graph for this function:

◆ softword_zero() [2/2]

void leansdr::softword_zero ( llr_sb p)
inline

Definition at line 140 of file softword.h.

141 {
142  memset(p, -127, sizeof(*p));
143 }

◆ softwords_flip() [1/2]

void leansdr::softwords_flip ( hard_sb  p[],
int  b 
)
inline

◆ softwords_flip() [2/2]

void leansdr::softwords_flip ( llr_sb  p[],
int  b 
)
inline

Definition at line 156 of file softword.h.

References leansdr::llr_sb::bits.

157 {
158  llr_t *l = &p[b / 8].bits[b & 7];
159  *l = -*l;
160 }
int8_t llr_t
Definition: sdr.h:444

◆ softwords_get() [1/2]

llr_t leansdr::softwords_get ( const llr_sb  p[],
int  b 
)
inline

Definition at line 103 of file softword.h.

References leansdr::llr_sb::bits.

104 {
105  return p[0].bits[b]; // Beyond bounds on purpose
106 }

◆ softwords_get() [2/2]

template<typename SOFTBIT , typename SOFTBYTE >
SOFTBIT leansdr::softwords_get ( const SOFTBYTE  p[],
int  b 
)
inline

Definition at line 171 of file softword.h.

References softword_get().

172 {
173  return softword_get(p[b / 8], b & 7);
174 }
llr_t softword_get(const llr_sb &p, int b)
Definition: softword.h:98
+ Here is the call graph for this function:

◆ softwords_set() [1/3]

void leansdr::softwords_set ( hard_sb  p[],
int  b 
)
inline

Definition at line 50 of file softword.h.

Referenced by leansdr::s2_deinterleaver< SOFTSYMB, SOFTBYTE >::deinterleave4050().

51 {
52  p[b / 8] |= 1 << (7 - (b & 7));
53 }
+ Here is the caller graph for this function:

◆ softwords_set() [2/3]

void leansdr::softwords_set ( llr_sb  p[],
int  b 
)
inline

Definition at line 144 of file softword.h.

References leansdr::llr_sb::bits.

145 {
146  p[b / 8].bits[b & 7] = 127;
147 }

◆ softwords_set() [3/3]

template<typename SOFTBIT , typename SOFTBYTE >
void leansdr::softwords_set ( SOFTBYTE  p[],
int  b,
SOFTBIT  v 
)
inline

Definition at line 176 of file softword.h.

References softword_set().

177 {
178  softword_set(&p[b / 8], b & 7, v);
179 }
void softword_set(llr_sb *p, int b, llr_t v)
Definition: softword.h:107
+ Here is the call graph for this function:

◆ softwords_weight()

template<typename SOFTBIT , typename SOFTBYTE >
SOFTBIT leansdr::softwords_weight ( const SOFTBYTE  p[],
int  b 
)
inline

Definition at line 181 of file softword.h.

References softword_weight().

182 {
183  return softword_weight(softwords_get<SOFTBIT, SOFTBYTE>(p, b));
184 }
llr_t softword_weight(llr_t l)
Definition: softword.h:118
+ Here is the call graph for this function:

◆ softwords_write() [1/2]

void leansdr::softwords_write ( hard_sb  p[],
int  b,
bool  v 
)
inline

Definition at line 59 of file softword.h.

References softword_write().

60 {
61  softword_write(p[b / 8], b & 7, v);
62 }
void softword_write(llr_sb &p, int b, llr_t v)
Definition: softword.h:148
+ Here is the call graph for this function:

◆ softwords_write() [2/2]

void leansdr::softwords_write ( llr_sb  p[],
int  b,
llr_t  v 
)
inline

Definition at line 152 of file softword.h.

References softword_write().

153 {
154  softword_write(p[b / 8], b & 7, v);
155 }
void softword_write(llr_sb &p, int b, llr_t v)
Definition: softword.h:148
+ Here is the call graph for this function:

◆ softwords_xor() [1/2]

bool leansdr::softwords_xor ( const hard_sb  p1[],
const hard_sb  p2[],
int  b 
)
inline

Definition at line 42 of file softword.h.

Referenced by leansdr::ldpc_engine< SOFTBIT, SOFTWORD, SWSIZE, Taddr >::compute_scores(), and leansdr::ldpc_engine< SOFTBIT, SOFTWORD, SWSIZE, Taddr >::decode_bitflip().

43 {
44  return (p1[b / 8] ^ p2[b / 8]) & (1 << (7 - (b & 7)));
45 }
+ Here is the caller graph for this function:

◆ softwords_xor() [2/2]

llr_t leansdr::softwords_xor ( const llr_sb  p1[],
const llr_sb  p2[],
int  b 
)
inline

Definition at line 136 of file softword.h.

References leansdr::llr_sb::bits, and llr_xor().

137 {
138  return llr_xor(p1[b / 8].bits[b & 7], p2[b / 8].bits[b & 7]);
139 }
llr_t llr_xor(llr_t lx, llr_t ly)
Definition: softword.h:92
+ Here is the call graph for this function:

◆ to_softsymb() [1/3]

void leansdr::to_softsymb ( const full_ss fss,
hard_ss ss 
)

Definition at line 55 of file sdr.cpp.

References leansdr::full_ss::nearest.

Referenced by leansdr::cstln_lut< SOFTSYMB, 256 >::make_lut_from_symbols().

56 {
57  *ss = fss->nearest;
58 }
+ Here is the caller graph for this function:

◆ to_softsymb() [2/3]

void leansdr::to_softsymb ( const full_ss fss,
eucl_ss ss 
)

Definition at line 60 of file sdr.cpp.

References leansdr::eucl_ss::discr2, leansdr::full_ss::dists2, leansdr::eucl_ss::dists2, leansdr::eucl_ss::MAX_SYMBOLS, leansdr::full_ss::nearest, and leansdr::eucl_ss::nearest.

61 {
62  for (int s = 0; s < ss->MAX_SYMBOLS; ++s)
63  ss->dists2[s] = fss->dists2[s];
64 
65  uint16_t best = 65535, best2 = 65535;
66 
67  for (int s = 0; s < ss->MAX_SYMBOLS; ++s)
68  {
69  if (fss->dists2[s] < best)
70  {
71  best2 = best;
72  best = fss->dists2[s];
73  }
74  else if (fss->dists2[s] < best2)
75  {
76  best2 = fss->dists2[s];
77  }
78  }
79 
80  ss->discr2 = best2 - best;
81  ss->nearest = fss->nearest;
82 }
unsigned short uint16_t
Definition: rtptypes_win.h:44

◆ to_softsymb() [3/3]

void leansdr::to_softsymb ( const full_ss fss,
llr_ss ss 
)

Definition at line 84 of file sdr.cpp.

References leansdr::llr_ss::bits, and leansdr::full_ss::p.

85 {
86  for (int b = 0; b < 8; ++b)
87  {
88  float v = (1.0f - fss->p[b]) / (fss->p[b] + 1e-6);
89  int r = logf(v) * 5; // TBD Optimal scaling vs saturation ?
90  if (r < -127)
91  r = -127;
92  if (r > 127)
93  r = 127;
94  ss->bits[b] = r;
95  }
96 }

Variable Documentation

◆ cstln_amp

const float leansdr::cstln_amp = 75

◆ modcod_infos

const struct leansdr::modcod_info leansdr::modcod_infos[32]