%% Generate HE TB Waveform in Response to Frame Containing TRS Control Subfield
% Configure and generate a WLAN HE TB waveform to be transmitted in response to a frame containing a TRS Control subfield.
% Create an HE TB configuration object, specifying the triggering frame type.

cfgHETB = wlanHETBConfig('TriggerMethod','TRS');

% Generate a valid configuration by using the getTRSConfiguration object function, displaying the result.

cfgTRS = getTRSConfiguration(cfgHETB)

% Get the PSDU length in bytes and generate a PSDU for transmission.

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

% Generate and plot the waveform.

waveform = wlanWaveformGenerator(psdu,cfgTRS);
figure;
plot(abs(waveform));
title('HE TB Waveform');
xlabel('Time (nanoseconds)');
ylabel('Amplitude');

% Copyright 2019 The MathWorks, Inc.