LDPC Parameters Computation
This is used for computing the LDPC parameters at the transmitter and receiver for LDPC encoding and decoding. The details about the usage and interface is provided in upcoming sub-sections.
coderate = 0.650390625 #Code Rate
#tbLength ---> Transport Block size
#decBits ---> LDPC Decoded Block
ldpcParam = LDPCparameters(coderate, tbLength) #Object that performs Code Block Aggregation
baseGraph = ldpcParam.baseGraph # Defines the basegraph to be used by the LDPC.
liftfactor = ldpcParam.liftingfactor # Defines the lifting factor to be used by the LDPC codec for the given TB size and code-rate.
N = ldpcParam.n # Length of LDPC codeword after internal truncation
N_ldpc = ldpcParam.n_ldpc # Length of LDPC codeword before internal truncation
K = ldpcParam.k_ldpc # Number of information bits input to LDPC encoder.
Ncb = ldpcParam.numCodeBlocks # Number of codeblocks the transport block is to be segmented into.
The details of the input output interface is shown below:
- class toolkit5G.ChannelCoder.LDPC.LDPCparameters(tbSize, codeRate)[source]
This module computes all the parameters relevant to LDPC and Code-block processing. The parameter computation is given in detail in section 5.2, 5.3 and 5.4 of [3GPPTS38212_LDPC].
- Parameters:
tbSize (int) – Transport block size. It can be computed using ComputeTransportBlockSize defined in PhysicalChannels/PDSCH, PUSCH.
codeRate (int) – Code rate configured for LDPC. In 5G this parameter is extracted form mcsIndex.
- Input:
None
- Output:
[4,] tuple – Return a tuple containing 4 parameters k_ldpc, n_ldpc, liftingfactor, baseGraph. These parameters are detailed in Attributes.
- Attributes:
baseGraph (str) – Defines the basegraph to be used by the LDPC for encoding/decoding \(\in \{\) “BG1”, “BG2” \(\}\).
k_ldpc (int) – Number of information bits input to LDPC encoder.
n (int) – Size of LDPC codeword after internal truncation
n_ldpc (int) – Size of the codeword generated by the LDPC encoder before truncation.
liftingfactor (int) – Defines the lifting factor to be used by the LDPC codec for the given TB size and code-rate.
- Raises:
ValueError – [Error-LDPCparameters]: ‘Inputsize’ should either be an int!
ValueError – [Error-LDPCparameters]: ‘Inputsize’ should be non-zero +ve number!