%% Recover L-SIG Field with Zero-Forcing Equalizer
% Recover L-SIG information using the zero-forcing equalizer algorithm. Calculate the number of bit errors in the received data.
% Create an HT configuration object.

cfgHT = wlanHTConfig;

% Generate the L-SIG field and pass it through an AWGN channel.

[txLSIG,txLSIGData] = wlanLSIG(cfgHT);
rxSIG = awgn(txLSIG,20);

% Recover the L-SIG field using the zero-forcing algorithm. The channel estimate is a vector of ones because fading was not introduced.

chEst = ones(52,1);
noiseVarEst = 0.1;
rxLSIGData = wlanLSIGRecover(rxSIG,chEst,noiseVarEst,'CBW20','EqualizationMethod','ZF');

% Verify that there are no bit errors in the recovered L-SIG data.

numErrors = biterr(txLSIGData,rxLSIGData)

% Copyright 2012 The MathWorks, Inc.