Main Content

802.11ac Waveform Generation with MAC Frames

This example shows how to generate an IEEE® 802.11ac™ transmission containing MAC frames suitable for performing radio packet error rate (PER) receiver tests.

Introduction

WLAN Toolbox™ can be used to generate standard compliant waveforms for performing receiver tests. A basic WLAN receiver test scenario is shown in the diagram below.

The device under test (DUT) is stimulated with RF test vectors, usually through a wired link. The packet error rate (PER) is a metric used to test the performance of a receiver at a given receive signal power in the presence of noise, interference, or other impairments. The PER is defined as the number of incorrectly decoded packets divided by the total number of transmitted packets.

The frame check sequence (FCS) within a MAC frame is used to determine whether a MAC frame has been decoded correctly by the receiver, and therefore whether the packet has been received in error. The general MAC frame for IEEE 802.11ac contains the following fields:

  • MAC header

  • 帧的身体

  • FCS

The data to transmit from a higher layer is contained within the frame body of the MAC frame. The transmitter uses a cyclic redundancy check over the MAC header and frame body field to generate the FCS value. The receiver calculates the CRC and compares this to the received FCS field to determine if an error has occurred during transmission.

In this example an IEEE 802.11ac waveform consisting of multiple VHT format packets is generated. ThewlanWaveformGeneratorfunction can be used to generate a waveform containing one or more packets. ThewlanWaveformGeneratorfunction consumes physical layer service data units (PSDUs) for each packet and performs the appropriate physical layer processing to create the waveform. A PSDU containing a MAC header and valid FCS can be generated using thewlanMACFramefunction. In this example a multi-packet baseband waveform containing MAC packets is synthesized. This waveform may be downloaded to a signal generator for RF transmission and used for receiver PER testing. Source code is provided to download and play the waveform using a Keysight Technologies™ N5172B signal generator. The example processing is illustrated in the following diagram:

802.11ac VHT Format Configuration

The format-specific configuration of a VHT waveform synthesized with thewlanWaveformGeneratorfunction is described by the VHT format configuration object,wlanVHTConfig. The properties of the object contain the configuration. In this example an object is configured for a 160 MHz bandwidth, 1 transmit antenna, 1 space-time stream and QPSK rate 1/2 (MCS 1).

vhtCfg = wlanVHTConfig;%Create packet configurationvhtCfg.ChannelBandwidth ='CBW160';%160 MHz channel bandwidthvhtCfg.NumTransmitAntennas = 1;%1 transmit antennavhtCfg.NumSpaceTimeStreams = 1;%1 space-time streamvhtCfg.MCS = 1;%Modulation: QPSK Rate: 1/2

Waveform Generation Configuration

ThewlanWaveformGeneratorfunction can be configured to generate one or more packets and add an idle time between each packet. The function can be configured to generate an oversampled or nominal rate waveform. In this example four oversampled packets with a 20 microsecond idle period will be created.

numPackets = 4;%生成4包idleTime = 20e-6;%20 microseconds idle period after packetoversamplingFactor = 1.5;%Oversample waveform 1.5x nominal baseband rate

The PSDU transmitted in each packet is scrambled using a random seed for each packet. This is accomplished by specifying a vector of scrambler initialization seeds. The valid range of the seed is between 1 and 127 inclusive.

%Initialize the scrambler with a random integer for each packetscramblerInitialization = randi([1 127],numPackets,1);

Create a PSDU for Each Packet

For an IEEE 802.11ac data transmission the MAC frame is termed a MAC protocol data unit (MPDU), the MAC header is termed the MPDU header, and the frame body is an aggregated MAC service data unit (A-MSDU). One or more MPDUs are delimited, padded and aggregated to create an aggregated MPDU (A-MPDU). The A-MPDU is delimited and padded to form the physical layer service data unit (PSDU) which is coded and modulated to create the transmitted packet. This process of encapsulation is shown in the following diagram:

In this example a PSDU is created containing a single MPDU for each packet. The MPDU consists of an MPDU header, A-MSDU frame containing concatenated A-MSDU subframes with random data and valid FCS. ThewlanMACFramefunction creates an A-MPDU with EOF delimiters and padding, i.e. the PSDU, as specified in [1]. It also returns the length of the A-MPDU, termed as the APEP Length, which is used to set theAPEPLengthproperty of the VHT configuration object. A PSDU is generated for each packet and is concatenated into a vectordatafor transmission with thewlanWaveformGeneratorfunction. The processing to create the concatenated PSDU bitsdatais shown in the diagram below:

