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.
Public Types | Public Member Functions | Public Attributes | Private Attributes | List of all members
leansdr::convol_multipoly< Thist, HISTSIZE > Struct Template Reference

#include <convolutional.h>

Public Types

typedef u8 uncoded_byte
 
typedef u8 hardsymbol
 

Public Member Functions

 convol_multipoly ()
 
void encode (const uncoded_byte *pin, hardsymbol *pout, int count)
 

Public Attributes

int bits_in
 
int bits_out
 
int bps
 
const Thist * polys
 

Private Attributes

Thist hist
 
int nhist
 
Thist sersymb
 
int nsersymb
 

Detailed Description

template<typename Thist, int HISTSIZE>
struct leansdr::convol_multipoly< Thist, HISTSIZE >

Definition at line 281 of file convolutional.h.

Member Typedef Documentation

◆ hardsymbol

template<typename Thist, int HISTSIZE>
typedef u8 leansdr::convol_multipoly< Thist, HISTSIZE >::hardsymbol

Definition at line 284 of file convolutional.h.

◆ uncoded_byte

template<typename Thist, int HISTSIZE>
typedef u8 leansdr::convol_multipoly< Thist, HISTSIZE >::uncoded_byte

Definition at line 283 of file convolutional.h.

Constructor & Destructor Documentation

◆ convol_multipoly()

template<typename Thist, int HISTSIZE>
leansdr::convol_multipoly< Thist, HISTSIZE >::convol_multipoly ( )
inline

Member Function Documentation

◆ encode()

template<typename Thist, int HISTSIZE>
void leansdr::convol_multipoly< Thist, HISTSIZE >::encode ( const uncoded_byte pin,
hardsymbol pout,
int  count 
)
inline

Definition at line 294 of file convolutional.h.

295  {
296  if (!bits_in || !bits_out || !bps) {
297  fatal("convol_multipoly not configured");
298  }
299 
300  hardsymbol symbmask = (1 << bps) - 1;
301 
302  for (; count--; ++pin)
303  {
304  uncoded_byte b = *pin;
305 
306  for (int bit = 8; bit--;)
307  {
308  hist = (hist >> 1) | ((Thist)((b >> bit) & 1) << (HISTSIZE - 1));
309  ++nhist;
310 
311  if (nhist == bits_in)
312  {
313  for (int p = 0; p < bits_out; ++p)
314  {
315  int b = parity((Thist)(hist & polys[p]));
316  sersymb = (sersymb << 1) | b;
317  }
318 
319  nhist = 0;
320  nsersymb += bits_out;
321 
322  while (nsersymb >= bps)
323  {
324  hardsymbol s = (sersymb >> (nsersymb - bps)) & symbmask;
325  *pout++ = s;
326  nsersymb -= bps;
327  }
328  }
329  }
330  }
331  // Ensure deterministic output size
332  // TBD We can relax this
333  if (nhist || nsersymb) {
334  fatal("partial run");
335  }
336  }
void fatal(const char *s)
Definition: framework.cpp:6
unsigned char parity(uint8_t x)
Definition: math.cpp:27

Member Data Documentation

◆ bits_in

template<typename Thist, int HISTSIZE>
int leansdr::convol_multipoly< Thist, HISTSIZE >::bits_in

Definition at line 285 of file convolutional.h.

◆ bits_out

template<typename Thist, int HISTSIZE>
int leansdr::convol_multipoly< Thist, HISTSIZE >::bits_out

Definition at line 285 of file convolutional.h.

◆ bps

template<typename Thist, int HISTSIZE>
int leansdr::convol_multipoly< Thist, HISTSIZE >::bps

Definition at line 285 of file convolutional.h.

◆ hist

template<typename Thist, int HISTSIZE>
Thist leansdr::convol_multipoly< Thist, HISTSIZE >::hist
private

Definition at line 339 of file convolutional.h.

◆ nhist

template<typename Thist, int HISTSIZE>
int leansdr::convol_multipoly< Thist, HISTSIZE >::nhist
private

Definition at line 340 of file convolutional.h.

◆ nsersymb

template<typename Thist, int HISTSIZE>
int leansdr::convol_multipoly< Thist, HISTSIZE >::nsersymb
private

Definition at line 342 of file convolutional.h.

◆ polys

template<typename Thist, int HISTSIZE>
const Thist* leansdr::convol_multipoly< Thist, HISTSIZE >::polys

Definition at line 286 of file convolutional.h.

◆ sersymb

template<typename Thist, int HISTSIZE>
Thist leansdr::convol_multipoly< Thist, HISTSIZE >::sersymb
private

Definition at line 341 of file convolutional.h.


The documentation for this struct was generated from the following file: