GNU Radio's DVBS2RX Package
gr::dvbs2rx Namespace Reference

Classes

struct  base_interpolator
 
class  bbdeheader_bb
 <+description of block+> More...
 
class  bbdeheader_bb_impl
 
class  bbdescrambler_bb
 <+description of block+> More...
 
class  bbdescrambler_bb_impl
 
struct  BBHeader
 
class  bch_codec
 BCH coder/decoder. More...
 
class  bch_decoder_bb
 <+description of block+> More...
 
class  bch_decoder_bb_impl
 
struct  bch_info_t
 
class  cdeque
 
struct  cubic_interpolator
 
class  delay_line
 Fixed-size delay-line with contiguous storage of volk-aligned elements. More...
 
struct  fec_info_t
 
class  frame_sync
 Frame Synchronizer. More...
 
class  freq_sync
 Frequency Synchronizer. More...
 
class  galois_field
 Galois Field GF(2^m). More...
 
class  gf2_poly
 Polynomial over GF(2). More...
 
class  gf2m_poly
 Polynomial over GF(2^m). More...
 
class  ldpc_decoder_bb
 <+description of block+> More...
 
class  ldpc_decoder_bb_impl
 
struct  ldpc_info_t
 
struct  linear_interpolator
 
struct  phase_inc_update_t
 
class  pl_descrambler
 PL Descrambler. More...
 
class  pl_submodule
 
struct  plframe_idx_t
 Index tracking for various segments of a PLFRAME. More...
 
struct  plframe_info_t
 
struct  pls_info_t
 
class  plsc_decoder
 PLSC Decoder. More...
 
class  plsc_encoder
 PLSC Encoder. More...
 
class  plsync_cc
 DVB-S2 Physical Layer (PL) Synchronizer. More...
 
class  plsync_cc_impl
 
struct  polyphase_interpolator
 
class  QpskConstellation
 QPSK Constellation. More...
 
struct  quadratic_interpolator
 
class  reed_muller
 Interleaved (64, 7, 32) Reed-Muller encoder/decoder. More...
 
struct  rot_ctrl_t
 
struct  rot_phase_adj_t
 
struct  rot_state_t
 
class  rotator_cc
 Complex rotator. More...
 
class  rotator_cc_impl
 Complex rotator. More...
 
class  symbol_sync_cc
 Symbol Synchronizer Loop. More...
 
class  symbol_sync_cc_impl
 
class  xfecframe_demapper_cb
 XFECFRAME Constellation Demapper. More...
 
class  xfecframe_demapper_cb_impl
 

Typedefs

typedef std::bitset< 256 > bitset256_t
 
typedef gf2_poly< uint16_t > gf2_poly_u16
 
typedef gf2_poly< uint32_t > gf2_poly_u32
 
typedef gf2_poly< uint64_t > gf2_poly_u64
 
typedef gf2_poly< bitset256_tgf2_poly_b256
 
typedef std::vector< unsigned char > u8_vector_t
 
typedef unsigned char * u8_ptr_t
 
typedef const unsigned char * u8_cptr_t
 
typedef void(* euclidean_map_func_ptr) (float *dptr, uint64_t codeword)
 
typedef std::priority_queue< phase_inc_update_t, std::vector< phase_inc_update_t >, decltype(&cmp_phase_inc_update_offset)> phase_inc_queue_t
 

Enumerations

enum  dvb_standard_t { STANDARD_DVBS2 = 0 , STANDARD_DVBT2 }
 
enum  dvb_code_rate_t {
  C1_4 = 0 , C1_3 , C2_5 , C1_2 ,
  C3_5 , C2_3 , C3_4 , C4_5 ,
  C5_6 , C7_8 , C8_9 , C9_10 ,
  C13_45 , C9_20 , C90_180 , C96_180 ,
  C11_20 , C100_180 , C104_180 , C26_45 ,
  C18_30 , C28_45 , C23_36 , C116_180 ,
  C20_30 , C124_180 , C25_36 , C128_180 ,
  C13_18 , C132_180 , C22_30 , C135_180 ,
  C140_180 , C7_9 , C154_180 , C11_45 ,
  C4_15 , C14_45 , C7_15 , C8_15 ,
  C32_45 , C2_9_VLSNR , C1_5_MEDIUM , C11_45_MEDIUM ,
  C1_3_MEDIUM , C1_5_VLSNR_SF2 , C11_45_VLSNR_SF2 , C1_5_VLSNR ,
  C4_15_VLSNR , C1_3_VLSNR , C_OTHER
}
 
enum  dvb_framesize_t { FECFRAME_SHORT = 0 , FECFRAME_NORMAL , FECFRAME_MEDIUM }
 
