Recovery Procedure for an 802.11ax Packet
802.11ax 数据包的恢复程序
This example shows how to detect a packet and decode the payload bits in a received IEEE® 802.11ax™ (Wi-Fi 6) waveform. The receiver recovers the packet format parameters from the preamble fields to decode the data field and the MAC frame.
这个示例展示了如何检测一个数据包并解码接收到的 IEEE® 802.11ax™ (Wi-Fi 6) 波形中的有效载荷位。接收器从前导字段中恢复数据包格式参数,以解码数据字段和 MAC 帧。
Introduction 介绍
In an 802.11ax packet, the L-SIG, HE-SIG-A, and HE-SIG-B preamble fields signal transmission parameters to the receiver [1]:
在 802.11ax 数据包中,L-SIG、HE-SIG-A 和 HE-SIG-B 前导字段向接收器信号传输参数[1]:
The L-SIG field contains the transmission time of the packet.
L-SIG 字段包含了数据包的传输时间。The HE-SIG-A field contains common transmission parameters for HE MU users and all transmission parameters for HE SU and HE EXT SU packets.
HE-SIG-A 字段包含 HE MU 用户的常用传输参数以及 HE SU 和 HE EXT SU 数据包的所有传输参数。The length information in the L-SIG field, the modulation type, and the number of OFDM symbols in the HE-SIG-A field determine the HE packet format.
L-SIG 字段中的长度信息、调制类型以及 HE-SIG-A 字段中的 OFDM 符号数量决定了 HE 数据包的格式。The HE-SIG-B field contains resource unit (RU) allocation information and the transmission parameters for the users in an HE MU packet.
HE-SIG-B 字段包含 HE MU 数据包中用户的资源单元(RU)分配信息和传输参数。
This example shows how to recover these transmission parameters from an HE MU packet within a generated waveform. This example can also recover HE SU and HE EXT SU packets. The example assumes knowledge of only the channel bandwidth. The receiver obtains the other transmission parameters from the decoded L-SIG, HE-SIG-A, and HE-SIG-B preamble fields. You then use these parameters to decode the HE-Data field. You can use this example to perform the following analyses:
这个例子展示了如何从生成的波形中的一个 HE MU 数据包中恢复传输参数。这个例子还可以恢复 HE SU 和 HE EXT SU 数据包。该例子假设仅了解信道带宽。接收器从解码的 L-SIG、HE-SIG-A 和 HE-SIG-B 前导字段中获取其他传输参数。然后您可以使用这些参数解码 HE-Data 字段。您可以使用这个例子执行以下分析:
Recover and display the waveform of the detected packet.
恢复并显示检测到的数据包的波形。Recover and display the spectrum of the detected packet.
恢复并显示检测到的数据包的频谱。Display the constellation of the equalized data symbols for all spatial streams.
显示所有空间流的均衡数据符号的星座。Measure the error vector magnitude (EVM) of each field.
测量每个字段的错误向量幅度(EVM)。Detect an A-MPDU and determine the frame check sequence (FCS) for the recovered MAC frame.
检测 A-MPDU 并确定已恢复的 MAC 帧的帧检查序列(FCS)。Display the EVM per data symbol and spatial stream averaged over subcarriers.
在子载波上平均每数据符号和空间流的 EVM。Display the EVM per data subcarrier and spatial stream averaged over symbols.
在符号平均值上显示每个数据子载波和空间流的 EVM。
Waveform Generation 波形生成
For this example, you synthesize a 802.11ax HE MU waveform. To synthesize an HE MU waveform, you create an HE MU format configuration object wlanHEMUConfig
. The synthesized waveform is impaired by a 2x2 TGax indoor fading channel, additive white Gaussian noise (AWGN), and carrier frequency offset.
对于这个示例,您综合了一个 802.11ax HE MU 波形。要合成一个 HE MU 波形,您需要创建一个 HE MU 格式配置对象wlanHEMUConfig
。合成的波形受到一个 2x2 TGax 室内衰落信道、加性白高斯噪声(AWGN)和载波频率偏移的影响。
Note that the wlanHEMUConfig
object is used at the transmitter side only. The receiver uses an HE recovery configuration object wlanHERecoveryConfig
. The receiver sets the unknown properties of the HE recovery configuration object after decoding the information bits in the L-SIG, HE-SIG-A, and HE-SIG-B fields. The helper function helperSigRecGenerateWaveform generates the impaired waveform by:
请注意,wlanHEMUConfig
对象仅在发射端使用。接收方使用一个 HE 恢复配置对象 wlanHERecoveryConfig
。接收方在解码收到的信息位(L-SIG、HE-SIG-A 和 HE-SIG-B)后设置 HE 恢复配置对象的未知属性。帮助函数 helperSigRecGenerateWaveform 通过以下方式生成受损波形:
Creating a random payload of MSDUs for the MAC frame, which is encoded into an HE MU packet
为 MAC 帧创建一个随机的 MSDU 负载,将其编码成 HE MU 数据包Passing the waveform through a TGax indoor fading channel model
将波形通过 TGax 室内衰落信道模型传递Adding carrier frequency offset (CFO) and AWGN to the waveform
将载波频率偏移(CFO)和 AWGN 添加到波形
Alternatively, you can capture a waveform by using Instrument Control Toolbox™ to acquire I/Q data from a wide range of instruments and software-defined radio (SDR) platforms. If you capture an off-the-air waveform using an SDR, see the Recover and Analyze Packets in 802.11 Waveform example.
您还可以使用 Instrument Control Toolbox™ 从各种仪器和软件定义无线电(SDR)平台采集 I/Q 数据来捕获波形。如果您使用 SDR 捕获空中波形,请参见在 802.11 波形中恢复和分析数据包示例。
Define a mixed OFDMA and MU-MIMO configuration for an HE MU packet. The allocation index 17 defines two 52-tone RUs, with one user in each RU, and one 106-tone RU. The 106-tone RU has two users in an MU-MIMO configuration. The waveform to process is stored in the variable rx
.
定义一个 HE MU 数据包的混合 OFDMA 和 MU-MIMO 配置。分配指数 17 定义了两个 52-tone RU,每个 RU 中有一个用户,并且一个 106-tone RU。106-tone RU 采用 MU-MIMO 配置,有两个用户。要处理的波形存储在变量rx
中。
cfgMU = wlanHEMUConfig(17); cfgMU.NumTransmitAntennas = 2; % Configure RU 1 and user 1 cfgMU.RU{1}.SpatialMapping = 'Direct'; cfgMU.User{1}.STAID = 1; cfgMU.User{1}.APEPLength = 1e3; cfgMU.User{1}.MCS = 5; cfgMU.User{1}.NumSpaceTimeStreams = 2; cfgMU.User{1}.ChannelCoding = 'LDPC'; % Configure RU 2 and user 2 cfgMU.RU{2}.SpatialMapping = 'Fourier'; cfgMU.User{2}.STAID = 2; cfgMU.User{2}.APEPLength = 500; cfgMU.User{2}.MCS = 4; cfgMU.User{2}.NumSpaceTimeStreams = 1; cfgMU.User{2}.ChannelCoding = 'BCC'; % Configure RU 3 and user 1 cfgMU.RU{3}.SpatialMapping = 'Fourier'; cfgMU.User{3}.STAID = 3; cfgMU.User{3}.APEPLength = 100; cfgMU.User{3}.MCS = 2; cfgMU.User{3}.NumSpaceTimeStreams = 1; cfgMU.User{3}.ChannelCoding = 'BCC'; % Configure RU 3 and user 2 cfgMU.User{4}.STAID = 4; cfgMU.User{4}.APEPLength = 500; cfgMU.User{4}.MCS = 3; cfgMU.User{4}.NumSpaceTimeStreams = 1; cfgMU.User{4}.ChannelCoding = 'LDPC'; % Specify propagation channel numRx = 2; % Number of receive antennas delayProfile = 'Model-D'; % TGax channel delay profile % Specify impairments noisePower = -40; % Noise power to apply in dBW cfo = 62e3; % Carrier frequency offset Hz % Generate waveform rx = helperSigRecGenerateWaveform(cfgMU,numRx,delayProfile,noisePower,cfo);
Packet Recovery 数据包恢复
To recover a packet, you process the waveform by following these steps:
要恢复一个数据包,您需要按照以下步骤处理波形:
Create an HE recovery configuration object,
wlanHERecoveryConfig
. After decoding the preamble fields in the waveform, the receiver updates the object properties.
创建一个 HE 恢复配置对象,wlanHERecoveryConfig
。在波形中解码前导字段后,接收器会更新对象属性。Detect and synchronize the packet.
检测并同步数据包。Extract and demodulate the L-LTF. The demodulated L-LTF symbols do not include tone rotation for each 20 MHz segment as described in [2], Section 21.3.7.5.
提取和解调 L-LTF。根据 [2] 第 21.3.7.5 节的描述,解调的 L-LTF 符号不包括每个 20 MHz 段的音调旋转。Use the demodulated L-LTF symbols for channel and noise estimates.
使用解调的 L-LTF 符号进行信道和噪声估计。Use the time-domain signal containing samples equivalent to four OFDM symbols that immediately follow the L-LTF to determine the HE packet format. Update the packet format in the
wlanHERecoveryConfig
object.
使用包含相当于跟随 L-LTF 的四个 OFDM 符号样本的时域信号来确定 HE 包格式。在wlanHERecoveryConfig
对象中更新包格式。Demodulate the L-LTF. The demodulated L-LTF symbols include tone rotation for each 20 MHz segment as described in [2], Section 21.3.7.5. Use the L-LTF channel estimates (with tone rotation) to decode the pre-HE-LTF fields.
解调 L-LTF。 解调的 L-LTF 符号包括每个 20 MHz 段的基频旋转,如[2],第 21.3.7.5 节所述。 使用 L-LTF 信道估计(带基频旋转)来解码预 HE-LTF 字段。Extract the L-SIG and RL-SIG fields. Estimate the channel on an extra four subcarriers per subchannel in the L-SIG and RL-SIG fields. Update the L-LTF channel estimates to include the channel estimates on the extra subcarriers.
提取 L-SIG 和 RL-SIG 字段。 在 L-SIG 和 RL-SIG 字段的每个子信道上额外的四个子载波上估计信道。 更新 L-LTF 信道估计以包含额外子载波上的信道估计。Determine the length of the packet in microseconds from the information bits in the L-SIG field.
从 L-SIG 字段中的信息位确定数据包的长度(单位:微秒)。Update the recovery configuration object after decoding the HE-SIG-A field. In an HE MU packet, the HE-SIG-A field contains the common transmission parameters. In an HE SU or HE EXT SU packet, the HE-SIG-A field contains all the transmission parameters.
在解码 HE-SIG-A 字段后更新恢复配置对象。 在 HE MU 数据包中,HE-SIG-A 字段包含通用传输参数。 在 HE SU 或 HE EXT SU 数据包中,HE-SIG-A 字段包含所有传输参数。For an HE MU packet format, decode the HE-SIG-B field. For a non-compressed SIGB waveform the HE-SIG-B common field is decoded first followed by the HE-SIG-B user field. For a compressed SIGB waveform only the HE-SIG-B user field is decoded.
对于 HE MU 数据包格式,解码 HE-SIG-B 字段。对于非压缩 SIGB 波形,首先解码 HE-SIG-B 通用字段,然后是 HE-SIG-B 用户字段。对于压缩 SIGB 波形,只解码 HE-SIG-B 用户字段。For an HE MU format without SIGB compression, recover the RU allocation and user transmission parameters from the HE-SIG-B field. For a compressed SIGB waveform, determine the RU allocation information from the HE-SIG-A field and the user transmission parameters from the HE-SIG-B user field bits.
对于没有 SIGB 压缩的 HE MU 格式,请从 HE-SIG-B 字段中恢复 RU 分配和用户传输参数。对于压缩的 SIGB 波形,请从 HE-SIG-A 字段确定 RU 分配信息,并从 HE-SIG-B 用户字段位获取用户传输参数。Create the
wlanHERecoveryConfig
object using the recovered transmission parameters for each user after HE-SIG-B decoding.
创建使用 HE-SIG-B 解码后的恢复传输参数为每个用户创建对象。Extract and demodulate the HE-LTF field. Use the demodulated symbols for channel estimation of the subcarriers allocated to the user of interest. Use the MIMO channel estimates to decode the HE-Data field.
提取和解调 HE-LTF 字段。使用解调符号对感兴趣的用户分配的子载波进行信道估计。使用 MIMO 信道估计来解码 HE-Data 字段。Extract the HE-Data field and recover the PSDU bits using the
wlanHERecoveryConfig
object for each user.
提取 HE-Data 字段,并使用wlanHERecoveryConfig
对象为每个用户恢复 PSDU 位。Detect the A-MPDU within the recovered PSDU and check the FCS for the recovered MAC frame.
在恢复的 PSDU 中检测 A-MPDU 并检查恢复的 MAC 帧的 FCS。
Recovery Parameter Setup 恢复参数设置
To recover the received packet from the waveform, create an HE recovery configuration object, wlanHERecoveryConfig
. The recovery object stores the recovered information from the L-SIG, HE-SIG-A, and HE-SIG-B preamble fields. After decoding the preamble fields, the receiver updates the unknown properties of the object. The following code configures the object and variables for processing.
要从波形中恢复接收到的分组,需要创建一个 HE 恢复配置对象,wlanHERecoveryConfig
。恢复对象存储了从 L-SIG、HE-SIG-A 和 HE-SIG-B 前导字段中恢复的信息。解码前导字段后,接收器会更新对象的未知属性。下面的代码配置了对象和变量以进行处理。
chanBW = cfgMU.ChannelBandwidth; % Assume channel bandwidth is known sr = wlanSampleRate(cfgMU); % Sample rate % Specify pilot tracking method for recovering the data field. When % recovering 26-tone RUs only phase tracking is used as both time and phase % tracking algorithm is susceptible to noise. phaseTracking = true; timeTracking = true; % Create an HE recovery configuration object and set the channel bandwidth cfgRx = wlanHERecoveryConfig; cfgRx.ChannelBandwidth = chanBW; % The recovery configuration object is used to get the start and end % indices of the pre-HE-SIG-B field. ind = wlanFieldIndices(cfgRx); % Setup plots for the example [spectrumAnalyzer,timeScope,ConstellationDiagram,EVMPerSubcarrier,EVMPerSymbol] = helperSigRecSetupPlots(sr); % Minimum packet length is 10 OFDM symbols lstfLength = double(ind.LSTF(2)); minPktLen = lstfLength*5; % Number of samples in L-STF rxWaveLen = size(rx,1);
Front-End Processing 前端处理
The front-end processing uses a while
loop for packet detection, coarse carrier frequency offset correction, timing synchronization, and fine carrier frequency offset correction. To detect a packet, the sample offset searchOffset
indexes into rx
. If synchronization fails for the first packet, the searchOffset
is incremented to move beyond that packet. This process repeats until a packet is successfully synchronized.
前端处理使用一个while
循环进行分组检测,粗载波频率偏移校正,时间同步和细载波频率偏移校正。要检测一个分组,采样偏移searchOffset
索引到rx
。如果第一个分组同步失败,则递增searchOffset
以移动超出该分组。此过程重复,直到成功同步一个分组。
searchOffset = 0; % Offset from start of waveform in samples while (searchOffset + minPktLen) <= rxWaveLen % Packet detection pktOffset = wlanPacketDetect(rx,chanBW,searchOffset); % Adjust packet offset pktOffset = searchOffset + pktOffset; if isempty(pktOffset) || (pktOffset + ind.LSIG(2) > rxWaveLen) error('** No packet detected **'); end % Coarse frequency offset estimation and correction using L-STF rxLSTF = rx(pktOffset+(ind.LSTF(1):ind.LSTF(2)), :); coarseFreqOffset = wlanCoarseCFOEstimate(rxLSTF,chanBW); rx = frequencyOffset(rx,sr,-coarseFreqOffset); % Symbol timing synchronization searchBufferLLTF = rx(pktOffset+(ind.LSTF(1):ind.LSIG(2)),:); pktOffset = pktOffset+wlanSymbolTimingEstimate(searchBufferLLTF,chanBW); % Fine frequency offset estimation and correction using L-STF rxLLTF = rx(pktOffset+(ind.LLTF(1):ind.LLTF(2)),:); fineFreqOffset = wlanFineCFOEstimate(rxLLTF,chanBW); rx = frequencyOffset(rx,sr,-fineFreqOffset); % Timing synchronization complete: packet detected fprintf('Packet detected at index %d\n',pktOffset + 1); % Display estimated carrier frequency offset cfoCorrection = coarseFreqOffset + fineFreqOffset; % Total CFO fprintf('Estimated CFO: %5.1f Hz\n\n',cfoCorrection); break; % Front-end processing complete, stop searching for a packet end
Packet detected at index 404
Estimated CFO: 62017.7 Hz
% Scale the waveform based on L-STF power (AGC)
gain = 1./(sqrt(mean(rxLSTF.*conj(rxLSTF))));
rx = rx.*gain;
Packet Format Detection 数据包格式检测
To determine the packet format, the receiver uses the time-domain samples equivalent to the four OFDM symbols immediately following the L-LTF [1 Figure 27-63]. Extract and demodulate the L-LTF. For format detection, the demodulated L-LTF symbols must not include tone rotation for each 20 MHz segment as described in [2], Section 21.3.7.5. Use the demodulated L-LTF symbols for channel and noise estimation. Detect the packet format using the L-LTF channel (without tone rotation) and noise power estimates.
为了确定数据包格式,接收器使用跟随 L-LTF 的四个 OFDM 符号的时域采样进行等效处理[1 Figure 27-63]。提取和解调 L-LTF。对于格式检测,解调后的 L-LTF 符号不能包括每个 20 MHz 段的频率旋转,如 [2],第 21.3.7.5 节所述。使用解调后的 L-LTF 符号进行信道和噪声估计。利用 L-LTF 信道(无频率旋转)和噪声功率估计来检测数据包格式。
rxLLTF = rx(pktOffset+(ind.LLTF(1):ind.LLTF(2)),:);
lltfDemod = wlanLLTFDemodulate(rxLLTF,chanBW);
lltfChanEst = wlanLLTFChannelEstimate(lltfDemod,chanBW);
noiseVar = wlanLLTFNoiseEstimate(lltfDemod);
disp('Detect packet format...');
Detect packet format...
rxSIGA = rx(pktOffset+(ind.LSIG(1):ind.HESIGA(2)),:);
pktFormat = wlanFormatDetect(rxSIGA,lltfChanEst,noiseVar,chanBW);
fprintf(' %s packet detected\n\n',pktFormat);
HE-MU packet detected
% Set the packet format in the recovery object and update the field indices
cfgRx.PacketFormat = pktFormat;
ind = wlanFieldIndices(cfgRx);
L-LTF Channel Estimate L-LTF 信道估计
Demodulate the L-LTF and perform channel estimation. The demodulated L-LTF symbols include tone rotation for each 20 MHz segment as described in [2], Section 21.3.7.5. The receiver uses the L-LTF channel estimates (with tone rotation) to equalize and decode the pre-HE-LTF fields.
解调 L-LTF 并进行信道估计。 解调的 L-LTF 符号包括每个 20 MHz 段的音调旋转,如[2],第 21.3.7.5 节所述。 接收器使用 L-LTF 信道估计(带有音调旋转)来均衡和解码预 HE-LTF 字段。
lltfDemod = wlanHEDemodulate(rxLLTF,'L-LTF',chanBW);
lltfChanEst = wlanLLTFChannelEstimate(lltfDemod,chanBW);
L-SIG and RL-SIG Decoding
L-SIG 和 RL-SIG 解码
The L-SIG field determines the receive time, or RXTIME, of the packet. The receiver calculates RXTIME using the length bits of the L-SIG payload. The receiver recovers the L-SIG and RL-SIG fields to estimate the channel at the extra subcarriers in these fields. It then updates the lltfChanEst
channel estimates to include the channel estimates at the extra subcarriers in the L-SIG and RL-SIG fields. Using the estimates of the channel and the noise power from the L-LTF, the receiver decodes the L-SIG payload. After L-SIG decoding, update the L-SIG length property in the wlanHERecoveryConfig
object.
L-SIG 字段确定数据包的接收时间,或称作 RXTIME。接收端使用 L-SIG 负载的长度位计算 RXTIME。接收端恢复 L-SIG 和 RL-SIG 字段以估算这些字段中额外子载波的信道。然后更新lltfChanEst
通道估计值,以包含 L-SIG 和 RL-SIG 字段中额外子载波的信道估计值。利用从 L-LTF 中获得的信道估计值和噪声功率,接收端对 L-SIG 负载进行解码。在 L-SIG 解码后,更新wlanHERecoveryConfig
对象中的 L-SIG 长度属性。
disp('Decoding L-SIG... ');
Decoding L-SIG...
% Extract L-SIG and RL-SIG fields rxLSIG = rx(pktOffset+(ind.LSIG(1):ind.RLSIG(2)),:); % OFDM demodulate helsigDemod = wlanHEDemodulate(rxLSIG,'L-SIG',chanBW); % Estimate CPE and phase correct symbols helsigDemod = wlanHETrackPilotError(helsigDemod,lltfChanEst,cfgRx,'L-SIG'); % Estimate channel on extra 4 subcarriers per subchannel and create full % channel estimate preheInfo = wlanHEOFDMInfo('L-SIG',chanBW); preHEChanEst = wlanPreHEChannelEstimate(helsigDemod,lltfChanEst,chanBW); % Average L-SIG and RL-SIG before equalization helsigDemod = mean(helsigDemod,2); % Equalize data carrying subcarriers, merging 20 MHz subchannels [eqLSIGSym,csi] = wlanHEEqualize(helsigDemod(preheInfo.DataIndices,:,:), ... preHEChanEst(preheInfo.DataIndices,:,:),noiseVar,cfgRx,'L-SIG'); % Decode L-SIG field [~,failCheck,lsigInfo] = wlanLSIGBitRecover(eqLSIGSym,noiseVar,csi); if failCheck disp(' ** L-SIG check fail **'); else disp(' L-SIG check pass'); end
L-SIG check pass
% Get the length information from the recovered L-SIG bits and update the % L-SIG length property of the recovery configuration object lsigLength = lsigInfo.Length; cfgRx.LSIGLength = lsigLength; % Measure EVM of L-SIG symbols EVM = comm.EVM; EVM.ReferenceSignalSource = 'Estimated from reference constellation'; EVM.Normalization = 'Average constellation power'; EVM.ReferenceConstellation = wlanReferenceSymbols('BPSK'); rmsEVM = EVM(eqLSIGSym); fprintf(' L-SIG EVM: %2.2fdB\n\n',20*log10(rmsEVM/100));
L-SIG EVM: -36.78dB
% Calculate the receive time and corresponding number of samples in the % packet RXTime = ceil((lsigLength + 3)/3) * 4 + 20; % In microseconds numRxSamples = round(RXTime * 1e-6 * sr); % Number of samples in time fprintf(' RXTIME: %dus\n',RXTime);
RXTIME: 536us
fprintf(' Number of samples in the packet: %d\n\n',numRxSamples);
Number of samples in the packet: 10720
Given the RXTIME and corresponding number of samples within rx
, plot and display the waveform and the spectrum of the received packet.
给定 RXTIME 以及其中rx
的样本数量,绘制并显示接收包的波形和频谱。
sampleOffset = max((-lstfLength + pktOffset),1); % First index to plot sampleSpan = numRxSamples + 2*lstfLength; % Number samples to plot % Plot as much of the packet (and extra samples) as we can plotIdx = sampleOffset:min(sampleOffset + sampleSpan,rxWaveLen); % Configure timeScope to display the packet timeScope.TimeSpan = sampleSpan/sr; timeScope.TimeDisplayOffset = sampleOffset/sr; timeScope.YLimits = [0 max(abs(rx(:)))]; timeScope(abs(rx(plotIdx,:))); release(timeScope);
% Display the spectrum of the detected packet
spectrumAnalyzer(rx(pktOffset + (1:numRxSamples),:));
release(spectrumAnalyzer);
HE-SIG-A Decoding HE-SIG-A 解码
The HE-SIG-A field contains the transmission configuration of an HE packet. Decode the HE-SIG-A field using estimates of the channel and the noise power from the L-LTF field.
HE-SIG-A 字段包含 HE 数据包的传输配置。使用 L-LTF 字段中的通道和噪声功率的估计解码 HE-SIG-A 字段。
disp('Decoding HE-SIG-A...')
Decoding HE-SIG-A...
rxSIGA = rx(pktOffset+(ind.HESIGA(1):ind.HESIGA(2)),:); sigaDemod = wlanHEDemodulate(rxSIGA,'HE-SIG-A',chanBW); hesigaDemod = wlanHETrackPilotError(sigaDemod,preHEChanEst,cfgRx,'HE-SIG-A'); % Equalize data carrying subcarriers, merging 20 MHz subchannels preheInfo = wlanHEOFDMInfo('HE-SIG-A',chanBW); [eqSIGASym,csi] = wlanHEEqualize(hesigaDemod(preheInfo.DataIndices,:,:), ... preHEChanEst(preheInfo.DataIndices,:,:), ... noiseVar,cfgRx,'HE-SIG-A'); % Recover HE-SIG-A bits [sigaBits,failCRC] = wlanHESIGABitRecover(eqSIGASym,noiseVar,csi); % Perform the CRC on HE-SIG-A bits if failCRC disp(' ** HE-SIG-A CRC fail **'); else disp(' HE-SIG-A CRC pass'); end
HE-SIG-A CRC pass
% Measure EVM of HE-SIG-A symbols release(EVM); if strcmp(pktFormat,'HE-EXT-SU') % The second symbol of an HE-SIG-A field for an HE EXT SU packet is % QBPSK. EVM.ReferenceConstellation = wlanReferenceSymbols('BPSK',[0 pi/2 0 0]); % Account for scaling of L-LTF for an HE EXT SU packet rmsEVM = EVM(eqSIGASym*sqrt(2)); else EVM.ReferenceConstellation = wlanReferenceSymbols('BPSK'); rmsEVM = EVM(eqSIGASym); end fprintf(' HE-SIG-A EVM: %2.2fdB\n\n',20*log10(mean(rmsEVM)/100));
HE-SIG-A EVM: -35.85dB
Interpret Recovered HE-SIG-A Bits
解释恢复的 HE-SIG-A 位
Update the wlanHERecoveryConfig
object after interpreting the recovered HE-SIG-A bits.
更新在解释恢复的 HE-SIG-A 位后的 wlanHERecoveryConfig
对象。
cfgRx = interpretHESIGABits(cfgRx,sigaBits);
ind = wlanFieldIndices(cfgRx); % Update field indices
Display the common transmission configuration obtained from the HE-SIG-A field for an HE MU packet. The properties indicated by -1
are unknown or undefined. You can update the unknown user-related properties after successfully decoding the HE-SIG-B field.
显示从 HE-SIG-A 字段获得的用于 HE MU 数据包的常见传输配置。由-1
指示的属性是未知或未定义的。成功解码 HE-SIG-B 字段后,可以更新未知的与用户相关的属性。
disp(cfgRx)
wlanHERecoveryConfig with properties: PacketFormat: 'HE-MU' ChannelBandwidth: 'CBW20' LSIGLength: 383 SIGBCompression: 0 SIGBMCS: 0 SIGBDCM: 0 NumSIGBSymbolsSignaled: 5 STBC: 0 LDPCExtraSymbol: 0 PreFECPaddingFactor: 4 PEDisambiguity: 0 GuardInterval: 3.2000 HELTFType: 4 NumHELTFSymbols: 2 UplinkIndication: 0 BSSColor: 0 SpatialReuse: 0 TXOPDuration: 127 HighDoppler: 0 AllocationIndex: -1 NumUsersPerContentChannel: -1 RUTotalSpaceTimeStreams: -1 RUSize: -1 RUIndex: -1 STAID: -1 MCS: -1 DCM: -1 ChannelCoding: 'Unknown' Beamforming: -1 NumSpaceTimeStreams: -1 SpaceTimeStreamStartingIndex: -1
HE-SIG-B Decoding HE-SIG-B 解码
For an HE MU packet the HE-SIG-B field stores this information:
对于 HE MU 数据包,HE-SIG-B 字段存储此信息:
The RU allocation information for a non-compressed SIGB waveform is stored in the HE-SIG-B common field [1 Table. 27-24]. For a compressed SIGB waveform the RU allocation information is determined by the recovered HE-SIG-A bits.
非压缩 SIGB 波形的 RU 分配信息存储在 HE-SIG-B 公共字段[1表格。27-24]。对于压缩的 SIGB 波形,RU 分配信息由恢复的 HE-SIG-A 比特确定。The HE-SIG-B user field stores user transmission parameters for both SIGB compressed and non-compressed waveforms [1 Table. 27-27, 27-28].
HE-SIG-B 用户字段存储了 SIGB 压缩和非压缩波形的用户传输参数[1 表. 27-27, 27-28]。
For a non-compressed SIGB waveform, update the number of HE-SIG-B symbols in the wlanHERecoveryConfig
object. The example updates the symbols only if the number of HE-SIG-B symbols indicated in the HE-SIG-A field is 15 and all content channels pass the CRC. The example does not update the number of HE-SIG-B symbols indicated in the HE-SIG-A field if any HE-SIG-B content channel fails the CRC.
对于非压缩的 SIGB 波形,在wlanHERecoveryConfig
对象中更新 HE-SIG-B 符号的数量。如果 HE-SIG-A 字段中指示的 HE-SIG-B 符号数量为 15,并且所有内容通道都通过 CRC,则示例仅更新符号。如果任何 HE-SIG-B 内容通道未通过 CRC,则示例不会更新 HE-SIG-A 字段中指示的 HE-SIG-B 符号数量。
To decode the HE-SIG-B field, you require an estimate of the channel and noise power obtained from the L-LTF.
要解码 HE-SIG-B 字段,您需要从 L-LTF 获得的信道和噪声功率的估计。
if strcmp(pktFormat,'HE-MU') fprintf('Decoding HE-SIG-B...\n'); if ~cfgRx.SIGBCompression fprintf(' Decoding HE-SIG-B common field...\n'); s = getSIGBLength(cfgRx); % Get common field symbols. The start of HE-SIG-B field is known rxSym = rx(pktOffset+(double(ind.HESIGA(2))+(1:s.NumSIGBCommonFieldSamples)),:); % Decode HE-SIG-B common field [status,cfgRx] = heSIGBCommonFieldDecode(rxSym,preHEChanEst,noiseVar,cfgRx); % CRC on HE-SIG-B content channels if strcmp(status,'Success') fprintf(' HE-SIG-B (common field) CRC pass\n'); elseif strcmp(status,'ContentChannel1CRCFail') fprintf(' ** HE-SIG-B CRC fail for content channel-1\n **'); elseif strcmp(status,'ContentChannel2CRCFail') fprintf(' ** HE-SIG-B CRC fail for content channel-2\n **'); elseif any(strcmp(status,{'UnknownNumUsersContentChannel1','UnknownNumUsersContentChannel2'})) error(' ** Unknown packet length, discard packet\n **'); else % Discard the packet if all HE-SIG-B content channels fail error(' ** HE-SIG-B CRC fail **'); end % Update field indices as the number of HE-SIG-B symbols are % updated ind = wlanFieldIndices(cfgRx); end % Get complete HE-SIG-B field samples rxSIGB = rx(pktOffset+(ind.HESIGB(1):ind.HESIGB(2)),:); fprintf(' Decoding HE-SIG-B user field... \n'); % Decode HE-SIG-B user field [failCRC,cfgUsers] = heSIGBUserFieldDecode(rxSIGB,preHEChanEst,noiseVar,cfgRx); % CRC on HE-SIG-B users if ~all(failCRC) fprintf(' HE-SIG-B (user field) CRC pass\n\n'); numUsers = numel(cfgUsers); elseif all(failCRC) % Discard the packet if all users fail the CRC error(' ** HE-SIG-B CRC fail for all users **'); else fprintf(' ** HE-SIG-B CRC fail for at least one user\n **'); % Only process users with valid CRC numUsers = numel(cfgUsers); end else % HE SU, HE EXT SU cfgUsers = {cfgRx}; numUsers = 1; end
Decoding HE-SIG-B...
Decoding HE-SIG-B common field...
HE-SIG-B (common field) CRC pass
Decoding HE-SIG-B user field...
HE-SIG-B (user field) CRC pass
HE-Data Decoding HE-数据解码
Use the updated wlanHERecoveryConfig
object for each user to recover the PSDU bits for each user in the HE-Data field.
使用更新的wlanHERecoveryConfig
对象来为 HE-Data 字段中的每个用户恢复每个用户的 PSDU 比特。
cfgDataRec = trackingRecoveryConfig;
fprintf('Decoding HE-Data...\n');
Decoding HE-Data...
for iu = 1:numUsers % Get recovery configuration object for each user user = cfgUsers{iu}; if strcmp(pktFormat,'HE-MU') fprintf(' Decoding User:%d, STAID:%d, RUSize:%d\n',iu,user.STAID,user.RUSize); else fprintf(' Decoding RUSize:%d\n',user.RUSize); end heInfo = wlanHEOFDMInfo('HE-Data',chanBW,user.GuardInterval,[user.RUSize user.RUIndex]); % HE-LTF demodulation and channel estimation rxHELTF = rx(pktOffset+(ind.HELTF(1):ind.HELTF(2)),:); heltfDemod = wlanHEDemodulate(rxHELTF,'HE-LTF',chanBW,user.GuardInterval,user.HELTFType,[user.RUSize user.RUIndex]); [chanEst,pilotEst] = wlanHELTFChannelEstimate(heltfDemod,user); % Number of expected data OFDM symbols symLen = heInfo.FFTLength+heInfo.CPLength; numOFDMSym = double((ind.HEData(2)-ind.HEData(1)+1))/symLen; % HE-Data demodulation with pilot phase and time tracking % Account for extra samples when extracting data field from the packet % for sample rate offset tracking. Extra samples may be required if the % receiver clock is significantly faster than the transmitter. maxSRO = 120; % Parts per million Ne = ceil(numRxSamples*maxSRO*1e-6); % Number of extra samples Ne = min(Ne,rxWaveLen-numRxSamples); % Limited to length of waveform numRxSamplesProcess = numRxSamples+Ne; rxData = rx(pktOffset+(ind.HEData(1):numRxSamplesProcess),:); if user.RUSize==26 % Force phase only tracking for 26-tone RU as algorithm susceptible to noise cfgDataRec.PilotTimeTracking = false; cfgDataRec.PilotPhaseTracking = phaseTracking; else cfgDataRec.PilotTimeTracking = timeTracking; cfgDataRec.PilotPhaseTracking = phaseTracking; end demodSym = helperTrackingOFDMDemodulate(rxData,chanEst,numOFDMSym,user,cfgDataRec); % Estimate noise power in HE fields demodPilotSym = demodSym(heInfo.PilotIndices,:,:); nVarEst = wlanHEDataNoiseEstimate(demodPilotSym,pilotEst,user); % Equalize [eqSym,csi] = wlanHEEqualize(demodSym,chanEst,nVarEst,user,'HE-Data'); % Discard pilot subcarriers eqSymUser = eqSym(heInfo.DataIndices,:,:); csiData = csi(heInfo.DataIndices,:); % Demap and decode bits rxPSDU = wlanHEDataBitRecover(eqSymUser,nVarEst,csiData,user,'LDPCDecodingMethod','norm-min-sum'); % Deaggregate the A-MPDU [mpduList,~,status] = wlanAMPDUDeaggregate(rxPSDU,wlanHESUConfig); if strcmp(status,'Success') fprintf(' A-MPDU deaggregation successful \n'); else fprintf(' A-MPDU deaggregation unsuccessful \n'); end % Decode the list of MPDUs and check the FCS for each MPDU for i = 1:numel(mpduList) [~,~,status] = wlanMPDUDecode(mpduList{i},wlanHESUConfig,'DataFormat','octets'); if strcmp(status,'Success') fprintf(' FCS pass for MPDU:%d\n',i); else fprintf(' FCS fail for MPDU:%d\n',i); end end % Plot equalized constellation of the recovered HE data symbols for all % spatial streams per user helperPlotEQConstellation(eqSymUser,user,ConstellationDiagram,iu,numUsers); % Measure EVM of HE-Data symbols release(EVM); EVM.ReferenceConstellation = wlanReferenceSymbols(user); rmsEVM = EVM(eqSymUser(:)); fprintf(' HE-Data EVM:%2.2fdB\n\n',20*log10(rmsEVM/100)); % Plot EVM per symbol of the recovered HE data symbols helperPlotEVMPerSymbol(eqSymUser,user,EVMPerSymbol,iu,numUsers); % Plot EVM per subcarrier of the recovered HE data symbols helperPlotEVMPerSubcarrier(eqSymUser,user,EVMPerSubcarrier,iu,numUsers); end
Decoding User:1, STAID:1, RUSize:52
A-MPDU deaggregation successful
FCS pass for MPDU:1
HE-Data EVM:-28.89dB
Decoding User:2, STAID:2, RUSize:52
A-MPDU deaggregation successful
FCS pass for MPDU:1
HE-Data EVM:-39.59dB
Decoding User:3, STAID:3, RUSize:106
A-MPDU deaggregation successful
FCS pass for MPDU:1
HE-Data EVM:-28.07dB
Decoding User:4, STAID:4, RUSize:106
A-MPDU deaggregation successful
FCS pass for MPDU:1
HE-Data EVM:-30.89dB
Selected Bibliography 选定的参考书目
IEEE Std 802.11ax™-2021. IEEE Standard for Information Technology - Telecommunications and Information Exchange between Systems - Local and Metropolitan Area Networks - Specific Requirements - Part 11: Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) Specifications - Amendment 1: Enhancements for High-Efficiency WLAN.
IEEE 标准 802.11ax™-2021。信息技术 IEEE 标准-系统之间的电信和信息交换-局域网和城域网-具体要求-第 11 部分:无线局域网介质访问控制(MAC)和物理层(PHY)规范-修正案 1:高效率无线局域网增强。IEEE Std 802.11™-2020 Standard for Information Technology - Telecommunications and Information Exchange between Systems - Local and Metropolitan Area Networks - Specific Requirements - Part 11: Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) Specifications.
IEEE Std 802.11™-2020 信息技术标准-系统之间的电信和信息交换-局域和城域网-特定要求-第 11 部分:无线局域网介质访问控制(MAC)和物理层(PHY)规范。