comnum.o150_sequence#

comnum.o150_sequence(name, length)#

A pseudo-random test sequence of ITU-T O.150 (05/96), Sec. 5.

The eight sequences of the error-rate test sets, exactly as the Recommendation defines them: the shift register of n stages fed back from the stages k and n, the output inverted for prbs15, prbs23, prbs29 and prbs31, the zero suppression of prbs20z (Sec. 5.5). Every register starts with its stages at one, the phase of Sec. 5.1 (“the first ONE of 9 consecutive ONEs”); an inverted sequence then begins with its n zeros.

Parameters:
  • name (str) – prbs9, prbs11, prbs15, prbs20, prbs20z, prbs23, prbs29 or prbs31 (period 2^n - 1).

  • length (int) – number of bits.

Returns:

length bits (uint8).

Return type:

numpy.ndarray

Raises:

ValueError – for an unknown name or a negative length.

Examples

>>> import comnum
>>> comnum.o150_sequence("prbs9", 10).tolist()
[1, 1, 1, 1, 1, 1, 1, 1, 1, 0]
>>> int(comnum.o150_sequence("prbs15", 32767).sum())
16383