Sub Block Interleaver for Polar Coder

Forward error correction is used in 5G for correction of bits in error. 5G supports primarily three channel coders:

The details about the input-output interface of the Mapper modules is provided below.

class toolkit5G.Ratematcher.PolarCoder.Subblock_Interleaver[source]

This module implements the sub block interleaver used by rate matcher of Polar codec detailed in section 5.4.1.1 of [3GPPTS38212Polar].

Parameters:

None

Input:

input_bits ([…,N], np.number) – Input bits to be interleaved.

Warning

The number of input bits must be a multiple of 32!

Output:

[…,N], np.number – Interleaver bits.

Attributes:

interleavePattern ([N, 1], int where N is the number of bits passed as inputs for interleaving.) – Defines the Interleaving pattern as defined in Table 5.4.1.1-1 of [3GPPTS38212Polar].

Raises:
  • ValueError – [Error-Subblock_Interleaver]: ‘input_bits’ should be NumPy array of numbers!

  • AssertionError – [Error-Subblock_Interleaver]: ‘If length of u is not a multiple of 32.

The details about the input-output interface of the Mapper modules is provided below.

class toolkit5G.Ratematcher.PolarCoder.Subblock_DeInterleaver[source]

This module implements the opposite of sub block interleaver to undo its effect at receiver. The details of sub block interleaver is provided in section 5.4.1.1 of [3GPPTS38212Polar].

Parameters:

None

Input:

input_bits ([…,N], np.number) – Input bits to be interleaved.

Warning

The number of input bits must be a multiple of 32!

Output:

[…,N], np.number – Interleaver bits.

Attributes:

interleavePattern ([N, 1], int where N is the number of bits passed as inputs for interleaving.) – Defines the De-interleaving pattern. It is complementary to permutation defined in Table 5.4.1.1-1 of [3GPPTS38212Polar].

Raises:
  • ValueError – [Error-Subblock_DeInterleaver]: ‘input_bits’ should be NumPy array of numbers!

  • AssertionError – [Error-Subblock_DeInterleaver]: ‘If length of u is not a multiple of 32.

Channel Interleaver for Polar Coder

Forward error correction is used in 5G for correction of bits in error. 5G supports primarily three channel coders:

The details about the input-output interface of the Mapper modules is provided below.

class toolkit5G.Ratematcher.PolarCoder.ChannelInterleaver[source]

This module implements the channel interleaver used by rate matcher of Polar codec detailed in section 5.4.1.3 of [3GPPTS38212Polar]. This module is enabled in 5G by setting \(\text{I}_\text{BIL}\) flag.

Parameters:

None

Input:

input_bits ([…,E], np.number) – Input bits to be interleaved.

Output:

[…,E], np.number – Interleaver bits.

Attributes:

interleavePattern ([E, 1], int where E is the number of bits passed as inputs for interleaving.) – Defines the Interleaving pattern as defined in section 5.4.1.3 of [3GPPTS38212Polar].

Raises:

ValueError – “[Error-ChannelInterleaver]: ‘input_bits’ should be NumPy array of numbers!”

The details about the input-output interface of the Mapper modules is provided below.

class toolkit5G.Ratematcher.PolarCoder.ChannelDeInterleaver[source]

This module implements the channel De-interleaver which is used to undo the effect of channel interleaver defined in section 5.4.1.3 of [3GPPTS38212Polar]. This module is enabled in 5G by setting \(\text{I}_\text{BIL}\) flag.

Parameters:

None

Input:

input_bits ([…,E], np.number) – Input bits to be de-interleaved.

Output:

[…,E], np.number – De-interleaver bits.

Attributes:

interleavePattern ([E, 1], int where E is the number of bits passed as inputs for de-interleaving.) – Defines the Interleaving pattern as defined in section 5.4.1.3 of [3GPPTS38212Polar].

Raises:

ValueError – “[Error-ChannelDeInterleaver]: ‘input_bits’ should be NumPy array of numbers!”