enum  dvb_constellation_t {
  MOD_QPSK = 0 , MOD_16QAM , MOD_64QAM , MOD_256QAM ,
  MOD_8PSK , MOD_8APSK , MOD_16APSK , MOD_8_8APSK ,
  MOD_32APSK , MOD_4_12_16APSK , MOD_4_8_4_16APSK , MOD_64APSK ,
  MOD_8_16_20_20APSK , MOD_4_12_20_28APSK , MOD_128APSK , MOD_256APSK ,
  MOD_BPSK , MOD_BPSK_SF2 , MOD_8VSB , MOD_OTHER
}
 
enum  dvb_guardinterval_t {
  GI_1_32 = 0 , GI_1_16 , GI_1_8 , GI_1_4 ,
  GI_1_128 , GI_19_128 , GI_19_256
}
 
enum  dvb_outputmode_t { OM_CODEWORD = 0 , OM_MESSAGE }
 
enum  dvb_infomode_t { INFO_OFF = 0 , INFO_ON }
 
enum  dvbs2_rolloff_factor_t {
  RO_0_35 = 0 , RO_0_25 , RO_0_20 , RO_RESERVED ,
  RO_0_15 , RO_0_10 , RO_0_05
}
 
enum  dvbs2_pilots_t { PILOTS_OFF = 0 , PILOTS_ON }
 
enum  dvbs2_interpolation_t { INTERPOLATION_OFF = 0 , INTERPOLATION_ON }
 
enum  dvbt2_rotation_t { ROTATION_OFF = 0 , ROTATION_ON }
 
enum  dvbt2_streamtype_t { STREAMTYPE_TS = 0 , STREAMTYPE_GS , STREAMTYPE_BOTH }
 
enum  dvbt2_inputmode_t { INPUTMODE_NORMAL = 0 , INPUTMODE_HIEFF }
 
enum  dvbt2_extended_carrier_t { CARRIERS_NORMAL = 0 , CARRIERS_EXTENDED }
 
enum  dvbt2_preamble_t {
  PREAMBLE_T2_SISO = 0 , PREAMBLE_T2_MISO , PREAMBLE_NON_T2 , PREAMBLE_T2_LITE_SISO ,
  PREAMBLE_T2_LITE_MISO
}
 
enum  dvbt2_fftsize_t {
  FFTSIZE_2K = 0 , FFTSIZE_8K , FFTSIZE_4K , FFTSIZE_1K ,
  FFTSIZE_16K , FFTSIZE_32K , FFTSIZE_8K_T2GI , FFTSIZE_32K_T2GI ,
  FFTSIZE_16K_T2GI = 11
}
 
enum  dvbt2_papr_t { PAPR_OFF = 0 , PAPR_ACE , PAPR_TR , PAPR_BOTH }
 
enum  dvbt2_l1constellation_t { L1_MOD_BPSK = 0 , L1_MOD_QPSK , L1_MOD_16QAM , L1_MOD_64QAM }
 
enum  dvbt2_pilotpattern_t {
  PILOT_PP1 = 0 , PILOT_PP2 , PILOT_PP3 , PILOT_PP4 ,
  PILOT_PP5 , PILOT_PP6 , PILOT_PP7 , PILOT_PP8
}
 
enum  dvbt2_version_t { VERSION_111 = 0 , VERSION_121 , VERSION_131 }
 
enum  dvbt2_reservedbiasbits_t { RESERVED_OFF = 0 , RESERVED_ON }
 
enum  dvbt2_l1scrambled_t { L1_SCRAMBLED_OFF = 0 , L1_SCRAMBLED_ON }
 
enum  dvbt2_misogroup_t { MISO_TX1 = 0 , MISO_TX2 }
 
enum  dvbt2_showlevels_t { SHOWLEVELS_OFF = 0 , SHOWLEVELS_ON }
 
enum  dvbt2_inband_t { INBAND_OFF = 0 , INBAND_ON }
 
enum  dvbt2_equalization_t { EQUALIZATION_OFF = 0 , EQUALIZATION_ON }
 
enum  dvbt2_bandwidth_t {
  BANDWIDTH_1_7_MHZ = 0 , BANDWIDTH_5_0_MHZ , BANDWIDTH_6_0_MHZ , BANDWIDTH_7_0_MHZ ,
  BANDWIDTH_8_0_MHZ , BANDWIDTH_10_0_MHZ
}
 
enum class  frame_sync_state_t { searching , found , locked }
 
enum class  payload_state_t { searching , pending , partial }
 

Functions

template<typename T >
std::array< T, 256 > build_crc_lut (const T &gen_poly_no_msb)
 Build the CRC computation look-up table (LUT)
 
template<typename T >
calc_crc (const std::vector< uint8_t > &in_bytes, const std::array< T, 256 > &crc_lut)
 Compute the CRC of a sequence of input bytes.
 
void get_fec_info (dvb_standard_t standard, dvb_framesize_t framesize, dvb_code_rate_t rate, fec_info_t &fec_info)
 
template<typename T >
bool is_bit_set (const T &x, int i_bit)
 Test if bit is set.
 
