www.gusucode.com > wlan 源码程序 matlab案例代码 > wlan/RecoverNonHTDataInFadingChannelExample.m
%% Recover Non-HT Data in Fading Channel %% % Configure a non-HT data object. cfg = wlanNonHTConfig; %% % Generate and transmit a non-HT PSDU. txPSDU = randi([0 1],8*cfg.PSDULength,1); txSig = wlanNonHTData(txPSDU,cfg); %% % Generate an L-LTF for channel estimation. txLLTF = wlanLLTF(cfg); %% % Create an 802.11g channel with a 3 Hz maximum Doppler shift and a 100 ns % RMS path delay. Disable the reset before filtering option so that the % L-LTF and data fields use the same channel realization. ch802 = stdchan(1/20e6,3,'802.11g',100e-9); ch802.ResetBeforeFiltering = 0; %% % Pass the L-LTF and data signals through an 802.11g channel with AWGN. rxLLTF = awgn(filter(ch802,txLLTF),10); rxSig = awgn(filter(ch802,txSig),10); %% % Demodulate the L-LTF and use it to estimate the fading channel. dLLTF = wlanLLTFDemodulate(rxLLTF,cfg); chEst = wlanLLTFChannelEstimate(dLLTF,cfg); %% % Recover the non-HT data using the L-LTF channel estimate and determine % the number of bit errors in the transmitted packet. rxPSDU = wlanNonHTDataRecover(rxSig,chEst,0.1,cfg); [numErr,ber] = biterr(txPSDU,rxPSDU)