generate_prng_seq#

sionna.phy.nr.utils.generate_prng_seq(length: int, c_init: int) numpy.ndarray[source]#

Implements pseudo-random sequence generator as defined in Sec. 5.2.1 in [3GPPTS38211] based on a length-31 Gold sequence.

Parameters:
  • length (int) – Desired output sequence length.

  • c_init (int) – Initialization sequence of the PRNG. Must be in the range of 0 to \(2^{32}-1\).

Outputs:

seq – [length], ndarray of 0s and 1s. Containing the scrambling sequence.

Notes

The initialization sequence c_init is application specific and is usually provided by higher layer protocols.

Examples

from sionna.phy.nr.utils import generate_prng_seq

seq = generate_prng_seq(100, 12345)
print(seq.shape)
# (100,)