template<>
bool is_bit_set (const bitset256_t &x, int i_bit)
 
template<typename T >
constexpr size_t get_max_gf2_poly_degree ()
 Get the maximum degree a GF2 polynomial can have with type T.
 
template<>
constexpr size_t get_max_gf2_poly_degree< bitset256_t > ()
 
template<typename Ta , typename Tb >
gf2_poly< Tb > operator% (const gf2_poly< Ta > a, const gf2_poly< Tb > b)
 Compute the remainder of the division between two GF(2) polynomials.
 
template<typename Ta , typename Tb >
void check_rem_types (const gf2_poly< Ta > a, const gf2_poly< Tb > b)
 
template<typename Tb >
void check_rem_types (const gf2_poly< bitset256_t > a, const gf2_poly< Tb > b)
 
template<typename Ta >
void check_rem_types (const gf2_poly< Ta > a, const gf2_poly< bitset256_t > b)
 
void check_rem_types (const gf2_poly< bitset256_t > a, const gf2_poly< bitset256_t > b)
 
template<typename T >
bitmask (int n_bits)
 Get bitmask for the least significant bits of a type T.
 
template<>
bitset256_t bitmask (int n_bits)
 
template<typename T >
uint8_t get_byte (const T &value, uint32_t byte_index)
 Get the byte at a given index of a type T value.
 
template<>
uint8_t get_byte (const bitset256_t &value, uint32_t byte_index)
 
template<typename T >
uint8_t get_msby (const T &value, uint32_t lsb_index)
 Get the most significant byte of a given value.
 
template<>
uint8_t get_msby (const bitset256_t &value, uint32_t lsb_index)
 
template<typename T >
u8_vector_t to_u8_vector (T val, size_t n_bytes=sizeof(T))
 Convert type to u8 vector in network byte order (big-endian)
 
template<typename T >
from_u8_array (u8_cptr_t in, size_t size)
 Convert u8 array in network byte order (big-endian) to type.
 
template<typename T >
from_u8_vector (const u8_vector_t &vec)
 Convert u8 vector in network byte order (big-endian) to type.
 
template<typename T >
std::array< T, 256 > build_gf2_poly_rem_lut (const gf2_poly< T > &x)
 Build LUT to assist with GF(2) polynomial remainder computation.
 
template<typename T >
gf2_poly< T > gf2_poly_rem (u8_cptr_t y, const int y_size, const gf2_poly< T > &x, const std::array< T, 256 > &x_lut)
 Compute the remainder "y % x" of GF2 polynomials y and x using a LUT.
 
template<typename T >
gf2_poly< T > gf2_poly_rem (const u8_vector_t &y, const gf2_poly< T > &x, const std::array< T, 256 > &x_lut)
 
DVBS2RX_API void map_bpsk (uint64_t code, gr_complex *out, unsigned int N)
 Map N bits from the PLHEADER into pi/2 BPSK symbols.
 
DVBS2RX_API uint64_t demap_bpsk (const gr_complex *in, unsigned int N)
 Coherently demap N pi/2 BPSK symbols from the PLHEADER into bits.
 
DVBS2RX_API uint64_t demap_bpsk_diff (const gr_complex *in, unsigned int N)
 Differentially demap N pi/2 BPSK symbols from the PSLC into bits.
 
DVBS2RX_API void derotate_bpsk (const gr_complex *in, float *out, unsigned int N)
 Derotate N complex-valued pi/2 BPSK into regular real BPSK symbols.
 
bool cmp_phase_inc_update_offset (phase_inc_update_t lhs, phase_inc_update_t rhs)
 
void dump_real_vec (const float *vec, unsigned int N, const char *label)
 
void dump_real_vec (const volk::vector< float > &vec, unsigned int N, const char *label)
 
void dump_real_vec (const delay_line< float > &vec, const char *label)
 
void dump_complex_vec (const gr_complex *vec, unsigned int N, const char *label)
 
void dump_complex_vec (const volk::vector< gr_complex > &vec, unsigned int N, const char *label)
 
void dump_complex_vec (const delay_line< gr_complex > &vec, const char *label)
 

Variables

template<typename T >
class DVBS2RX_API gf2_poly
 
template<typename T >
class DVBS2RX_API gf2m_poly
 
const unsigned int n_plsc_codewords = 128
 
constexpr uint64_t sof_big_endian = 0x18D2E82ll << 38
 
const uint64_t plsc_scrambler = 0x719d83c953422dfa
 
constexpr unsigned hist_linear_interp = 1
 
constexpr unsigned hist_quadratic_interp = 3
 
constexpr unsigned hist_cubic_interp = 3
 

Typedef Documentation

◆ bitset256_t

typedef std::bitset<256> gr::dvbs2rx::bitset256_t

◆ euclidean_map_func_ptr

