Documentation

lteCodeBlockDesegment

Code block desegmentation and CRC decoding

Syntax

  • [blk,err] = lteCodeBlockDesegment(cbs,blklen)
  • [blk,err] = lteCodeBlockDesegment(cbs)
    example

Description

[blk,err] = lteCodeBlockDesegment(cbs,blklen) concatenates the input code block vectors contained in cbs into an output vector, blk, of length blklen. blklen is also used to validate the dimensions of the data in cbs and to calculate the amount of filler to be removed. If cbs is a cell array containing more than one vector, each vector is assumed to have a type-24B CRC attached. This CRC is decoded and stripped from each code block prior to output concatenation and the CRC error result is placed in the associated element of vector err. The length of err is the number of code blocks. If cbs is a single vector or a cell array containing a single vector, no CRC decoding or stripping is performed and err is empty. In all cases, the number of filler bits stripped from the beginning of the (first) code block is calculated from blklen. lteCodeBlockDesegment performs the inverse of the code block segmentation and CRC appending (see lteCodeBlockSegment). lteCodeBlockDesegment concatenates the input code block segments into a single output data block blk, removing any filler and type-24B CRC bits that may be present in the process. The results of code block CRC decoding, if applicable, are available in the err vector.

example

[blk,err] = lteCodeBlockDesegment(cbs) is similar to the above except that no leading filler bits are stripped from the output. The detection and processing of type-24B CRC is carried out as above.

Examples

collapse all

Desegment Code Block

Perform code block desegmentation and discover when segmentation occurs.

Code block segmentation occurs if the input length is greater than 6144. The input vector of length 6145 is segmented by lteCodeBlockSegment into two vectors of length 3072 and 3136. The output of lteCodeBlockSegment is a cell array, cbs, containing two vectors of lengths 3072 and 3136.

cbs = lteCodeBlockSegment(ones(6145,1));

Next, perform desegmentation and CRC removal.

[blk,err] = lteCodeBlockDesegment(cbs);
size(blk)
        6160           1

The first output, blk, is a column vector of length 6160. The second output, err, is a column vector of zero values.

Input Arguments

collapse all

cbs — Code block segmentscolumn vector | cell array

Code block segments, specified as a column vector or cell array of column vectors. If cbs is a cell array containing more than one vector, each vector is assumed to have a type-24B CRC attached. This CRC is decoded and stripped from each code block prior to output concatenation and the CRC error result is placed in the associated element of vector err. The length of err is the number of code blocks. If cbs is a single vector or a cell array containing a single vector, no CRC decoding or stripping is performed and err is empty. In all cases, the number of filler bits stripped from the beginning of the (first) code block is calculated from blklen.

blklen — Block lengthnonnegative integer

Block length, specified as a nonnegative integer.

Output Arguments

collapse all

blk — Output data blockcolumn vector

Output data block, returned as a column vector. The input code blocks are segmented into a single output data block, blk, removing any filler and type-24B CRC bits.

Data Types: int8

err — Code block CRC decoding errorscolumn vector | nonnegative integer

Code block CRC decoding errors, returned as a nonnegative integer. The length of err is equal to the number of code blocks. If cbs is a cell array containing multiple vector elements, lteCodeBlockDesegment assumes that each vector has a type-24B CRC attached. The CRC is decoded and stripped from each code block prior to output concatenation and the CRC error result is placed in the associated element of err. If cbs is a single vector or a cell array containing a single vector, no CRC decoding or stripping is performed and err is empty.

Data Types: int8

Introduced in R2014a

Was this topic helpful?