www.gusucode.com > wlan 源码程序 matlab案例代码 > wlan/RecoverLSIGInformationfrom22MIMOChannelExample.m

    %% Recover L-SIG Information from 2x2 MIMO Channel  
% Recover L-SIG information transmitted in a noisy 2x2 MIMO channel, and
% calculate the number of bit errors present in the received information
% bits.

%% 
% Set the channel bandwidth and sample rate. 
chanBW = 'CBW40';
fs = 40e6;  

%% 
% Create a VHT configuration object corresponding to a 40 MHz 2x2 MIMO
% channel. 
vht = wlanVHTConfig( ...
    'ChannelBandwidth',chanBW, ...
    'NumTransmitAntennas',2, ...
    'NumSpaceTimeStreams',2);  

%% 
% Generate the L-LTF and L-SIG field signals. 
txLLTF = wlanLLTF(vht);
[txLSIG,txLSIGData] = wlanLSIG(vht);  

%% 
% Create a 2x2 TGac channel and an AWGN channel with an SNR=10 dB.
tgacChan = wlanTGacChannel('SampleRate',fs,'ChannelBandwidth',chanBW, ...
    'NumTransmitAntennas',2,'NumReceiveAntennas',2);

chNoise = comm.AWGNChannel('NoiseMethod','Signal to noise ratio (SNR)',...
    'SNR',10);

%%
% Pass the signals through the noisy 2x2 multipath fading channel. 
rxLLTF = chNoise(tgacChan(txLLTF));
rxLSIG = chNoise(tgacChan(txLSIG));

%% 
% Add additional white noise corresponding to a receiver with a 9 dB noise
% figure. The noise variance is equal to _k*T*B*F_, where _k_ is
% Boltzmann's constant, _T_ is the ambient temperature, _B_ is the channel
% bandwidth (sample rate), and _F_ is the receiver noise figure.
nVar = 10^((-228.6+10*log10(290) + 10*log10(fs) + 9 )/10);
rxNoise = comm.AWGNChannel('NoiseMethod','Variance','Variance',nVar);

rxLLTF = rxNoise(rxLLTF);
rxLSIG = rxNoise(rxLSIG);

%% 
% Perform channel estimation based on the L-LTF. 
demodLLTF = wlanLLTFDemodulate(rxLLTF,chanBW,1);
chanEst = wlanLLTFChannelEstimate(demodLLTF,chanBW);  

%% 
% Recover the L-SIG information bits. 
rxLSIGData = wlanLSIGRecover(rxLSIG,chanEst,0.1,chanBW);  

%% 
% Verify that there are no bit errors in the recovered L-SIG data. 
numErrors = biterr(txLSIGData,rxLSIGData)