1111% ln(P(bit=0)/P(bit=1)).
1212%
1313% A should be an integer scalar. It specifies the number of bits in the
14- % information bit sequence, where A should be less than E and should be
15- % no greater than 200.
14+ % information bit sequence, where A should be in the range 1 to 140.
1615%
1716% L should be a scalar integer. It specifies the list size to use during
1817% Successive Cancellation List (SCL) decoding.
4342
4443addpath ' components'
4544
46- if A < 12
47- error(' polar_3gpp_matlab:UnsupportedBlockLength' ,' A should be no less than 12.' );
48- end
4945if A > 140
5046 error(' polar_3gpp_matlab:UnsupportedBlockLength' ,' A should be no greater than 140.' );
5147end
7268P2 = 3 ;
7369
7470% Determine the number of information and CRC bits.
75- K = A + P ;
71+ if A < 12
72+ % a has been padded with zeros to increase its length to 12
73+ K = 12 + P ;
74+ else
75+ K = A + P ;
76+ end
7677
7778% Determine the number of bits used at the input and output of the polar
7879% encoder kernal.
9091% Get the 3GPP information bit pattern.
9192info_bit_pattern = get_3GPP_info_bit_pattern(K , Q_N , rate_matching_pattern , mode );
9293
93- % Perform Distributed-CRC-Aided polar decoding.
94- a_hat = DS1CA_polar_decoder(f_tilde ,crc_polynomial_pattern ,RNTI ,crc_interleaver_pattern ,info_bit_pattern ,rate_matching_pattern ,mode ,L ,min_sum ,P2 );
94+ if A < 12
95+ % We know that a has been padded with zeros
96+ a_tilde = [NaN(1 ,A ),zeros(1 ,12 - A )];
97+
98+ % Perform Distributed-CRC-Aided polar decoding.
99+ a_hat = DS1CKA_polar_decoder(f_tilde ,crc_polynomial_pattern ,RNTI ,crc_interleaver_pattern ,info_bit_pattern ,rate_matching_pattern ,mode ,L ,min_sum ,P2 ,a_tilde );
100+
101+ if ~isempty(a_hat )
102+ % Remove the padding
103+ a_hat = a_hat(1 : A );
104+ end
105+ else
106+ % Perform Distributed-CRC-Aided polar decoding.
107+ a_hat = DS1CA_polar_decoder(f_tilde ,crc_polynomial_pattern ,RNTI ,crc_interleaver_pattern ,info_bit_pattern ,rate_matching_pattern ,mode ,L ,min_sum ,P2 );
108+ end
0 commit comments