GNU Radio's DVBS2RX Package
|
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_t > | gf2_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 |
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 > | |
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 > | |
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 > | |
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 > | |
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 std::bitset<256> gr::dvbs2rx::bitset256_t |
typedef void(* gr::dvbs2rx::euclidean_map_func_ptr) (float *dptr, uint64_t codeword) |
typedef gf2_poly<uint16_t> gr::dvbs2rx::gf2_poly_u16 |
typedef gf2_poly<uint32_t> gr::dvbs2rx::gf2_poly_u32 |
typedef gf2_poly<uint64_t> gr::dvbs2rx::gf2_poly_u64 |
typedef std::priority_queue<phase_inc_update_t, std::vector<phase_inc_update_t>, decltype(&cmp_phase_inc_update_offset)> gr::dvbs2rx::phase_inc_queue_t |
typedef const unsigned char* gr::dvbs2rx::u8_cptr_t |
typedef unsigned char* gr::dvbs2rx::u8_ptr_t |
typedef std::vector<unsigned char> gr::dvbs2rx::u8_vector_t |
|
strong |
|
strong |
|
inline |
Get bitmask for the least significant bits of a type T.
n_bits | Number of bits over which the mask is high. |
Referenced by gf2_poly_rem().
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
std::array< T, 256 > gr::dvbs2rx::build_crc_lut | ( | const T & | gen_poly_no_msb | ) |
Build the CRC computation look-up table (LUT)
T | CRC data type. |
gen_poly_no_msb | Generator polynomial in normal representation but excluding the MSB. For instance, x^4 + x + 1 would be given as 0b11. |
References BITS_AFTER_MSB, and MSB_MASK.
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.
T | Type whose bits represent the binary polynomial coefficients. |
x | Divisor polynomial. |
References gr::dvbs2rx::gf2_poly< T >::degree().
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.
T | CRC data type. |
in_bytes | Vector of input bytes. |
crc_lut | Look-up table constructed with the build_crc_lut function. |
References BITS_AFTER_MSB.
|
inline |
|
inline |
|
inline |
|
inline |
Referenced by operator%().
bool gr::dvbs2rx::cmp_phase_inc_update_offset | ( | phase_inc_update_t | lhs, |
phase_inc_update_t | rhs ) |
References gr::dvbs2rx::phase_inc_update_t::offset.
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.
in | (const gr_complex *) Incoming pi/2 BPSK symbols. |
N | (unsigned int) Number of pi/2 BPSK symbols to demap. |
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.
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. |
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:
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.
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. |
void gr::dvbs2rx::dump_complex_vec | ( | const delay_line< gr_complex > & | vec, |
const char * | label ) |
void gr::dvbs2rx::dump_complex_vec | ( | const gr_complex * | vec, |
unsigned int | N, | ||
const char * | label ) |
void gr::dvbs2rx::dump_complex_vec | ( | const volk::vector< gr_complex > & | vec, |
unsigned int | N, | ||
const char * | label ) |
void gr::dvbs2rx::dump_real_vec | ( | const delay_line< float > & | vec, |
const char * | label ) |
void gr::dvbs2rx::dump_real_vec | ( | const float * | vec, |
unsigned int | N, | ||
const char * | label ) |
void gr::dvbs2rx::dump_real_vec | ( | const volk::vector< float > & | vec, |
unsigned int | N, | ||
const char * | label ) |
|
inline |
Convert u8 array in network byte order (big-endian) to type.
T | Bit storage type. |
in | u8 array to be converted. |
size | Number of bytes to be converted. |
Referenced by from_u8_vector(), and gf2_poly_rem().
|
inline |
Convert u8 vector in network byte order (big-endian) to type.
T | Bit storage type. |
vec | u8 vector to be converted. |
References from_u8_array().
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
Get the byte at a given index of a type T value.
T | Value type. |
value | Value. |
byte_index | Target byte index. |
Referenced by to_u8_vector().
void gr::dvbs2rx::get_fec_info | ( | dvb_standard_t | standard, |
dvb_framesize_t | framesize, | ||
dvb_code_rate_t | rate, | ||
fec_info_t & | fec_info ) |
|
inlineconstexpr |
Get the maximum degree a GF2 polynomial can have with type T.
|
inlineconstexpr |
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
Get the most significant byte of a given value.
T | Value type. |
value | Value. |
lsb_index | Index of the least significant bit of the most significant byte, equivalent to the number of bits to be shifted to the right. |
Referenced by gf2_poly_rem().
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.
y | Dividend GF(2) polynomial given by a vector of bytes in network byte order. |
x | Divisor GF(2) polynomial. |
x_lut | LUT generated by the build_gf2_poly_rem_lut function for polynomial x. |
References gf2_poly_rem().
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.
T | Type whose bits represent the binary polynomial coefficients. |
y | Dividend 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_size | Size of the dividend polynomial y in bytes. |
x | Divisor GF(2) polynomial. |
x_lut | LUT generated by the build_gf2_poly_rem_lut function for polynomial x. |
References bitmask(), from_u8_array(), get_msby(), and gf2_poly.
Referenced by gf2_poly_rem().
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
Test if bit is set.
x | Bit register. |
i_bit | Target bit index. |
Referenced by gr::dvbs2rx::gf2m_poly< T >::gf2m_poly(), and operator%().
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.
|
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).
Ta | Type of the dividend polynomial. |
Tb | Type of the divisor polynomial. |
a | Dividend polynomial. |
b | Divisor polynomial. |
std::runtime_error | if b(x) is a zero polynomial. |
References check_rem_types(), gr::dvbs2rx::gf2_poly< T >::degree(), gr::dvbs2rx::gf2_poly< T >::get_poly(), gf2_poly, and is_bit_set().
|
inline |
Convert type to u8 vector in network byte order (big-endian)
T | Bit storage type. |
val | Value to be converted. |
n_bytes | Number 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. |
References get_byte().
class DVBS2RX_API gr::dvbs2rx::gf2_poly |
Referenced by gf2_poly_rem(), and operator%().
class DVBS2RX_API gr::dvbs2rx::gf2m_poly |
|
constexpr |
|
constexpr |
|
constexpr |
const unsigned int gr::dvbs2rx::n_plsc_codewords = 128 |
const uint64_t gr::dvbs2rx::plsc_scrambler = 0x719d83c953422dfa |
|
constexpr |