comnum.ccsds_randomizer#
- comnum.ccsds_randomizer(sequence, n)#
The first bits of a pseudo-randomizer of CCSDS 131.0-B-5, Sec. 10.4:
"long",h(x) = x^17 + x^14 + 1started at00011100011100011(period 131 071, Sec. 10.4.2), or"short",h(x) = x^8 + x^7 + x^5 + x^3 + 1started at all ones (period 255, Sec. 10.4.3).- Parameters:
- Returns:
nbits (uint8).- Return type:
- Raises:
ValueError – for another sequence.
Examples
The first 40 bits of the short sequence,
FF 48 0E C0 9A(Sec. 10.4.3, NOTE 2):>>> import comnum, numpy as np >>> s = comnum.ccsds_randomizer("short", 40) >>> np.packbits(s).tobytes().hex() 'ff480ec09a'