comnum.Dvbs2#
- class comnum.Dvbs2(modulation, rate, *, frame='normal', pilots=True, scrambling_code=0)#
A DVB-S2 transmitter and receiver (ETSI EN 302 307-1) of one MODCOD, constant coding and modulation.
The transmitter takes a BBFRAME of
kbits (seedvbs2_bbframe()), encodes it (BCH, then the LDPC code of the standard), interleaves the bits (8PSK, 16APSK, 32APSK), maps them on the constellation of the MODCOD and builds the PLFRAME: the PLHEADER in π/2-BPSK, the slots of 90 symbols, pilot blocks of 36 symbols every 16 slots, and the Gold scrambling sequence numberscrambling_code. Every symbol has unit energy, so that a noise of variance1/(Es/N0)gives the abscissa of the performance table of the standard (threshold_db). The receiver assumes the frame found and the carrier recovered.- Parameters:
- Raises:
ValueError – for an invalid parameter (the message names it).
Examples
>>> import comnum, numpy as np >>> link = comnum.Dvbs2("8PSK", "3/5", frame="short") >>> link.k, link.plframe_len (9552, 5598) >>> bb = comnum.dvbs2_bbframe(np.zeros(link.k - 80, dtype=np.uint8), link.k) >>> x = link.modulate(bb) >>> comnum.dvbs2_decode_plheader(x[:90]) (12, True, True) >>> bool(np.array_equal(link.decode(x, 1e-3), bb)) True
- decode(rx, noise_var)#
The BBFRAME of a received PLFRAME (LDPC, then BCH decoding).
- Parameters:
rx (array_like) – the received PLFRAME (
plframe_lensymbols).noise_var (float) – complex noise variance per symbol.
- Returns:
the
kbits of the BBFRAME (uint8).- Return type:
- Raises:
ValueError – for an invalid parameter or input (the message names it).
- llr(rx, noise_var, *, max_log=False)#
The deinterleaved bit LLRs of the FECFRAME of a received PLFRAME.
- Parameters:
- Returns:
one LLR per bit of the FECFRAME (positive for a 0).
- Return type:
- Raises:
ValueError – for an invalid parameter or input (the message names it).
- modulate(bbframe)#
The PLFRAME of a BBFRAME.
- Parameters:
bbframe (array_like) –
kbits (seedvbs2_bbframe()).- Returns:
the
plframe_lenunit-energy symbols (complex128).- Return type:
- Raises:
ValueError – for an invalid parameter or input (the message names it).
- constellation#
The constellation of the MODCOD (
points[l]carries the labell).- Type:
- max_iterations#
The cap of the LDPC iterations (sum-product, layered, stopping on a codeword; read and write).
- Type: