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 Member Functions | Public Attributes | List of all members
leansdr::s2_scrambling Struct Reference

#include <dvbs2.h>

Public Member Functions

 s2_scrambling (int codenum=0)
 
uint32_t lfsr_x (uint32_t X)
 
uint32_t lfsr_y (uint32_t Y)
 

Public Attributes

uint8_t Rn [131072]
 

Detailed Description

Definition at line 127 of file dvbs2.h.

Constructor & Destructor Documentation

◆ s2_scrambling()

leansdr::s2_scrambling::s2_scrambling ( int  codenum = 0)
inline

Definition at line 130 of file dvbs2.h.

References i.

131  {
132  uint32_t stx = 0x00001, sty = 0x3ffff;
133  // x starts at codenum, wraps at index 2^18-1 by design
134  for (int i = 0; i < codenum; ++i)
135  stx = lfsr_x(stx);
136  // First half of sequence is LSB of scrambling angle
137  for (int i = 0; i < 131072; ++i)
138  {
139  int zn = (stx ^ sty) & 1;
140  Rn[i] = zn;
141  stx = lfsr_x(stx);
142  sty = lfsr_y(sty);
143  }
144  // Second half is MSB
145  for (int i = 0; i < 131072; ++i)
146  {
147  int zn = (stx ^ sty) & 1;
148  Rn[i] |= zn << 1;
149  stx = lfsr_x(stx);
150  sty = lfsr_y(sty);
151  }
152  }
uint32_t lfsr_x(uint32_t X)
Definition: dvbs2.h:153
uint8_t Rn[131072]
Definition: dvbs2.h:129
unsigned int uint32_t
Definition: rtptypes_win.h:46
int32_t i
Definition: decimators.h:244
uint32_t lfsr_y(uint32_t Y)
Definition: dvbs2.h:158

Member Function Documentation

◆ lfsr_x()

uint32_t leansdr::s2_scrambling::lfsr_x ( uint32_t  X)
inline

Definition at line 153 of file dvbs2.h.

154  {
155  int bit = ((X >> 7) ^ X) & 1;
156  return ((bit << 18) | X) >> 1;
157  }

◆ lfsr_y()

uint32_t leansdr::s2_scrambling::lfsr_y ( uint32_t  Y)
inline

Definition at line 158 of file dvbs2.h.

159  {
160  int bit = ((Y >> 10) ^ (Y >> 7) ^ (Y >> 5) ^ Y) & 1;
161  return ((bit << 18) | Y) >> 1;
162  }

Member Data Documentation

◆ Rn

uint8_t leansdr::s2_scrambling::Rn[131072]

Definition at line 129 of file dvbs2.h.


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