主要内容

802.11 OFDM Beacon Receiver with Captured Data

This example shows a receiver design that is able to recover 802.11™ OFDM beacon packets in non-HT format transmitted over the air from commercial 802.11 hardware. Beacon packets are typically transmitted in non-HT format, even for HT [1], VHT [1]和/或他[2] capable hardware. Packet information such as SSID is printed to the command-line during recovery.

介绍

This example illustrates the use of WLAN Toolbox™ to recover real-world signals. It demonstrates a receiver design including synchronization, transmission configuration recovery, and payload decoding for non-HT packets. The example recovers beacon packets from a file containing a captured baseband waveform.

Beacon Packet Recovery

The following steps happen sequentially to recover one non-HT packet:

  • Packet Detection: First a packet must be detected before any processing begins. This is accomplished by auto-correlating input symbols. Since the front of each 802.11 OFDM packet contains a repetitive structure called the L-STF, peaks will occur in the correlation when this packet is present. The L-STF field is then extracted and used for coarse frequency estimation.

  • Symbol Timing: Once a packet has been detected, future symbols will be collected and cross-correlated to locate the L-LTF. The resulting correlation peaks provide an accurate timing estimate. Once the full L-LTF is located, it is extracted and used for channel estimation and fine frequency estimation.

  • L-SIG解码:L-LTF之后的第一个OFDM符号是L-SIG字段。必须恢复和解码此字段,以确定以下有效载荷的调制,代码率和长度。该信息用于在L-SIG之后捕获正确的数据以进行完整有效载荷并解码该信息。

  • 有效载荷解码:L-SIG之后的所有OFDM符号都被缓冲到由L-SIG字段确定的长度。捕获所有符号后,它们被解调并解码为源位。然后评估源位。该评估包括框架检查序列(FCS)验证和主体的提取。如果数据包是子类型信标,则将为恢复的数据包打印诸如SSID之类的摘要信息。

Once a full packet is received or any failures occur during the processing chain, the receiver will return to packet detection to search for more packets. This process is repeated for the duration of the signal.

Streaming Process on Captured Data

在此示例中,处理空中捕获以恢复信标框架。使用一个接收天线的RF界面以20 msps的采样速率捕获Wi-Fi®信号。捕获的波形存储在二进制基带文件中。该文件是使用comm.BasebandFileWriter

The captured waveform is processed in a streaming fashion. A block of samples is pulled in for processing in each iteration. As many valid packets are retrieved as possible.comm.BasebandFileReaderis used to read blocks of samples from the binary baseband file.

%创建一个对象以从文件流式传输数据basebandReader = comm.basebandfilereader(。。。'Filename','nonHTBeaconRxData.bb',。。。'SamplesPerFrame',80);% Number of samples in 1 OFDM symbol at 20 MHz

COMM.BASEBANDFILEREADER对象提供了捕获波形中的中心频率,采样率和通道数。

disp([“中心频率:”num2str(basebandReader.CenterFrequency/1e6)' MHz']) disp(['Sample rate: 'num2str(basebandReader.SampleRate/1e6)'MSPS']) disp([“接收天线的数量:”num2str(basbandreader.numchannels)newline])))
中心频率:5785 MHz样本率:20 MSP接收天线:1

AnonHTFrontEnd对象执行前端处理和L-SIG 12月oding. The object is configured with a channel bandwidth of 20 MHz to process non-HT packets. Only one receive antenna is supported.

rxfrontend = nonhtfrontend('ChannelBandwidth','CBW20');

a while循环用于处理样本块并恢复信标数据包,直到基带文件中没有更多数据。在循环的每次迭代中rxFrontEndrxFrontEndperforms front-end processing and buffers samples until a packet has been detected and the payload received. When有效负载是的,完整的有效载荷已被缓冲,并且rxFrontEnd返回变量以允许恢复数据包中的数据:

  • cfgNonHTcontains the recovered packet parameters from L-SIG.

  • rxNonHTData是时间域的非HT数据字段信号。

  • chanEst包含从L-LTF获得的通道估计值。

  • Noisevar是固定的噪声方差值。

数据包有效载荷位是从非HT数据字段样本中恢复的wlanNonHTDataRecover。然后将其验证和解码wlanMPDUDecode恢复MAC帧参数。wlanMPDUDecode返回以下输出,以确定收到的数据包是否通过FCS检查以及收到的数据包是否为信标框架。

  • mpduCfgis an object of typewlanMACFrameConfigcontaining the recovered MAC frame parameters from the beacon frame.

  • 地位is an enumeration of type地位which is returned as 'Success' when MPDU passes FCS check and returned as 'FCSFailed' when the MPDU fails FCS check.

如果检测到有效的信标,则将显示解码的SSID。

%符号符号流流程numValidPackets = 0;尽管~isDone(basebandReader)%拉动一个OFDM符号,即80个样本data = basebandReader();%执行前端处理和有效载荷缓冲[payloadFull, cfgNonHT, rxNonHTData, chanEst, noiseVar] =。。。rxfrontend(数据);如果有效负载%恢复有效载荷位,零强度均衡recbits = wlannonhtdatarecover(rxnonhtdata,chanest,。。。nocevar,cfgnonht,'EqualizationMethod','ZF');% Decode and evaluate recovered bits[mpducfg,〜,状态] = wlanmpdudecode(recbits,cfgnonht);如果strcmp(状态,'成功')&& strcmp(mpducfg.frametype,'Beacon') frameBody = mpduCfg.ManagementConfig;%显示SSIDdisp(['ssid:', frameBody.SSID]) numValidPackets = numValidPackets + 1;endendenddisp([num2str(numValidPackets),' Valid Beacon Packets Found']) release(basebandReader); release(rxFrontEnd);
SSID: MathWorks-SDR SSID: MathWorks-SDR SSID: MathWorks-SDR 3 Valid Beacon Packets Found

进一步探索

See802.11 OUSRP硬件的DM Beacon接收器for an example of processing live signals with USRP.

Appendix

This example uses the following helper functions and objects:

选定的参考书目

  1. IEEE STD 802.11™-2020。信息技术的IEEE标准 - 系统之间的电信和信息交换 - 本地和大都市区域网络 - 特定要求 - 第11部分:无线LAN媒体访问控制(MAC)和物理层(PHY)规格。

  2. IEEE STD 802.11AX™-2021。信息技术的IEEE标准 - 系统之间的电信和信息交换 - 本地和大都市区域网络 - 特定要求 - 第11部分:无线LAN媒体访问控制(MAC)和物理层(PHY)规格 - 修正案1:高效智能WLAN的增强功能。