%% Demodulate S1G-SIG Field and Get OFDM Information
% Perform OFDM demodulation on the S1G-SIG field and extract the data and pilot subcarriers.
% Generate a WLAN waveform for an S1G transmission.

cfg = wlanS1GConfig;
bits = [1; 0; 0; 1];
waveform = wlanWaveformGenerator(bits,cfg);

% Obtain the field indices and extract the S1G-SIG field.

ind = wlanFieldIndices(cfg);
rx = waveform(ind.S1GSIG(1):ind.S1GSIG(2),:);

% Perform OFDM demodulation on the S1G-SIG field.

sym = wlanS1GDemodulate(rx,'S1G-SIG',cfg);

% Get the OFDM information, then extract the data and pilot subcarriers.

info = wlanS1GOFDMInfo('S1G-SIG',cfg);
data = sym(info.DataIndices,:,:);
pilots =  sym(info.PilotIndices,:,:);

% Copyright 2018 The MathWorks, Inc.