%Create frame configurationmacCfg = wlanMACFrameConfig('FrameType','QoS Data'); macCfg.FrameFormat ='VHT';%Frame formatmacCfg.MSDUAggregation = true;%Form A-MSDUs internallybitsPerByte = 8;%Number of bits in 1 bytedata = [];fori=1:numPackets%Get MSDU lengths to create a random payload for forming an A-MPDU of%4048 octets (pre-EOF padding)msduLengths = wlanMSDULengths(4048, macCfg, vhtCfg); msdu = cell(numel(msduLengths), 1);%Create MSDUs with the obtained lengthsforj = 1:numel(msduLengths) msdu{j} = randi([0 255], 1, msduLengths(j));end%Generate PSDU bits containing A-MPDU with EOF delimiters and padding[psdu, apepLength] = wlanMACFrame(msdu, macCfg, vhtCfg,'OutputFormat','bits');%Set the APEP length in the VHT configurationvhtCfg.APEPLength = apepLength;%Concatenate packet PSDUs for waveform generationdata = [data; psdu];%#okend

Generate a Baseband Waveform

The concatenated PSDU bits for all packets,data, are passed as an argument to thewlanWaveformGeneratorfunction along with the VHT packet configuration objectvhtCfg. This configures the waveform generator to synthesize an 802.11ac VHT waveform. To generate 802.11n™ HT or other format waveforms, use a different format configuration object, for examplewlanHTConfigorwlanNonHTConfig. The waveform generator is additionally configured using name-value pairs to generate multiple oversampled packets with a specified idle time between packets, and initial scrambler states.

%Generate baseband VHT packetstxWaveform = wlanWaveformGenerator(data,vhtCfg,...'NumPackets',numPackets,'IdleTime',idleTime,...'ScramblerInitialization',scramblerInitialization,...'OversamplingFactor',oversamplingFactor); fs = wlanSampleRate(vhtCfg,'OversamplingFactor',oversamplingFactor); disp(['Baseband sampling rate: 'num2str(fs/1e6)' Msps']);
Baseband sampling rate: 240 Msps

The magnitude of the baseband waveform is displayed below. Note the number of packets and idle time configured.

figure; plot(abs(txWaveform)); xlabel('Sample index'); ylabel('Magnitude'); title('Baseband IEEE 802.11ac Waveform'); legend('Transmit antenna 1');

Figure contains an axes object. The axes object with title Baseband IEEE 802.11ac Waveform contains an object of type line. This object represents Transmit antenna 1.

View the frequency spectrum of the generated time domain waveform by using theDSP System Toolboxdsp.SpectrumAnalyzer. As expected, the 160 MHz signal bandwidth is clearly visible.

spectrumAnalyzer = dsp.SpectrumAnalyzer; spectrumAnalyzer.SampleRate = fs; spectrumAnalyzer.SpectrumType ='Power density';spectrumAnalyzer.RBWSource ='Property';spectrumAnalyzer.RBW = 100e3; spectrumAnalyzer.AveragingMethod ='Exponential';spectrumAnalyze.ForgettingFactor = 0.99; spectrumAnalyzer.YLabel =PSD的;spectrumAnalyzer.Title ='Baseband IEEE 802.11ac Waveform';spectrumAnalyzer(txWaveform); release(spectrumAnalyzer)

Figure Spectrum Analyzer contains an axes object and other objects of type uiflowcontainer, uimenu, uitoolbar. The axes object with title Baseband IEEE 802.11ac Waveform contains an object of type line. This object represents Channel 1.

Generate Over-the-Air Signal Using an RF Signal Generator

The baseband waveform created by WLAN Toolbox can now be downloaded to a signal generator to perform receiver tests. UseInstrument Control Toolboxto generate an RF signal with a center frequency of 5.25 GHz RF using the Keysight Technologies N5172B signal generator.

%Control whether to download the waveform to the waveform generatorplayOverTheAir = false;%Download the baseband IQ waveform to the instrument. Generate the RF%signal at a center frequency of 5.25 GHz and output power of -10 dBm.ifplayOverTheAir fc = 5.25e9;%#ok % Center frequencypower = -10;%Output powerloopCount = Inf;%Number time to loop%Configure the signal generator, download the waveform and looprf = rfsiggen(); rf.Resource ='TCPIP0::192.168.0.1::inst0::INSTR';rf.Driver ='AgRfSigGen';connect(rf);%Connect to the instrumentdownload(rf,txWaveform.',fs);%下载波形的仪器start(rf,fc,power,loopCount);%Start transmitting waveform%When you have finished transmitting, stop the waveform outputstop(rf); disconnect(rf);end

Selected Bibliography

  1. IEEE Std 802.11™-2016信息;IEEE标准n 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.