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
nstages fed back from the stageskandn, the output inverted forprbs15,prbs23,prbs29andprbs31, the zero suppression ofprbs20z(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 itsnzeros.- Parameters:
- Returns:
lengthbits (uint8).- Return type:
- 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