%% Transmit VHT Waveform Through TGac Channel
% Generate a VHT waveform and pass it through a TGac SISO channel. Display the 
% spectrum of the resultant signal.
% 
% Set the channel bandwidth and the corresponding sample rate.

bw = 'CBW80';
fs = 80e6;
%% 
% Generate a VHT waveform.
%%
cfg = wlanVHTConfig;
txSig = wlanWaveformGenerator(randi([0 1],1000,1),cfg);
%% 
% Create a TGac SISO channel with path loss and shadowing enabled.
%%
tgacChan = wlanTGacChannel('SampleRate',fs,'ChannelBandwidth',bw, ...
    'LargeScaleFadingEffect','Pathloss and shadowing');
%% 
% Pass the VHT waveform through the channel.
%%
rxSig = tgacChan(txSig);
%% 
% Plot the spectrum of the received waveform.
%%
saScope = dsp.SpectrumAnalyzer('SampleRate',fs,'YLimits',[-120 -40]);
saScope(rxSig)
%% 
% Because path loss and shadowing are enabled, the mean received power across 
% the spectrum is approximately -60 dBm.