主要内容

802.11AC数据包错误率模拟8x8 TGAC通道

This example shows how to measure the packet error rate of an IEEE® 802.11ac™ VHT link using an end-to-end simulation with a fading TGac channel model and additive white Gaussian noise.

介绍

在此示例中,使用端到端仿真来确定802.11ac的数据包错误率[1] VHT link with a fading channel at a selection of SNR points. At each SNR point multiple packets are transmitted through a channel, demodulated and the PSDUs recovered. The PSDUs are compared to those transmitted to determine the number of packet errors and hence the packet error rate. Packet detection, timing synchronization, carrier frequency offset correction and phase tracking are performed by the receiver. The processing for each packet is summarized in the following

此示例还说明了如何parfor可以使用循环,而不是为了在模拟每个SNR点时循环以加快模拟。这parfor作为并行计算工具箱™的一部分,功能并行执行每个SNR的处理,以减少总仿真时间。

波形配置

在此示例中,模拟了802.11ac VHT传输。VHT格式配置对象,wlanVHTConfig,,,,contains the format-specific configuration of the transmission. The properties of the object contain the configuration. In this example the object is configured for a 80 MHz channel bandwidth, 8 transmit antennas, 8 space-time streams, no space time block coding and 256-QAM rate-5/6 (MCS 9).

%为8乘8 VHT传输创建格式配置对象cfgvht = wlanvhtconfig;CFGVHT.CHANNELBANDWIDTH ='CBW80';%80 MHz频道带宽cfgvht.numtransmitantennas = 8;%8传输天线cfgvht.numspacetimestreams = 8;% 8 space-time streamscfgvht.apeplength = 3000;% APEP length in bytescfgvht.mcs = 9;% 256 -QAM rate-5/6

Channel Configuration

在此示例中,TGAC N-LOS通道模型与延迟配置文件模型-D一起使用。对于模型-D,当发射机和接收器之间的距离大于或等于10米时,模型为NLOS。进一步描述wlanTGacChannel。一个n 8x8 MIMO channel is simulated in this example therefore 8 receive antennas are specified.

% Create and configure the channeltgacchannel = wlantgacchannel;tgacchannel.delayprofile ='Model-D';tgacchannel.numreceiveantennas = 8;tgacchanlel.transmitreceivedistance = 10;NLOS的米%距离tgacchannel.channelbandwidth = cfgvht.channelbandwidth;tgacchannel.numtransmitantennas = cfgvht.numtransmitantennas;tgacchannel.largescalefadingeffect ='None';tgacChannel.NormalizeChannelOutputs = false;

仿真参数

For each SNR point in the vectorsnra number of packets are generated, passed through a channel and demodulated to determine the packet error rate.

snr = 40:5:50;

在每个SNR点测试的数据包的数量由两个参数控制:

  1. maxNumErrors是在每个SNR点模拟的最大数据包误差数。当数据包错误达到此限制时,该SNR点处的仿真完成。

  2. maxnumpackets是在每个SNR点模拟的最大数据包数,如果未达到数据包误差限制,则限制模拟的长度。

此示例中选择的数字将导致非常短的模拟。对于有意义的结果,我们建议增加数字。

maxnumerrors = 10;%在SNR点的最大数据包错误数量maxnumpackets = 100;%在SNR点的最大数据包数量

为仿真设置其余变量。

% Get the baseband sampling ratefs = wlansamplate(CFGVHT);%获取OFDM信息ofdminfo = wlanvhtofdminfo('vht-data',,,,cfgVHT);% Set the sampling rate of the channeltgacchanlel.samplerate = fs;%访问时间域数据包中每个字段的指数ind = wlanFieldIndices(cfgVHT);

Processing SNR Points

对于每个SNR点,测试了许多数据包,并计算了数据包错误率。

对于每个数据包,都会发生以下处理步骤:

  1. 一个PSDU is created and encoded to create a single packet waveform.

  2. 这waveform is passed through a different realization of the TGac channel model.

  3. 一个WGN is added to the received waveform to create the desired average SNR per active subcarrier after OFDM demodulation.

  4. 这packet is detected.

  5. 估计和校正粗糙的载波频率偏移。

  6. 建立了精细的时正同步。提供了L-STF,L-LTF和L-SIG样品,以进行固定的时机,以便在L-STF的开始或结束时进行数据包检测。

  7. 估计和校正良好的载波频率偏移量。

  8. 这VHT-LTF is extracted from the synchronized received waveform. The VHT-LTF is OFDM demodulated and channel estimation is performed.

  9. 这VHT Data field is extracted from the synchronized received waveform. The PSDU is recovered using the extracted field and the channel estimate.

一个parforloop can be used to parallelize processing of the SNR points. To enable the use of parallel computing for increased speed comment out the为了statement and uncomment theparforstatement below.