typedef void(* gr::dvbs2rx::euclidean_map_func_ptr) (float *dptr, uint64_t codeword)

◆ gf2_poly_b256

◆ gf2_poly_u16

◆ gf2_poly_u32

◆ gf2_poly_u64

◆ phase_inc_queue_t

◆ u8_cptr_t

typedef const unsigned char* gr::dvbs2rx::u8_cptr_t

◆ u8_ptr_t

typedef unsigned char* gr::dvbs2rx::u8_ptr_t

◆ u8_vector_t

typedef std::vector<unsigned char> gr::dvbs2rx::u8_vector_t

Enumeration Type Documentation

◆ dvb_code_rate_t

Enumerator
C1_4 
C1_3 
C2_5 
C1_2 
C3_5 
C2_3 
C3_4 
C4_5 
C5_6 
C7_8 
C8_9 
C9_10 
C13_45 
C9_20 
C90_180 
C96_180 
C11_20 
C100_180 
C104_180 
C26_45 
C18_30 
C28_45 
C23_36 
C116_180 
C20_30 
C124_180 
C25_36 
C128_180 
C13_18 
C132_180 
C22_30 
C135_180 
C140_180 
C7_9 
C154_180 
C11_45 
C4_15 
C14_45 
C7_15 
C8_15 
C32_45 
C2_9_VLSNR 
C1_5_MEDIUM 
C11_45_MEDIUM 
C1_3_MEDIUM 
C1_5_VLSNR_SF2 
C11_45_VLSNR_SF2 
C1_5_VLSNR 
C4_15_VLSNR 
C1_3_VLSNR 
C_OTHER 

◆ dvb_constellation_t

Enumerator
MOD_QPSK 
MOD_16QAM 
MOD_64QAM 
MOD_256QAM 
MOD_8PSK 
MOD_8APSK 
MOD_16APSK 
MOD_8_8APSK 
MOD_32APSK 
MOD_4_12_16APSK 
MOD_4_8_4_16APSK 
MOD_64APSK 
MOD_8_16_20_20APSK 
MOD_4_12_20_28APSK 
MOD_128APSK 
MOD_256APSK 
MOD_BPSK 
MOD_BPSK_SF2 
MOD_8VSB 
MOD_OTHER 

◆ dvb_framesize_t

Enumerator
FECFRAME_SHORT 
FECFRAME_NORMAL 
FECFRAME_MEDIUM 

◆ dvb_guardinterval_t

Enumerator
GI_1_32 
GI_1_16 
GI_1_8 
GI_1_4 
GI_1_128 
GI_19_128 
GI_19_256 

◆ dvb_infomode_t

Enumerator
INFO_OFF 
INFO_ON 

◆ dvb_outputmode_t

Enumerator
OM_CODEWORD 
OM_MESSAGE 

◆ dvb_standard_t

Enumerator
STANDARD_DVBS2 
STANDARD_DVBT2 

◆ dvbs2_interpolation_t

Enumerator
INTERPOLATION_OFF 
INTERPOLATION_ON 

◆ dvbs2_pilots_t

Enumerator
PILOTS_OFF 
PILOTS_ON 

◆ dvbs2_rolloff_factor_t

Enumerator
RO_0_35 
RO_0_25 
RO_0_20 
RO_RESERVED 
RO_0_15 
RO_0_10 
RO_0_05 

◆ dvbt2_bandwidth_t

Enumerator
BANDWIDTH_1_7_MHZ 
BANDWIDTH_5_0_MHZ 
BANDWIDTH_6_0_MHZ 
BANDWIDTH_7_0_MHZ 
BANDWIDTH_8_0_MHZ 
BANDWIDTH_10_0_MHZ 

◆ dvbt2_equalization_t

Enumerator
EQUALIZATION_OFF 
EQUALIZATION_ON 

◆ dvbt2_extended_carrier_t

Enumerator
CARRIERS_NORMAL 
CARRIERS_EXTENDED 

◆ dvbt2_fftsize_t

Enumerator
FFTSIZE_2K 
FFTSIZE_8K 
FFTSIZE_4K 
FFTSIZE_1K 
FFTSIZE_16K 
FFTSIZE_32K 
FFTSIZE_8K_T2GI 
FFTSIZE_32K_T2GI 
FFTSIZE_16K_T2GI 

◆ dvbt2_inband_t

Enumerator
INBAND_OFF 
INBAND_ON 

◆ dvbt2_inputmode_t

Enumerator
INPUTMODE_NORMAL 
INPUTMODE_HIEFF 

◆ dvbt2_l1constellation_t

Enumerator
L1_MOD_BPSK 
L1_MOD_QPSK 
L1_MOD_16QAM 
L1_MOD_64QAM 

◆ dvbt2_l1scrambled_t

Enumerator
L1_SCRAMBLED_OFF 
L1_SCRAMBLED_ON 

◆ dvbt2_misogroup_t

