|
1 | | -function a_hat = DSCA_polar_decoder(e_tilde, crc_polynomial_pattern, crc_scrambling_pattern, crc_interleaver_pattern, info_bit_pattern, rate_matching_pattern, mode, L, min_sum, P2) |
2 | | -% DSCA_POLAR_DECODER Distributed-and-Scrambled-CRC-Aided (DSCA) polar decoder. |
3 | | -% a_hat = DSCA_POLAR_DECODER(e_tilde, crc_polynomial_pattern, crc_interleaver_pattern, info_bit_pattern, rate_matching_pattern, mode, L, min_sum, P2) |
| 1 | +function a_hat = DS1CA_polar_decoder(e_tilde, crc_polynomial_pattern, crc_scrambling_pattern, crc_interleaver_pattern, info_bit_pattern, rate_matching_pattern, mode, L, min_sum, P2) |
| 2 | +% DS1CA_POLAR_DECODER Distributed-Scrambled-and-1-initialised-CRC-Aided (DS1CA) polar decoder. |
| 3 | +% a_hat = DS1CA_POLAR_DECODER(e_tilde, crc_polynomial_pattern, crc_interleaver_pattern, info_bit_pattern, rate_matching_pattern, mode, L, min_sum, P2) |
4 | 4 | % decodes the encoded LLR sequence e_tilde, in order to obtain the |
5 | 5 | % recovered information bit sequence a_hat. |
6 | 6 | % |
|
66 | 66 | % each having the value 0 or 1. However, in cases where the CRC check |
67 | 67 | % fails, a_hat will be an empty vector. |
68 | 68 | % |
69 | | -% See also DSCA_POLAR_ENCODER |
| 69 | +% See also DS1CA_POLAR_ENCODER |
70 | 70 | % |
71 | 71 | % Copyright © 2017 Robert G. Maunder. This program is free software: you |
72 | 72 | % can redistribute it and/or modify it under the terms of the GNU General |
|
211 | 211 |
|
212 | 212 | % We use the interleaved CRC generator matrix to update the CRC |
213 | 213 | % check sums whenever an information or CRC bit adopts a value of |
214 | | - % 1. |
215 | | - crc_checksums = cat(3,crc_checksums,mod(crc_checksums+repmat(G_P3(i2,:)',[1 1 L_prime]),2)); |
| 214 | + % 1. We need to toggle the first P information bits to model a CRC |
| 215 | + % that is initialised with all ones. |
| 216 | + if crc_interleaver_pattern(i2) <= P |
| 217 | + crc_checksums = cat(3,mod(crc_checksums+repmat(G_P3(i2,:)',[1 1 L_prime]),2),crc_checksums); |
| 218 | + else |
| 219 | + crc_checksums = cat(3,crc_checksums,mod(crc_checksums+repmat(G_P3(i2,:)',[1 1 L_prime]),2)); |
| 220 | + end |
216 | 221 | % We need to keep track of whether any of the checks associated |
217 | 222 | % with the previous CRC bits have failed. |
218 | 223 | crc_okay = cat(3,crc_okay,crc_okay); |
|
0 commit comments