Skip to content

Commit d988a62

Browse files
committed
Updated comments to remove reference to a particular version of TS38.212 and to better reflect the operation of main_FAR.m.
1 parent 23e35da commit d988a62

7 files changed

Lines changed: 30 additions & 45 deletions

File tree

PBCH_decoder.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function a_hat = PBCH_decoder(f_tilde, A, L, min_sum, a_tilde)
22
% PCBH_DECODER Polar decoder for the Public Broadcast Channel (PBCH) of 3GPP New Radio, as
3-
% defined in Section 7.1 of TS38.212 V1.2.1. Implements the Cyclic Redudancy
3+
% defined in Section 7.1 of TS38.212. Implements the Cyclic Redudancy
44
% Check (CRC) attachment of Section 7.1.3, the channel coding of Section 7.1.4
55
% and the rate matching of Section 7.1.5. Note that this code does not
66
% implement the payload generation of Section 7.1.1 or the scrambling of
@@ -12,7 +12,7 @@
1212
% f_tilde should be a real row vector comprising 864 Logarithmic
1313
% Likelihood Ratios (LLRS), each having a value obtained as LLR =
1414
% ln(P(bit=0)/P(bit=1)). The first LLR corresponds to f_0 from Section
15-
% 7.1.5 of TS38.212 V1.2.1, while the last LLR corresponds to
15+
% 7.1.5 of TS38.212, while the last LLR corresponds to
1616
% f_E-1.
1717
%
1818
% A should be 32. It specifies the number of bits in the
@@ -39,12 +39,12 @@
3939
% several higher-layer parameters. If scrambling is implemented
4040
% externally to this code, then a_tilde should pertain to the scrambled
4141
% bit values. The first input bit corresponds to a'_0 from
42-
% Section 7.1.3 of TS38.212 V1.2.1, while the last input bit corresponds
42+
% Section 7.1.3 of TS38.212, while the last input bit corresponds
4343
% to a'_A-1.
4444
%
4545
% a_hat will be a binary row vector comprising 32 bits, each
4646
% having the value 0 or 1. The first output bit corresponds to a'_0 from
47-
% Section 7.1.3 of TS38.212 V1.2.1, while the last output bit corresponds
47+
% Section 7.1.3 of TS38.212, while the last output bit corresponds
4848
% to a'_A-1.
4949
%
5050
%

PBCH_encoder.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function f = PBCH_encoder(a, E)
22
% PBCH_ENCODER Polar encoder for the Public Broadcast Channel (PBCH) of 3GPP New Radio, as
3-
% defined in Section 7.1 of TS38.212 V1.2.1. Implements the Cyclic Redudancy
3+
% defined in Section 7.1 of TS38.212. Implements the Cyclic Redudancy
44
% Check (CRC) attachment of Section 7.1.3, the channel coding of Section 7.1.4
55
% and the rate matching of Section 7.1.5. Note that this code does not
66
% implement the payload generation of Section 7.1.1 or the scrambling of
@@ -10,7 +10,7 @@
1010
%
1111
% a should be a binary row vector comprising 32 bits, each
1212
% having the value 0 or 1. The first input bit corresponds to a'_0 from
13-
% Section 7.1.3 of TS38.212 V1.2.1, while the last input bit corresponds
13+
% Section 7.1.3 of TS38.212, while the last input bit corresponds
1414
% to a'_A-1.
1515
%
1616
% E should be 864. It specifies the number of bits in the
@@ -19,7 +19,7 @@
1919
%
2020
% f will be a binary row vector comprising 864 bits, each having
2121
% the value 0 or 1. The first output bit corresponds to f_0 from Section
22-
% 7.1.5 of TS38.212 V1.2.1, while the last output bit corresponds to
22+
% 7.1.5 of TS38.212, while the last output bit corresponds to
2323
% f_E-1.
2424
%
2525
% See also PBCH_DECODER

PDCCH_decoder.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function a_hat = PDCCH_decoder(f_tilde, A, L, min_sum, RNTI)
22
% PDCCH_DECODER Polar decoder for the Physical Downlink Control Channel (PDCCH) of 3GPP New
3-
% Radio, as defined in Section 7.3 of TS38.212 V1.2.1. Implements the zero-
3+
% Radio, as defined in Section 7.3 of TS38.212. Implements the zero-
44
% padding to increase the length of short payloads to 12 bits of Section 7.3.1,
55
% the Cyclic Redudancy Check (CRC) attachment of Section 7.3.2, the channel
66
% coding of Section 7.3.3 and the rate matching of Section 7.3.4. Note that
@@ -13,7 +13,7 @@
1313
% f_tilde should be a real row vector comprising E number of Logarithmic
1414
% Likelihood Ratios (LLRS), each having a value obtained as LLR =
1515
% ln(P(bit=0)/P(bit=1)). The first LLR corresponds to f_0 from Section
16-
% 7.3.4 of TS38.212 V1.2.1, while the last LLR corresponds to
16+
% 7.3.4 of TS38.212, while the last LLR corresponds to
1717
% f_E-1.
1818
%
1919
% A should be an integer scalar. It specifies the number of bits in the
@@ -31,11 +31,11 @@
3131
% RNTI should be a binary row vector comprising 16 bits, each having the
3232
% value 0 or 1. If this parameter is omitted, then ones(1,16) will be
3333
% used for the RNTI. The first bit corresponds to x_rnti,0 from Section
34-
% 7.3.2 of TS38.212 V1.2.1, while the last bit corresponds to x_rnti,15.
34+
% 7.3.2 of TS38.212, while the last bit corresponds to x_rnti,15.
3535
%
3636
% a_hat will be a binary row vector comprising A number of bits, each
3737
% having the value 0 or 1. The first output bit corresponds to a_0 from
38-
% Section 7.3.1 of TS38.212 V1.2.1, while the last output bit corresponds
38+
% Section 7.3.1 of TS38.212, while the last output bit corresponds
3939
% to a_A-1.
4040
%
4141
% See also PDCCH_ENCODER