Enumerator
MISO_TX1 
MISO_TX2 

◆ dvbt2_papr_t

Enumerator
PAPR_OFF 
PAPR_ACE 
PAPR_TR 
PAPR_BOTH 

◆ dvbt2_pilotpattern_t

Enumerator
PILOT_PP1 
PILOT_PP2 
PILOT_PP3 
PILOT_PP4 
PILOT_PP5 
PILOT_PP6 
PILOT_PP7 
PILOT_PP8 

◆ dvbt2_preamble_t

Enumerator
PREAMBLE_T2_SISO 
PREAMBLE_T2_MISO 
PREAMBLE_NON_T2 
PREAMBLE_T2_LITE_SISO 
PREAMBLE_T2_LITE_MISO 

◆ dvbt2_reservedbiasbits_t

Enumerator
RESERVED_OFF 
RESERVED_ON 

◆ dvbt2_rotation_t

Enumerator
ROTATION_OFF 
ROTATION_ON 

◆ dvbt2_showlevels_t

Enumerator
SHOWLEVELS_OFF 
SHOWLEVELS_ON 

◆ dvbt2_streamtype_t

Enumerator
STREAMTYPE_TS 
STREAMTYPE_GS 
STREAMTYPE_BOTH 

◆ dvbt2_version_t

Enumerator
VERSION_111 
VERSION_121 
VERSION_131 

◆ frame_sync_state_t

Enumerator
searching 
found 
locked 

◆ payload_state_t

enum class gr::dvbs2rx::payload_state_t
strong
Enumerator
searching 

payload not found yet - waiting lock and two SOFs

pending 

found - waiting to be processed

partial 

partially processed but not fully output yet

Function Documentation

◆ bitmask() [1/2]

template<typename T >
T gr::dvbs2rx::bitmask ( int n_bits)
inline

Get bitmask for the least significant bits of a type T.

Parameters
n_bitsNumber of bits over which the mask is high.
Returns
T Bitmask.

Referenced by gf2_poly_rem().

◆ bitmask() [2/2]

template<>
bitset256_t gr::dvbs2rx::bitmask ( int n_bits)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
Template specialization for T = bitset256_t.

◆ build_crc_lut()

template<typename T >
std::array< T, 256 > gr::dvbs2rx::build_crc_lut ( const T & gen_poly_no_msb)

Build the CRC computation look-up table (LUT)

Template Parameters
TCRC data type.
Parameters
gen_poly_no_msbGenerator polynomial in normal representation but excluding the MSB. For instance, x^4 + x + 1 would be given as 0b11.
Returns
std::array<T, 256> Byte-by-byte CRC look-up table.
Note
This implementation only works for generator polynomials with degrees multiple of 8, e.g., for CRC8, CRC16, CRC32, etc.

References BITS_AFTER_MSB, and MSB_MASK.

◆ build_gf2_poly_rem_lut()

template<typename T >
std::array< T, 256 > gr::dvbs2rx::build_gf2_poly_rem_lut ( const gf2_poly< T > & x)

Build LUT to assist with GF(2) polynomial remainder computation.

The resulting LUT can be used to compute "y % x" more efficiently for any "y" and a given "x". More specifically, it maps each possible input byte representative of a dividend polynomial y to the bits that would leak into the succeeding bytes within the remainder computation. In the end, the LUT allows for computing the remainder with one iteration per byte instead of one interation per bit.

Template Parameters
TType whose bits represent the binary polynomial coefficients.
Parameters
xDivisor polynomial.
Note
The divisor should have degree less than or equal to "(sizeof(T) - 1) * 8".
Returns
std::array<T, 256> Byte-by-byte remainder look-up table.

References gr::dvbs2rx::gf2_poly< T >::degree().

◆ calc_crc()

template<typename T >
T gr::dvbs2rx::calc_crc ( const std::vector< uint8_t > & in_bytes,
const std::array< T, 256 > & crc_lut )

Compute the CRC of a sequence of input bytes.

Template Parameters
TCRC data type.
Parameters
in_bytesVector of input bytes.
crc_lutLook-up table constructed with the build_crc_lut function.
Returns
T CRC value (checksum), the remainder of the division by the generator polynomial.

References BITS_AFTER_MSB.

◆ check_rem_types() [1/4]

void gr::dvbs2rx::check_rem_types ( const gf2_poly< bitset256_t > a,
const gf2_poly< bitset256_t > b )
inline

◆ check_rem_types() [2/4]

template<typename Tb >
void gr::dvbs2rx::check_rem_types ( const gf2_poly< bitset256_t > a,
const gf2_poly< Tb > b )
inline

◆ check_rem_types() [3/4]

template<typename Ta >
void gr::dvbs2rx::check_rem_types ( const gf2_poly< Ta > a,
const gf2_poly< bitset256_t > b )
inline

◆ check_rem_types() [4/4]

