Main Content

nrLDPCEncode

Low-density parity-check (LDPC) encoding

Description

example

out = nrLDPCEncode(in,bgn) returns the LDPC-encoded output matrix for the input data matrix in and base graph number bgn, as specified in TS 38.212 Section 5.3.2 [1]. If applicable, the function replaces each filler bit represented by -1 in the input by 0. After encoding, the function replaces each filler bit again by -1. The encoding includes puncturing of some of the systematic information bits.

Examples

collapse all

Create input data for encoding consisting of two code block segments of length 2560 and 36 filler bits at the end.

C = 2;          
K = 2560;       
F = 36;         
cbs = ones(K-F,C);
fillers = -1*ones(F,C);
cbs = [cbs;fillers];   

Generate LDPC codeword for the two code block segments. Use base graph number two.

bgn = 2;        
codedcbs = nrLDPCEncode(cbs,bgn);
size(codedcbs)
ans = 1×2

       12800           2

Input Arguments

collapse all

Code block segments before encoding, specified as a matrix or a column vector. The number of columns in in is equal to the number of scheduled code block segments in the transport block. The number of rows in in is equal to the length of the code block segment, including the filler bits, if any.

Note

Filler bits are represented by -1 and are treated as 0 when performing encoding.

Data Types: double | int8

Base graph number, specified as 1 or 2. The values correspond to the two base graphs defined in TS 38.212 Section 5.3.2 [1]

Data Types: double

Output Arguments

collapse all

Encoded LDPC codeword output, returned as a matrix. The number of columns in out is equal to the number of scheduled code block segments in the transport block. The number of rows in out is equal to the length of the codeword. Each codeword punctures some of the systematic bits and can contain filler bits.

Data Types: double | int8

References

[1] 3GPP TS 38.212. “NR; Multiplexing and channel coding.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Introduced in R2018b