Code block segmentation and CRC attachment


  • cbs = lteCodeBlockSegment(blk)



cbs = lteCodeBlockSegment(blk) splits the input data bit vector blk into a cell array cbs of code block segments, with filler bits and type-24B CRC appended as appropriate, according to the rules of section 5.1.2 of [1]. 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 (only a finite set of code block sizes are supported by the LTE turbo coder). 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.


collapse all

Segment Code Block

Perform code block segmentation, providing two vectors with different lengths.

Code block segmentation occurs if the input length is greater than 6144. For example, provide a vector of length 6144.

cbs1 = lteCodeBlockSegment(ones(6144,1))
    [6144x1 int8]

No segmentation occurs.

Next, provide a vector of length 6145.

cbs2 = lteCodeBlockSegment(ones(6145,1))
    [3072x1 int8]    [3136x1 int8]

Input Arguments

collapse all

blk — Data bit vectorcolumn vector

Data bit vector, specified as a column vector.

Output Arguments

collapse all

cbs — Code block segmentscell array of integer column vectors

Code block segments, returned as a cell array with int8 column vector elements. If the input block length is less than or equal to 6144, cbs is a cell array containing a single column vector. If the input block length is greater than 6144, cbs is a cell array of multiple column vectors.

Data Types: cell


[1] 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:

Introduced in R2014a

Was this topic helpful?