%% Generate HE-SU Waveform with Specified Number of Data Symbols
% Create a wlanHESUConfig object, 'cfgPHY'.

cfgPHY = wlanHESUConfig;

% Calculate the APEP length in octets, specifying 200 data symbols.

apepLength = wlanAPEPLength(cfgPHY,'NumDataSymbols',200)

% Set the number of bytes carried in the user payload for the configuration object, 'cfgPHY', to this APEP length. Calculate the PSDU length.

cfgPHY.APEPLength = apepLength;
psduLength = getPSDULength(cfgPHY)*8;

% Create a random PSDU, 'psdu', using the calculated PSDU length.

psdu = randi([0 1],getPSDULength(cfgPHY)*8,1);

% Generate an HE-SU waveform using 'cfgPHY' and 'psdu'.

waveform = wlanWaveformGenerator(psdu,cfgPHY);

% Copyright 2019 The MathWorks, Inc.