%% Display Index Mapping of LDPC Code Block Desegmentation
% Create a matrix representing two code block segments. Each element contains the linear index of that element within the matrix.

cbs = reshape([1:10560]',[],2);

% Concatenate the code block segments using the specified base graph number and output block length.

bgn = 1;
blklen = 10000;
blk = nrCodeBlockDesegmentLDPC(cbs,bgn,blklen);

% To see how the input maps onto the output, plot code block segment indices relative to the corresponding indices in the concatenated input. In each code block segment, the last 280 bits represent CRC and filler bits. These additional bits are removed from the recovered data.

plot(blk);
xlabel('Code Block Bit Indices');
ylabel('Recovered Data Bit Indices');
title('Code Block Desegmentation Operation');

% Copyright 2019 The MathWorks, Inc.