主要内容

端到端IEEE 802.15.4 PHY模拟

此示例显示了如何生成波形,解码波形和计算BER曲线,以适用于IEEE®802.15.4™标准的不同PHY规格[1], using the Communications Toolbox™ Library for ZigBee and UWB.

Background

TheIEEE 802.15.4standard specifies thePHYMAClayers of Low-Rate Wireless Personal Area Networks (LR-WPANs) [1]。IEEE 802.15.4 PHY和MAC层提供了其他高层标准的基础,例如Zigbee., WirelessHart®, 6LoWPAN and MiWi. Such standards find application in home automation and sensor networking and are highly relevant to the Internet of Things (IoT) trend.

IEEE 802.15.4的物理层实现

原始的IEEE 802.15.4标准及其修订指定了多个PHY层,使用不同的调制方案并支持不同的数据速率。金宝app这些物理层是针对特定频带的,并在一定程度上针对特定国家 /地区设计了。该示例提供了为原始IEEE 802.15.4规范中提出的物理层生成和解码波形的功能(OQPSK,2.4 GHz,BPSK,868/915 MHz),IEEE 802.15.4B(OQPSK和ESK IN 868/915 MHz),IEEE 802.15.4C(780 MHz中的OQPSK)和IEEE 802.15.4D(950 MHz的GFSK和BPSK)。

这些物理层指定了PHY协议数据单元(PPDU)的格式,该格式包括序言,框架定界符(SFD)以及MAC协议数据单元(MPDU)的长度和内容。序言和SFD用于帧级同步。在下面的描述中,术语符号表示芯片序列的整数索引(按照IEEE 802.15.4标准),而不是调制符号(即复杂的数字)。

  • OQPSK PHY:所有OQPSK PHYS映射每4个PPDU位到一个符号中。2.4 GHz OQPSK PHY将每个符号传播到32芯片序列,而另一个OQPSK Phys将其扩散到16片序列。然后,对芯片序列进行OQPSK调制,并传递到半脉冲脉冲成型滤波器(或在780 MHz频段中的正常凸起的余弦滤波器)。有关详细说明,请参见[1]。

  • BPSK PHY:BPSK PHY差异编码PPDU位。每个结果位均扩散到15片序列。然后,将芯片序列调制为BPSK,并传递到正常的弹性滤波器中。有关详细说明,请参见[1]。

  • ASK PHY: The ASK PHY uses BPSK modulation for the preamble and the SFD only. The remaining PPDU bits, i.e., the PHY header (PHR) and the MPDU, are first mapped to 20-bit symbols in the 868 MHz band and to 5-bit symbols in the 915 MHz band. Each symbol is spread to a 32-chip sequence using a technique known as Parallel Sequence Spread Spectrum (PSSS) or Orthogonal Code Division Multiplexing (OCDM). The chip sequence is then ASK modulated and passed to a root raised cosine filter. For a detailed description, see Clause 12 in [1]。

  • GFSK PHY: The GFSK PHY first whitens the PPDU bits using modulo-2 addition with a PN9 sequence. The whitened bits are then GFSK modulated. For a detailed description, see Clause 15 in [1]。

Waveform Generation, Decoding and BER Curve Calculation

该代码说明了如何将波形生成和解码函数用于不同的频段,并比较相应的BER曲线。

ecno = -25:2.5:17.5;% Ec/No range of BER curvesspc = 4;%样本每个芯片msgLen = 8*120;% length in bitsmessage = randi([0 1], msgLen, 1);% transmitted message% Preallocate vectors to store BER results:[Beroqpsk2450,Beroqpsk780,Berbpsk,Berask915,...berask868,bergfsk] = deal(zeros(1,长度(ecno)));foridx = 1:长度(ecno)% loop over the EcNo range% O-QPSK PHY, 2450 MHzwaveform = lrwpan.PHYGeneratorOQPSK(message, spc,'2450 MHz');K = 2;% information bits per symbolsnr = ecno(idx)-10*log10(spc) + 10*log10(k);接收= awgn(波形,snr);bits = lrwpan.PHYDecoderOQPSKNoSync(received, spc,'2450 MHz');[〜,beroqpsk2450(idx)] = biterr(消息,位);% O-QPSK PHY, 780MHzwaveform = lrwpan.PHYGeneratorOQPSK(message, spc,'780 MHz');% or '868 MHz'/'915 MHz'snr = ecno(idx)-10*log10(spc) + 10*log10(k);接收= awgn(波形,snr);bits = lrwpan.PHYDecoderOQPSKNoSync(received, spc,'780 MHz');% or '868 MHz'/'915 MHz'[~, berOQPSK780(idx)] = biterr(message, bits);% BPSK PHY, 868/915/950 MHzwaveform = lrwpan.phygeneratorbpsk(消息,SPC);k = 1;% information bits per symbolsnr = ecno(idx)-10*log10(spc) + 10*log10(k);接收= awgn(波形,snr);bits = lrwpan.phydecoderbpsk(接收,SPC);[〜,berbpsk(idx)] = biterr(消息,位);%询问PHY,915 MHzwaveform = lrwpan.PHYGeneratorASK(message, spc,'915 MHz');k = 1;% information bits per symbolsnr = ecno(idx)-10*log10(spc) + 10*log10(k);接收= awgn(波形,snr);bits = lrwpan.PHYDecoderASK(received, spc,'915 MHz');[〜,berask915(idx)] = biterr(消息,位(1:msglen));% ASK PHY, 868 MHzwaveform = lrwpan.PHYGeneratorASK(message, spc,'868 MHz');k = 1;% information bits per symbolsnr = ecno(idx)-10*log10(spc) + 10*log10(k);接收= awgn(波形,snr);bits = lrwpan.PHYDecoderASK(received, spc,'868 MHz');[~, berASK868(idx)] = biterr(message, bits(1:msgLen));% GFSK PHY, 950 MHzwaveform = lrwpan.PHYGeneratorGFSK(message, spc); K = 1;% information bits per symbolsnr = ecno(idx)-10*log10(spc) + 10*log10(k);接收= awgn(波形,snr);bits = lrwpan.PHYDecoderGFSK(received, spc); [~, berGFSK(idx)] = biterr(message, bits);end% plot BER curve图半学(ECNO,Beroqpsk2450,'-o',ecno,beroqpsk780,'-*', EcNo, berBPSK,'-+',...EcNo, berASK915,“- x”, EcNo, berASK868,'-s', EcNo, berGFSK,'-v') legend('Oqpsk,2450 MHz','OQPSK, 780 MHz','BPSK,868/915/950 MHz',“问,915 MHz”,...'ASK, 868 MHz','GFSK,950 MHz','地点','西南') title('IEEE 802.15.4 PHY BER Curves')xlabel('Chip Energy to Noise Spectral Density, Ec/No (dB)')ylabel('BER') axis([min(EcNo) max(EcNo) 10^-2 1]) grid

进一步探索

You can further explore the following generator and decoding functions:

Selected Bibliography

  1. IEEE 802.15.4-2011 - IEEE Standard for Local and metropolitan area networks--Part 15.4: Low-Rate Wireless Personal Area Networks (LR-WPANs)