%% Recover VHT-SIG-A Using Zero-Forcing Equalizer
% Recover the VHT-SIG-A in an AWGN channel. Configure the VHT signal to have a 160 MHz channel bandwidth, one space-time stream, and one receive antenna.
% Create a wlanVHTConfig object, specifying a channel bandwidth of 160 MHz.

cfg = wlanVHTConfig('ChannelBandwidth','CBW160');

%
% Generate L-LTF and VHT-SIG-A field signals.

txLLTF = wlanLLTF(cfg);
[txSig,txBits] = wlanVHTSIGA(cfg);
chanBW = cfg.ChannelBandwidth;
noiseVarEst = 0.1;

%
% Pass the transmitted VHT-SIG-A through an AWGN channel.

awgnChan = comm.AWGNChannel('NoiseMethod','Variance','Variance',noiseVarEst);
rxLLTF = awgnChan(txLLTF);
rxSig = awgnChan(txSig);

%
% Perform channel estimation based on the L-LTF.

demodLLTF = wlanLLTFDemodulate(rxLLTF,chanBW,1);
chEst = wlanLLTFChannelEstimate(demodLLTF,chanBW);

%
% Recover the VHT-SIG-A, specifying a zero-forcing equalization method, and check the CRC result

[recBits,failCRC] = wlanVHTSIGARecover(rxSig,chEst,noiseVarEst,'CBW160','EqualizationMethod','ZF');
disp(failCRC)

%
% Verify that the received signal contains no bit errors.

biterr(txBits,recBits)

% Copyright 2012 The MathWorks, Inc.