comnum.NrTransportBlock#
- class comnum.NrTransportBlock(tbs, rate)#
A transport block of the PDSCH and its segmentation (TS 38.212 Sec. 7.2): TB CRC, code blocks with their CRC24B, LDPC and rate matching.
- Parameters:
- Raises:
ValueError – for an empty block or a rate outside (0, 1).
Examples
>>> import comnum, numpy as np >>> tb = comnum.NrTransportBlock(480, 308 / 1024) >>> tb.code_blocks, tb.base_graph, tb.encode(np.zeros(480, np.uint8), 1584, 2).shape (1, 2, (1584,))
- encode(bits, g, qm, layers=1, rv=0)#
The
gchannel bits of the transport block (before scrambling).- Parameters:
- Returns:
the bits (uint8).
- Return type:
- Raises:
ValueError – for a block of another size or an invalid
g.
- rate_matched_lengths(g, qm, layers=1)#
The rate-matched length
E_rof every code block (TS 38.212 Sec. 5.4.2.1).