template<typename Ta , typename Tb >
void gr::dvbs2rx::check_rem_types ( const gf2_poly< Ta > a,
const gf2_poly< Tb > b )
inline

Referenced by operator%().

◆ cmp_phase_inc_update_offset()

bool gr::dvbs2rx::cmp_phase_inc_update_offset ( phase_inc_update_t lhs,
phase_inc_update_t rhs )

◆ demap_bpsk()

DVBS2RX_API uint64_t gr::dvbs2rx::demap_bpsk ( const gr_complex * in,
unsigned int N )

Coherently demap N pi/2 BPSK symbols from the PLHEADER into bits.

Parameters
in(const gr_complex *) Incoming pi/2 BPSK symbols.
N(unsigned int) Number of pi/2 BPSK symbols to demap.
Returns
Demapped bits packed on a bit-level big-endian uint64_t.
Note
N must be <= 64.

◆ demap_bpsk_diff()

DVBS2RX_API uint64_t gr::dvbs2rx::demap_bpsk_diff ( const gr_complex * in,
unsigned int N )

Differentially demap N pi/2 BPSK symbols from the PSLC into bits.

The differential (non-coherent) demapping is an interesting alternative in the presence of significant frequency offset. However, it is designed to work with the PLSC symbols and may not work with an arbitrary pi/2 BPSK sequence. It assumes the first pi/2 BPSK symbol pointed by argument *in lies at an odd index and corresponds to the last SOF symbol. Correspondingly, it assumes the second symbol in the input array represents an even PLHEADER index and encodes the first PLSC symbol. Do not use this function to demap any arbitrary pi/2 BPSK sequence. For that, use "demap_bpsk" (i.e., the coherent demapping) instead.

Parameters
in(const gr_complex *) Pointer to the array of pi/2 BPSK symbols, starting from the last SOF symbol and followed by the PLSC symbols.
N(unsigned int) Number of pi/2 BPSK symbols to demap.
Returns
Demapped bits corresponding to symbols in[1] to in[N] (i.e., the N symbols past the first input symbol in[0]). The result is packed on a bit-level big-endian uint64_t.
Note
N must be <= 64, and the complex input array must hold at least N+1 pi/2 BPSK symbols, starting from an odd-indexed symbol.

◆ derotate_bpsk()

DVBS2RX_API void gr::dvbs2rx::derotate_bpsk ( const gr_complex * in,
float * out,
unsigned int N )

Derotate N complex-valued pi/2 BPSK into regular real BPSK symbols.

Converts a sequence of complex-valued pi/2 BPSK symbols with values originating from the +-0.707 +-j*0.707 constellation points into the corresponding sequence of ordinary real-valued BPSK symbols around +-1. If the input pi/2 BPSK symbols are noisy, the resulting real-valued BPSK symbols are naturally noisy too and deviate from the nominal +-1 values.

This derotation effectively produces the "soft decisions" corresponding to the received pi/2 BPSK symbols. Taking an even index for the demonstration, note the constellation symbols are either exp(jpi/4) or exp(-j3pi/4). Hence, the log-likelihood ratio between the received complex symbol r representing bit=0 versus bit=1 is as follows:

LLR(r) = (-||r - exp(jpi/4)||^2 + ||r - exp(-j3pi/4)||^2) / N0

Now, let's say r can be expressed as " exp(jpi/4) * r' ", where r' is the derotated versions of r, namely " r' = r*exp(-jpi/4) ". In this case, it follows that:

LLR(r) = (-||exp(jpi/4)*(r' - 1)||^2 + ||exp(jpi/4)(r' + 1)||^2) / N0,

given that exp(jpi/4) = -exp(-j3pi/4).

Since ||exp(jpi/4)||^2 = 1, it can be factored out of the Euclidean norm terms, which yields:

LLR(r) = (-||r' - 1||^2 + ||r' + 1||^2) / N0.

Besides, note that:

||r' - 1||^2 = ||r'||^2 -2*real(<r', 1>) + ||1||^2 ||r' + 1||^2 = ||r'||^2 +2*real(<r', 1>) + ||1||^2

Hence, the LLR can be expressed as:

LLR(r) = 4 * real(<r', 1>) / N0, = 4 * real(r') / N0.

In other words, the LLR is given by the real part of the de-rotated symbol r', scaled by 4/N0. Furthermore, the scaling factor 4/N0 is only useful for a maximum a posteriori (MAP) decoder, when the constellation symbols are not equiprobable. In contrast, for maximum likelihood (ML) decoding, when the symbols are equiprobable, the scaling factor can be ignored, as the threshold for decision is zero (i.e., bit=0 when LLR(r) > 0 and bit=1 otherwise). Thus, ultimately, the "soft decisions" are given by real(r'), which is equal to:

  • real(r * exp(-jpi/4)), on even indexes;
  • real(r * exp(-j3pi/4)), on odd indexes.

