%% Demodulate HT-LTF and Get OFDM Information
% Perform OFDM demodulation on the HT-LTF, then extract the data and pilot subcarriers.
% Generate a WLAN waveform for an HT transmission.

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

% Obtain the field indices and extract the HT-LTF.

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

% Perform OFDM demodulation on the HT-LTF.

sym = wlanHTLTFDemodulate(rx,cfg);

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

info = wlanHTOFDMInfo('HT-LTF',cfg);
data = sym(info.DataIndices,:,:);
pilots =  sym(info.PilotIndices,:,:);

% Copyright 2018 The MathWorks, Inc.