function s1gWavGenPlotSIGB(cfg,tx)
%s1gWavGenPlotSIGB Featured example helper function
%
%   Plot SIG-B and surrounding fields

%   Copyright 2016-2017 The MathWorks, Inc.

Toff = 280;  % Start time of DLTF in microseconds
Tplot = 120; % Duration to plot in microseconds
sr = wlanSampleRate(cfg); % Sample rate Hz
hf = figure;
timeIdx = Toff+(0:(1/sr)*1e6:(Tplot-(1/sr)*1e6));
sampleIdx = Toff*sr*1e-6+(1:(Tplot*sr*1e-6));
plot(timeIdx,20*log10(abs(tx(sampleIdx,1))),'bx-');
xlim([Toff Toff+Tplot-1])
ylim([-20 15]);
grid on;
if cfg.NumUsers>1
    nuStr = 'MU';
else
    nuStr = 'SU';
end
titleStr = sprintf('Power of 2 MHz %s long preamble PPDU with %d space-time stream(s), \nspace-time stream 1', ...
    nuStr,sum(cfg.NumSpaceTimeStreams));
title(titleStr);
xlabel('Time (us)');
ylabel('Power (dBW)');
s1gWavGenPlotFieldOverlay(cfg,hf,Toff);
end