%% Recover VHT-Data Field Signal
% Recover a VHT-Data field signal through a SISO AWGN channel using zero-forcing equalization.
% Configure VHT format configuration object, generate random payload bits, and generate the VHT-Data field.

cfg = wlanVHTConfig('APEPLength',512); 
txBits = randi([0 1],8*cfg.PSDULength,1); 
txSig = wlanVHTData(txBits,cfg);

% Pass the transmitted VHT data through an additive white Gaussian noise (AWGN) channel.

awgnChan = comm.AWGNChannel('NoiseMethod','Variance','Variance',0.1);
rxSig = awgnChan(txSig);

% Recover the payload bits using a perfect channel estimate of all ones and zero-forcing equalization. Verify that the recovered signal contains no bit errors.

chEst = ones(242,1);
noiseVarEst = 0.1;
recBits = wlanVHTDataRecover(rxSig,chEst,noiseVarEst,cfg,'EqualizationMethod','ZF');
numErr = biterr(txBits,recBits)

% Copyright 2012 The MathWorks, Inc.