PDCCH_encoder.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function f = PDCCH_encoder(a, E, RNTI)
22
% PDCCH_ENCODER Polar encoder for the Physical Downlink Control Channel (PDCCH) of 3GPP New
3-
% Radio, as defined in Section 7.3 of TS38.212 V1.2.1. Implements the zero-
3+
% Radio, as defined in Section 7.3 of TS38.212. Implements the zero-
44
% padding to increase the length of short payloads to 12 bits of Section 7.3.1,
55
% the Cyclic Redudancy Check (CRC) attachment of Section 7.3.2, the channel
66
% coding of Section 7.3.3 and the rate matching of Section 7.3.4. Note that
@@ -11,7 +11,7 @@
1111
%
1212
% a should be a binary row vector comprising A number of bits, each
1313
% having the value 0 or 1. A should be in the range 1 to 140. The first
14-
% input bit corresponds to a_0 from Section 7.3.1 of TS38.212 V1.2.1, while the
14+
% input bit corresponds to a_0 from Section 7.3.1 of TS38.212, while the
1515
% last input bit corresponds to a_A-1.
1616
%
1717
% E should be an integer scalar. It specifies the number of bits in the
@@ -20,11 +20,11 @@
2020
% RNTI should be a binary row vector comprising 16 bits, each having the
2121
% value 0 or 1. If this parameter is omitted, then ones(1,16) will be
2222
% used for the RNTI. The first bit corresponds to x_rnti,0 from Section
23-
% 7.3.2 of TS38.212 V1.2.1, while the last bit corresponds to x_rnti,15.
23+
% 7.3.2 of TS38.212, while the last bit corresponds to x_rnti,15.
2424
%
2525
% f will be a binary row vector comprising E number of bits, each having
2626
% the value 0 or 1. The first output bit corresponds to f_0 from Section
27-
% 7.3.4 of TS38.212 V1.2.1, while the last output bit corresponds to
27+
% 7.3.4 of TS38.212, while the last output bit corresponds to
2828
% f_E-1.
2929
%
3030
% See also PDCCH_DECODER

PUCCH_decoder.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
function a_hat = PUCCH_decoder(f_tilde, A, L, min_sum)
22
% PUCCH_DECODER Polar decoder for the Physical Uplink Control Channel (PUCCH) and the
33
% Physical Uplink Shared Channel (PUSCH) of 3GPP New Radio, as defined in
4-
% Section 6.3 of TS38.212 V1.2.1. Implements the code block segmentation and
4+
% Section 6.3 of TS38.212. Implements the code block segmentation and
55
% Cyclic Redudancy Check (CRC) attachment of Sections 6.3.1.2.1 and 6.3.2.2.1,
66
% the channel coding of Sections 6.3.1.3.1 and 6.3.2.3.2, the rate matching of
77
% Sections 6.3.1.4.1 and 6.3.2.4.1, as well as the code block concatenation of
@@ -19,7 +19,7 @@
1919
% Likelihood Ratios (LLRS), each having a value obtained as LLR =
2020
% ln(P(bit=0)/P(bit=1)), where G should be no greater than 8192 if A<360
2121
% and no greater than 16384 if A>=360. The first LLR corresponds to g_0
22-
% from Sections 6.3.1.5 and 6.3.2.5 of TS38.212 V1.2.1, while the last
22+
% from Sections 6.3.1.5 and 6.3.2.5 of TS38.212, while the last
2323
% LLR corresponds to g_G-1.
2424
%
2525
% A should be an integer scalar. It specifies the number of bits in the
@@ -36,7 +36,7 @@
3636
%
3737
% a_hat will be a binary row vector comprising A number of bits, each
3838
% having the value 0 or 1. The first output bit corresponds to a_0 from
39-
% Sections 6.3.1.2 and 6.3.2.2 of TS38.212 V1.2.1, while the last output
39+
% Sections 6.3.1.2 and 6.3.2.2 of TS38.212, while the last output
4040
% bit corresponds to a_A-1.
4141
%
4242
% See also PUCCH_ENCODER

