Pseudo (De)randomiser with Softbits (CCSDS) ccsds_randomiser_softbits CCSDS/Telemetry import ccsds ccsds.randomiser_softbits($poly,$seed) Generating Polynimoal poly 0x95 int Seed seed 0xFF int $poly >= 0 $poly < 256 $seed >= 0 $seed < 256 in message out message Pseudo (De)randomiser Combines the input frame with a pseudo random sequence by XOR operation. A one in the PRN sequence will invert the softbit, a zero will copy it untouched. The pseudo random sequence is generated by an 8-bit linear feedback shift register (LFSR) as defined in ECSS. The pseudo random sequence can be modified by the generating polygon as well as shifted by choosing a different initial seed state. poly: Polynomial that defines the network of the 8 shift registers. The MSB encodes whether the last shift register (which is used for the output) should be used to generate the new input while the LSB encodes whether the first shift register (that holds the input bit of the last step should be used to generate the output. Or in ECSS definition: The MSB holds the coefficient for x^0 up to the LSB which holds coefficient x^7. x^8 is not encoded as it is always set (due to the fact that this is a maximum length 8 bit shift register). The default value is 0x95 which corresponds to the randomiser defined in ECSS with the polynomial representation x^8+x^7+x^5+x^3+x^0. seed: Initial state of the shift registers. MSB corresponds to the last register (which will be the output on the next step). Default to all ones as defined in ECSS.