%% Extract Rate Information from L-SIG
% Create a non-HT configuration object. The default modulation and coding scheme (MCS) is 0.

cfg = wlanNonHTConfig;

% Generate the L-SIG waveform and information bits. Extract the rate from the returned bits.

[~,bits] = wlanLSIG(cfg);

% Display the first four bits, which contain the rate information. As defined in Table 18-6 of IEEE Std 802.11™-2012, a value of [1 1 0 1] corresponds to a rate of 6 Mbps for 20 MHz channel spacing.

disp(bits(1:4)')

% Change the MCS to 7 then generate the corresponding L-SIG waveform and information bits. Extract the rate from the returned bits and analyze. The rate information is contained in the first four bits.

cfg.MCS = 7;
[y,bits] = wlanLSIG(cfg);

% Display the first four bits. As defined in IEEE Std 802.11-2012, Table 18-6, a value of [0 0 1 1] corresponds to a rate of 54 Mbps for 20 MHz channel spacing.

disp(bits(1:4)')

% Copyright 2012 The MathWorks, Inc.