PUCCH_encoder.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
function f = PUCCH_encoder(a, G)
22
% PUCCH_ENCODER Polar encoder for the Physical Uplink Control Channel (PUCCH) and the
33
% Physical Uplink Shared Channel (PUSCH) of 3GPP New Radio, as defined in
4-
% Section 6.3 of TS38.212 V1.2.1. Implements the code block segmentation and
4+
% Section 6.3 of TS38.212. Implements the code block segmentation and
55
% Cyclic Redudancy Check (CRC) attachment of Sections 6.3.1.2.1 and 6.3.2.2.1,
66
% the channel coding of Sections 6.3.1.3.1 and 6.3.2.3.2, the rate matching of
77
% Sections 6.3.1.4.1 and 6.3.2.4.1, as well as the code block concatenation of
@@ -16,16 +16,16 @@
1616
%
1717
% a should be a binary row vector comprising A number of bits, each
1818
% having the value 0 or 1, where A should be in the range 12 to 1706. The first
19-
% input bit corresponds to a_0 from Sections 6.3.1.2 and 6.3.2.2 of TS38.212
20-
% V1.2.1, while the last input bit corresponds to a_A-1.
19+
% input bit corresponds to a_0 from Sections 6.3.1.2 and 6.3.2.2 of TS38.212,
20+
% while the last input bit corresponds to a_A-1.
2121
%
2222
% G should be an integer scalar. It specifies the number of bits in the
2323
% encoded bit sequence, where G should be no greater than 8192 if A<360
2424
% and no greater than 16384 if A>=360.
2525
%
2626
% f will be a binary row vector comprising G number of bits, each having
2727
% the value 0 or 1. The first output bit corresponds to g_0 from Sections
28-
% 6.3.1.5 and 6.3.2.5 of TS38.212 V1.2.1, while the last output bit
28+
% 6.3.1.5 and 6.3.2.5 of TS38.212, while the last output bit
2929
% corresponds to g_G-1.
3030
%
3131
% See also PUCCH_DECODER

main_FAR.m

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
function main_FAR(code, A, E, L, min_sum, target_false_alarms, seed)
2-
% PLOT_BLER_VS_SNR Plots Block Error Rate (BLER) versus Signal to Noise
3-
% Ratio (SNR) for polar codes.
4-
% plot_BLER_vs_SNR(code, A, E, L, min_sum, target_block_errors, target_BLER, EsN0_start, EsN0_delta, seed)
5-
% generates the plots.
2+
% main_FAR calculates False Alarm Rate (FAR) for polar codes.
3+
% main_FAR(code, A, E, L, min_sum, target_false_alarms, seed)
64
%
75
% code should be a string. This identifies which encoder and decoder
86
% functions to call. For example, if code is 'custom1', then the
@@ -30,25 +28,12 @@ function main_FAR(code, A, E, L, min_sum, target_false_alarms, seed)
3028
% better error correction capability than the min-sum, but it has higher
3129
% complexity.
3230
%
33-
% target_block_errors should be an integer scalar. The simulation of each
34-
% SNR for each coding rate will continue until this number of block
35-
% errors have been observed. A value of 100 is sufficient to obtain
31+
% target_false_alarms should be an integer scalar. The simulation of each
32+
% encoded block length will continue until this number of false
33+
% alarms have been observed. A value of 100 is sufficient to obtain
3634
% smooth BLER plots for most values of A. Higher values will give
3735
% smoother plots, at the cost of requiring longer simulations.
3836
%
39-
% target_BLER should be a real scalar, in the range (0, 1). The
40-
% simulation of each coding rate will continue until the BLER plot
41-
% reaches this value.
42-
%
43-
% EsN0_start should be a real row vector, having the same length as the
44-
% vector of coding rates. Each value specifies the Es/N0 SNR to begin at
45-
% for the simulation of the corresponding coding rate.
46-
%
47-
% EsN0_delta should be a real scalar, having a value greater than 0.
48-
% The Es/N0 SNR is incremented by this amount whenever
49-
% target_block_errors number of block errors has been observed for the
50-
% previous SNR. This continues until the BLER reaches target_BLER.
51-
%
5237
% seed should be an integer scalar. This value is used to seed the random
5338
% number generator, allowing identical results to be reproduced by using
5439
% the same seed. When running parallel instances of this simulation,
@@ -68,9 +53,9 @@ function main_FAR(code, A, E, L, min_sum, target_false_alarms, seed)
6853

6954
% Default values
7055
if nargin == 0
71-
code = 'custom1';
72-
A = 16;
73-
E = round(A./[0.8333 0.7500 0.6666 0.5000 0.4000 0.3333 0.2500 0.2000 0.1666 0.1250]);
56+
code = 'PUCCH';
57+
A = 32;
58+
E = [54 108 216 432 864 1728 3456 6912 13824];
7459
L = 1;
7560
min_sum = true;
7661
target_false_alarms = 10;

0 commit comments

Comments
 (0)