I am currently working on a python implementation for a 802.11 conform ofdm packet-crafter. Now I am struggling with the implementation of the bit-scrambler, as it is producing different output than shown in the IEEE Standard.
Block-diagram and generator polynomial are shwon in the image:Block diagram from IEEE 802.11 Standard
The scrambling seed, i.e. the initial scrambler state, is given in the Standard's example with [1, 0, 1, 1, 1, 0, 1]. I tripple checked, that my input bit-array for the scrambler is the same as in the example. My output, however, is similar only in the beginning and at the end of the scrambled array.
My implementation so far (using numpy):
def scrambler(inBits, seed):
state = np.array(seed, dtype=np.uint8)
outBits = np.zeros(len(inBits), dtype=np.uint8)
for idx in range(len(inBits)):
feedback = state[0] ^ state[3]
outBits[idx] = feedback ^ inBits[idx]
state[0:6] = state[1:]
state[-1] = feedback
return outBits
Is my implementation flawed? Thanks for every hint and your time!
Cheers Luuke