s = numel(snr);packetRorrate = zeros(s,1);%parfor i = 1:S % Use 'parfor' to speed up the simulation为了i = 1:s% Use 'for' to debug the simulation%设置随机的随机子流索引,以确保每个索引%迭代使用一组可重复的随机数stream = randstream('combRecursive',,,,'种子',,,,0); stream.Substream = i; RandStream.setGlobalStream(stream);百分比为nulls中的噪声能量,因此SNR已定义%主动子载波packetsnr = snr(i)-10*log10(ofdminfo.fftlength/ofdminfo.numtones);%循环模拟多个数据包numpacketerrors = 0;numpkt = 1;传输数据包的%索引尽管numpacketerrors <= maxnumerrors && numpkt <= maxnumpackets% Generate a packet waveformtxpsdu = randi([0 1],cfgvht.psdulength*8,1);% PSDULength in bytestx = wlanWaveformGenerator(txPSDU,cfgVHT);%添加尾随的零以允许频道延迟tx = [tx; zeros(50,cfgVHT.NumTransmitAntennas)];%#ok% Pass the waveform through the fading channel model重置(tgacchannel);%重置通道以实现不同RX = TGACCHANNEL(TX);% Add noiserx = awgn(rx,packetsnr);%数据包检测并确定粗数据包偏移croumpktoffset = wlanpacketDetect(rx,cfgvht.channelbandwidth);ifisempty(coarsePktOffset)% If empty no L-STF detected; packet errornumPacketErrors = numPacketErrors+1; numPkt = numPkt+1;继续;%转到下一个循环迭代end%提取L-STF并执行粗频校正lstf = rx(croumpktoffset+(ind.lstf(1):ind.lstf(2)),:);croumfreqoff = wlancoarsecfoestimate(lstf,cfgvht.channelbandwidth);rx = HelperFrequencyOffset(RX,FS,-CoarseFreqoff);%提取非HT字段并确定细包偏移量nonhtfields = rx(coarsePktOffset+(ind.LSTF(1):ind.LSIG(2)),:); finePktOffset = wlanSymbolTimingEstimate(nonhtfields,...cfgVHT.ChannelBandwidth);%确定最终数据包偏移pktOffset = coarsePktOffset+finePktOffset;%如果数据包检测到超出预期延迟的范围% channel modeling; packet errorifpktOffset>50 numPacketErrors = numPacketErrors+1; numPkt = numPkt+1;继续;%转到下一个循环迭代end%提取L-LTF并执行良好的频率偏移校正lltf = rx(pktoffset+(ind.lltf(1):ind.lltf(2)),:);finefreqoff = wlanfinecfoestimate(lltf,cfgvht.channelbandwidth);rx = HelperFrequencyOffset(RX,FS,-FineFreqoff);%从波形中提取VHT-LTF样品,解码并执行%通道估计vhtltf = rx(pktoffset+(ind.vhtltf(1):ind.vhtltf(2)),:);vhtltfdemod = wlanvhtltfdemodulate(vhtltf,cfgvht);%获取单流渠道估算chanestsspilots = vhtsinglestreamChannElestimate(vhtltfdemod,cfgvht);% Channel estimatechanest = wlanvhtltfchanneLestimate(vhtltfdemod,cfgvht);%从波形提取VHT数据样本vhtdata = rx(pktoffset+(ind.vhtdata(1):ind.vhtdata(2)),:);%估计VHT数据字段中的噪声功率nvarvht = vhtnoiseestimate(vhtdata,chanestsspilots,cfgvht);%恢复VHT数据中传输的PSDUrxpsdu = wlanvhtdataRecover(vhtdata,chanest,nvarvht,cfgvht);%确定是否有错误,即数据包错误PAXETERROR = ANY(biterr(txpsdu,rxpsdu));numpacketerrors = numpacketerrors+packeterror;numpkt = numpkt+1;end% Calculate packet error rate (PER) at SNR pointpacketErrorRate(i) = numPacketErrors/(numPkt-1); disp(['snr'num2str(snr(i))“完成后完成”...num2str(numpkt-1)' packets, PER: '...num2str(packetErrortate(i))]);end
SNR 40 completed after 11 packets, PER: 1 SNR 45 completed after 15 packets, PER: 0.73333 SNR 50 completed after 100 packets, PER: 0.04

Plot Packet Error Rate vs SNR Results

图半学(SNR,PACPETERRRATE,'-OB');grid;xlabel('SNR (dB)');ylabel('PER');标题('802.11ac 80MHz,MCS9,直接映射,8x8通道模型D-nlos');

进一步探索

在每个SNR点测试的数据包的数量由两个参数控制;maxNumErrorsmaxnumpackets。For meaningful results it is recommend that these values should be larger than those presented in this example. Increasing the number of packets simulated allows the PER under different scenarios to be compared. Try changing the transmission and reception configurations and compare the packet error rate. As an example, the figure below was created by running the example formaxNumErrors:1000和maxnumpackets: 10000.

附录

This example uses the following helper functions:

选择ed Bibliography

  1. IEEE STD 802.11AC™-2013 IEEE信息技术标准 - 系统之间的电信和信息交换 - 本地和大都市区域网络 - 特定要求 - 第11部分:无线LAN媒介访问控制(MAC)和物理层(PHY) - 修正案4:高吞吐量的增强功能,用于在6 GHz以下的频段中操作。