Note the term soft decision is loosely taken here as a sufficient statistic indicating the likelihood of a particular bit, which can be used by a maximum-likelihood decoder. The particular bit-by-bit soft decision that this function produces is one proportional to the LLR, but not exactly equal to the LLR (as it does not need to be). Furthermore, using the terminology from textbooks such as Forney's (Section 6.5.2), the returned value real(r') can be used to derive both the hard decision "sign(real(r'))" and the reliability weight associated with this decision given by "abs(real(r'))".

In the end, what matters the most is the soft decision format expected by the coding scheme's decoder. Here, we assume the decoder expects real(r'), as this function is meant to feed soft decisions into the Reed-Muller decoder (see the implementation of reed_muller::decode on reed_muller.cc). Hence, this function first derotates each complex input symbol r[k] to produce r'[k]. Then, it returns real(r'[k]) for all k on the output buffer.

Parameters
in(const gr_complex *) Input complex pi/2 BPSK symbols.
out(float *) Output real-valued BPSK symbols.
N(unsigned int) Number of pi/2 BPSK symbols to derotate.

◆ dump_complex_vec() [1/3]

void gr::dvbs2rx::dump_complex_vec ( const delay_line< gr_complex > & vec,
const char * label )

◆ dump_complex_vec() [2/3]

void gr::dvbs2rx::dump_complex_vec ( const gr_complex * vec,
unsigned int N,
const char * label )

◆ dump_complex_vec() [3/3]

void gr::dvbs2rx::dump_complex_vec ( const volk::vector< gr_complex > & vec,
unsigned int N,
const char * label )

◆ dump_real_vec() [1/3]

void gr::dvbs2rx::dump_real_vec ( const delay_line< float > & vec,
const char * label )

◆ dump_real_vec() [2/3]

void gr::dvbs2rx::dump_real_vec ( const float * vec,
unsigned int N,
const char * label )

◆ dump_real_vec() [3/3]

void gr::dvbs2rx::dump_real_vec ( const volk::vector< float > & vec,
unsigned int N,
const char * label )

◆ from_u8_array()

template<typename T >
T gr::dvbs2rx::from_u8_array ( u8_cptr_t in,
size_t size )
inline

Convert u8 array in network byte order (big-endian) to type.

Template Parameters
TBit storage type.
Parameters
inu8 array to be converted.
sizeNumber of bytes to be converted.
Returns
T Resulting value.

Referenced by from_u8_vector(), and gf2_poly_rem().

◆ from_u8_vector()

template<typename T >
T gr::dvbs2rx::from_u8_vector ( const u8_vector_t & vec)
inline

Convert u8 vector in network byte order (big-endian) to type.

Template Parameters
TBit storage type.
Parameters
vecu8 vector to be converted.
Returns
T Resulting value.

References from_u8_array().

◆ get_byte() [1/2]

template<>
uint8_t gr::dvbs2rx::get_byte ( const bitset256_t & value,
uint32_t byte_index )
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
Template specialization for T = bitset256_t.

◆ get_byte() [2/2]

template<typename T >
uint8_t gr::dvbs2rx::get_byte ( const T & value,
uint32_t byte_index )
inline

Get the byte at a given index of a type T value.

Template Parameters
TValue type.
Parameters
valueValue.
byte_indexTarget byte index.
Returns
uint8_t Extracted byte value.

Referenced by to_u8_vector().

◆ get_fec_info()

void gr::dvbs2rx::get_fec_info ( dvb_standard_t standard,
dvb_framesize_t framesize,
dvb_code_rate_t rate,
fec_info_t & fec_info )

◆ get_max_gf2_poly_degree()

template<typename T >
size_t gr::dvbs2rx::get_max_gf2_poly_degree ( )
inlineconstexpr

Get the maximum degree a GF2 polynomial can have with type T.

Returns
int Maximum degree.

◆ get_max_gf2_poly_degree< bitset256_t >()

template<>
size_t gr::dvbs2rx::get_max_gf2_poly_degree< bitset256_t > ( )
inlineconstexpr

◆ get_msby() [1/2]

template<>
uint8_t gr::dvbs2rx::get_msby ( const bitset256_t & value,
uint32_t lsb_index )
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
Template specialization for T = bitset256_t.

◆ get_msby() [2/2]

template<typename T >
uint8_t gr::dvbs2rx::get_msby ( const T & value,
uint32_t lsb_index )
inline

Get the most significant byte of a given value.

Template Parameters
TValue type.
Parameters
valueValue.
lsb_indexIndex of the least significant bit of the most significant byte, equivalent to the number of bits to be shifted to the right.
Returns
uint8_t Extracted byte value.
Note
This function differs from get_byte in that it assumes the given value has zeros in the other byte positions (if any) within the container type T beyond the byte of interest. In other words, this function does not apply a mask (AND 0xFF) to the result.

Referenced by gf2_poly_rem().

