%% Recover Information Bits in HE-SIG-A Field
% Recover the information bits in the HE-SIG-A field of a WLAN HE single-user (HE-SU) waveform.
% Create a WLAN HE-SU-format configuration object with default settings and use it to generate an HE-SU waveform.

cfgHE = wlanHESUConfig;
cbw = cfgHE.ChannelBandwidth;
waveform = wlanWaveformGenerator(1,cfgHE);

% Obtain the WLAN field indices, which contain the HE-SIG-A field.

ind = wlanFieldIndices(cfgHE);
rxSIGA = waveform(ind.HESIGA(1):ind.HESIGA(2),:);

% Perform orthogonal frequency-division multiplexing (OFDM) demodulation to extract the HE-SIG-A field.

sigaDemod = wlanHEDemodulate(rxSIGA,'HE-SIG-A',cbw);

% Return the pre-HE OFDM information and extract the demodulated HE-SIG-A symbols.

preHEInfo = wlanHEOFDMInfo('HE-SIG-A',cbw);
siga = sigaDemod(preHEInfo.DataIndices,:);

% Recover the HE-SIG-A information bits and other information, assuming no channel noise. Display the parity check result.

noiseVarEst = 0;
[bits,failCRC] = wlanHESIGABitRecover(siga,noiseVarEst);
disp(failCRC);

% Copyright 2018 The MathWorks, Inc.