%% Extract VHT-STF From VHT Waveform
% Extract the very-high-throughput short training field (VHT-STF) from a VHT waveform.
% Create a VHT-format configuration object for a multiple-input/multiple-output (MIMO) transmission using a 160-MHz channel bandwidth. Generate the corresponding VHT waveform.

cfg = wlanVHTConfig('MCS',8,'ChannelBandwidth','CBW160', ... 
    'NumTransmitAntennas',2,'NumSpaceTimeStreams',2);
txSig = wlanWaveformGenerator([1;0;0;1],cfg);

% Determine the component PPDU field indices for the VHT format.

ind = wlanFieldIndices(cfg)

% The VHT PPDU waveform is comprised of eight fields, including seven preamble fields and one data field.
% Extract the VHT-STF from the transmitted waveform.

stf = txSig(ind.VHTSTF(1):ind.VHTSTF(2),:);

% Verify that the VHT-STF has dimension 640-by-2, corresponding to the number of samples (80 for each 20-MHz bandwidth segment) and the number of transmit antennas.

disp(size(stf))

% Copyright 2012 The MathWorks, Inc.