◆ gf2_poly_rem() [1/2]

template<typename T >
gf2_poly< T > gr::dvbs2rx::gf2_poly_rem ( const u8_vector_t & y,
const gf2_poly< T > & x,
const std::array< T, 256 > & x_lut )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
yDividend GF(2) polynomial given by a vector of bytes in network byte order.
xDivisor GF(2) polynomial.
x_lutLUT generated by the build_gf2_poly_rem_lut function for polynomial x.

References gf2_poly_rem().

◆ gf2_poly_rem() [2/2]

template<typename T >
gf2_poly< T > gr::dvbs2rx::gf2_poly_rem ( u8_cptr_t y,
const int y_size,
const gf2_poly< T > & x,
const std::array< T, 256 > & x_lut )

Compute the remainder "y % x" of GF2 polynomials y and x using a LUT.

Template Parameters
TType whose bits represent the binary polynomial coefficients.
Parameters
yDividend GF(2) polynomial given by an array of bytes in network byte order (big-endian), i.e., with the most significant byte at index 0.
y_sizeSize of the dividend polynomial y in bytes.
xDivisor GF(2) polynomial.
x_lutLUT generated by the build_gf2_poly_rem_lut function for polynomial x.
Returns
gf2_poly<T> Resulting remainder.

References bitmask(), from_u8_array(), get_msby(), and gf2_poly.

Referenced by gf2_poly_rem().

◆ is_bit_set() [1/2]

template<>
bool gr::dvbs2rx::is_bit_set ( const bitset256_t & x,
int i_bit )
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
Template specialization for T = bitset256_t.

◆ is_bit_set() [2/2]

template<typename T >
bool gr::dvbs2rx::is_bit_set ( const T & x,
int i_bit )
inline

Test if bit is set.

Parameters
xBit register.
i_bitTarget bit index.
Returns
true if bit is 1 and false otherwise.

Referenced by gr::dvbs2rx::gf2m_poly< T >::gf2m_poly(), and operator%().

◆ map_bpsk()

DVBS2RX_API void gr::dvbs2rx::map_bpsk ( uint64_t code,
gr_complex * out,
unsigned int N )

Map N bits from the PLHEADER into pi/2 BPSK symbols.

◆ operator%()

template<typename Ta , typename Tb >
gf2_poly< Tb > gr::dvbs2rx::operator% ( const gf2_poly< Ta > a,
const gf2_poly< Tb > b )
inline

Compute the remainder of the division between two GF(2) polynomials.

Computes the remainder of polynomial over GF(2) a(x) divided by another polynomial over GF(2) b(x), i.e., computes a(x) % b(x). The result has degree up to the degree of b(x) minus one. Hence, the result necessarily fits within the type used to store b(x).

Template Parameters
TaType of the dividend polynomial.
TbType of the divisor polynomial.
Parameters
aDividend polynomial.
bDivisor polynomial.
Returns
gf2_poly<Tb> Remainder result.
Exceptions
std::runtime_errorif b(x) is a zero polynomial.
Note
The implementation requires the divisor type Tb to be larger than or equal to the dividend type Ta. Otherwise, a static assertion is raised.

References check_rem_types(), gr::dvbs2rx::gf2_poly< T >::degree(), gr::dvbs2rx::gf2_poly< T >::get_poly(), gf2_poly, and is_bit_set().

◆ to_u8_vector()

template<typename T >
u8_vector_t gr::dvbs2rx::to_u8_vector ( T val,
size_t n_bytes = sizeof(T) )
inline

Convert type to u8 vector in network byte order (big-endian)

Template Parameters
TBit storage type.
Parameters
valValue to be converted.
n_bytesNumber of least significant bytes to be converted. E.g., n_bytes=3 converts the three least significant bytes of val into a vector in network order.
Returns
u8_vector_t Resulting u8 vector.

References get_byte().

Variable Documentation

◆ gf2_poly

template<typename T >
class DVBS2RX_API gr::dvbs2rx::gf2_poly

Referenced by gf2_poly_rem(), and operator%().

◆ gf2m_poly

template<typename T >
class DVBS2RX_API gr::dvbs2rx::gf2m_poly

◆ hist_cubic_interp

unsigned gr::dvbs2rx::hist_cubic_interp = 3
constexpr

◆ hist_linear_interp

unsigned gr::dvbs2rx::hist_linear_interp = 1
constexpr

◆ hist_quadratic_interp

unsigned gr::dvbs2rx::hist_quadratic_interp = 3
constexpr

◆ n_plsc_codewords

const unsigned int gr::dvbs2rx::n_plsc_codewords = 128

◆ plsc_scrambler

const uint64_t gr::dvbs2rx::plsc_scrambler = 0x719d83c953422dfa

◆ sof_big_endian

uint64_t gr::dvbs2rx::sof_big_endian = 0x18D2E82ll << 38
constexpr