generate_5g_ranking#
- sionna.phy.fec.polar.utils.generate_5g_ranking(k: int, n: int, sort: bool = True) List[numpy.ndarray][source]#
Returns information and frozen bit positions of the 5G Polar code as defined in Tab. 5.3.1.2-1 in [3GPPTS38212] for given values of
kandn.- Parameters:
- Outputs:
frozen_pos – Array of ints of shape [n-k] containing the frozen position indices.
info_pos – Array of ints of shape [k] containing the information position indices.
- Raises:
TypeError – If
kornare not positive ints.TypeError – If
sortis not bool.ValueError – If
kornare larger than 1024.ValueError – If
nis less than 32.ValueError – If the resulting coderate is invalid (>1.0).
ValueError – If
nis not a power of 2.
Examples
from sionna.phy.fec.polar.utils import generate_5g_ranking frozen_pos, info_pos = generate_5g_ranking(k=100, n=256) print(f"Frozen positions: {len(frozen_pos)}, Info positions: {len(info_pos)}") # Frozen positions: 156, Info positions: 100