Cyclic redundancy check calculation and appending
a cyclic redundancy check (CRC) for the input data vector and returns
a copy of the vector with the CRC attached. To support the correct
processing of filler bits, negative input bit values are interpreted
as logical 0 for the purposes of the CRC calculation. A value of –1
is used to represent filler bits.
blkcrc = lteCRCEncode(
the CRC defined by
poly for the input bit vector
returns a copy of the input with the CRC appended in vector
Valid options for the CRC polynomial are
'24B'. See TS 36.212 , Section 5.1.1 for the associated polynomials.
Calculate and append the CRC associated with an all zero vector, which is also zero.
crc1 = lteCRCEncode(zeros(100,1),'24A'); crc1(1:10)
ans = 0 0 0 0 0 0 0 0 0 0
The result is an all-zeros vector of length 124.
Mask the CRC bits in an MSB-first order.
Set the XOR mask to 1 to make the appended CRC bits XOR masked from the most significant to least significant bit.
mask = 1; crc2 = lteCRCEncode(zeros(100,1),'24A',mask); crc2(end-10:end)
ans = 0 0 0 0 0 0 0 0 0 0 1
The result is all zeros, except for a single one in last element position.
blk— Data bit vectornumeric column vector
Data bit vector, specified as a numeric column vector.
poly— CRC polynomial
CRC polynomial, specified as a string. See TS 36.212 , Section 5.1.1 for the associated polynomials.
mask— XOR maskinteger
XOR mask, specified as an integer. The appended CRC bits are XOR masked from the most significant to least significant bit.
 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.