%% Scramble and Descramble bits
% Create the scrambler initialization and the input sequence of random bits.

scramInit = 93;
bits = randi([0,1],1000,1);

%
% Scramble and descramble the bits by using the scrambler initialization.

scrambledData = wlanScramble(bits,scramInit);
descrambledData = wlanScramble(scrambledData,scramInit);

%
% Verify that the descrambled data matches the original data.

isequal(bits,descrambledData)

% Copyright 2012 The MathWorks, Inc.