Code block segmentation and CRC attachment
cbs = lteCodeBlockSegment(blk)
the input data bit vector
cbs = lteCodeBlockSegment(
blk into a cell array
code block segments, with filler bits and type-24B CRC appended as
appropriate, according to the rules of TS 36.212 , Section 5.1.2. Code block segmentation occurs
in transport blocks, after initial type-24A CRC appending, for turbo
encoded transport channels, including DL-SCH, UL-SCH, PCH, and MCH.
The segmentation and padding operation ensures that code blocks entering the turbo coder are no larger than 6144 in length and are all legal turbo code blocks sizes. The LTE turbo coder only supports a finite set of code block sizes. If the input block length is greater than 6144, the input block is split into a cell array of smaller code blocks where each individual block also has a type-24B CRC appended to it. The NULL filler bits, represented by –1 at the output, are prepended to the first code block so that all blocks in the set have acceptable lengths. If the input block length is less than or equal to 6144, no segmentation occurs and no CRC is appended, but the single output code block may have NULL filler bits prepended. The latter case still results in a cell array output containing a single vector.
Perform code block segmentation, providing two vectors with different lengths.
Code block segmentation occurs if the input length is greater than 6144. Provide a vector of length 6144.
cbs1 = lteCodeBlockSegment(ones(6144,1))
cbs1 = cell [6144×1 int8]
No segmentation occurs.
Provide a vector of length 6145.
cbs2 = lteCodeBlockSegment(ones(6145,1))
cbs2 = 1×2 cell array [3072×1 int8] [3136×1 int8]
Segmentation occurs for input length greater than 6144.
blk— Data bit vector
Data bit vector, specified as a column vector.
cbs— Code block segments
Code block segments, returned as a cell array with
vector elements. If the input block length is less than or equal to
cbs is a cell array containing a single column
vector. If the input block length is greater than 6144,
a cell array of multiple column vectors.
 3GPP TS 36.212. "Multiplexing and channel coding." 3rd Generation Partnership Project; Technical Specification Group Radio Access Network; Evolved Universal Terrestrial Radio Access (E-UTRA). URL: http://www.3gpp.org.