Generate WLAN waveform
waveform = wlanWaveformGenerator(bits,cfgFormat)
waveform = wlanWaveformGenerator(bits,cfgFormat,Name,Value)
generates a waveform for the specified information bits, and format configuration.
For more information, see IEEE 802.11 PPDU Format.waveform
= wlanWaveformGenerator(bits
,cfgFormat
)
overrides default generator configuration values using one or more
waveform
= wlanWaveformGenerator(bits
,cfgFormat
,Name,Value
)Name,Value
pair arguments.
Generate a timedomain signal for an 802.11ac VHT transmission with one packet.
Create the format configuration object, vht
. Assign two transmit antennas and two spatial streams, and disable STBC. Set the MCS to 1
, which assigns QPSK modulation and a 1/2 rate coding scheme per the 802.11 standard. Set the number of bytes in the AMPDU preEOF padding, APEPLength
, to 1024
.
vht = wlanVHTConfig; vht.NumTransmitAntennas = 2; vht.NumSpaceTimeStreams = 2; vht.STBC = false; vht.MCS = 1; vht.APEPLength = 1024;
Generate the transmission waveform.
bits = [1;0;0;1]; txWaveform = wlanWaveformGenerator(bits,vht);
HE MUMIMO Configuration With SIGB Compression
Use Only User Field Bits
Generate a full bandwidth HE MUMIMO configuration at 20MHz bandwidth with SIGB compression. All three users are on a single content channel, which includes only the user field bits.
cfgHE = wlanHEMUConfig(194); cfgHE.NumTransmitAntennas = 3;
Create PSDU data for all users.
psdu = cell(1,numel(cfgHE.User)); psduLength = getPSDULength(cfgHE); for j = 1:numel(cfgHE.User) psdu = randi([0 1],psduLength(j)*8,1,'int8'); end
Generate and plot the waveform.
y = wlanWaveformGenerator(psdu,cfgHE); plot(abs(y))
HESIGB Content Assign 4 Users in Channel 1 and 3 Users in Channel 2
Generate a full bandwidth HE MUMIMO waveform at 80MHz bandwidth with SIGB compression. HESIGB content channel 1 has four users. HESIGB content channel 2 has three users.
cfgHE = wlanHEMUConfig(214); cfgHE.NumTransmitAntennas = 7;
Create PSDU data for all users.
psdu = cell(1,numel(cfgHE.User)); psduLength = getPSDULength(cfgHE); for j = 1:numel(cfgHE.User) psdu = randi([0 1],psduLength(j)*8,1,'int8'); end
Generate and plot the waveform.
y = wlanWaveformGenerator(psdu,cfgHE); plot(abs(y));
HE MUMIMO Configuration Without SIGB Compression
Use Common and User Field Bits
Generate a full bandwidth HE MUMIMO configuration at 20MHz bandwidth without SIGB compression. All three users are on a single content channel, which includes both common and user field bits.
cfgHE = wlanHEMUConfig(194); cfgHE.SIGBCompression = false; cfgHE.NumTransmitAntennas = 3;
Create PSDU data for all users.
psdu = cell(1,numel(cfgHE.User)); psduLength = getPSDULength(cfgHE); for j = 1:numel(cfgHE.User) psdu = randi([0 1],psduLength(j)*8,1,'int8'); end
Generate and plot the waveform.
y = wlanWaveformGenerator(psdu,cfgHE); plot(abs(y))
HESIGB Content Assign 4 Users in Channel 1 and 2 Users in Channel 2
Generate an 80 MHz HEMU waveform for six users without SIGB compression. HESIGB content channel 1 has four users. HESIGB content channel 2 has two users.
cfgHE = wlanHEMUConfig([202 114 192 193]); cfgHE.NumTransmitAntennas = 6; for i = 1:numel(cfgHE.RU) cfgHE.RU{i}.SpatialMapping = 'Fourier'; end
Create PSDU data for all users.
psdu = cell(1,numel(cfgHE.User)); psduLength = getPSDULength(cfgHE); for j = 1:numel(cfgHE.User) psdu = randi([0 1],psduLength(j)*8,1,'int8'); end
Generate and plot the waveform.
y = wlanWaveformGenerator(psdu,cfgHE); plot(abs(y));
HESIGB Content Assign 7 Users in Channel 1 and No Users in Channel 2
Generate a full bandwidth HE MUMIMO waveform at 80MHz bandwidth without SIGB compression. HESIGB content channel 1 has seven users. HESIGB content channel 2 has no users.
cfgHE = wlanHEMUConfig([214 115 115 115]); cfgHE.NumTransmitAntennas = 7;
Create PSDU data for all users.
psdu = cell(1,numel(cfgHE.User)); psduLength = getPSDULength(cfgHE); for j = 1:numel(cfgHE.User) psdu = randi([0 1],psduLength(j)*8,1,'int8'); end
Generate and plot the waveform.
y = wlanWaveformGenerator(psdu,cfgHE); plot(abs(y))
Configure wlanWaveformGenerator
to produce a timedomain signal for an 802.11ac VHT transmission with five packets and a 30 microsecond idle period between packet. Use a random scrambler initial state for each packet.
Create a VHT configuration object and confirm the channel bandwidth for scaling the xaxis of the plot.
vht = wlanVHTConfig; vht.ChannelBandwidth
ans = 'CBW80'
Generate and plot the waveform. Display the time in microseconds on the xaxis.
numPkts = 5; scramInit = randi([1 127],numPkts,1); txWaveform = wlanWaveformGenerator([1;0;0;1],vht,'NumPackets',numPkts,'IdleTime',30e6,'ScramblerInitialization',scramInit); time = [0:length(txWaveform)1]/80e6; plot(time,abs(txWaveform)) xlabel ('Time (microseconds)') ylabel('Amplitude')
Five packets separated by 30 microsecond idle periods.
bits
— Information bitsInformation bits for a single user, including any MAC padding
representing multiple concatenated PSDUs, specified as a binary vector
stream. Internally, the input bits
vector is
looped as required to generate the specified number of packets. The
property cfgFormat
.
PSDULength
specifies
the number of data bits taken from the bit stream for each transmission
packet generated. The property NumPackets
specifies
the number of packets to generate.
When bits
is a cell array, each
element of the cell array must be a double
or int8
typed
binary vector.
When bits
is a vector or scalar
cell array, the specified bits apply to all users.
When bits
is a vector cell array,
each element applies to each user correspondingly. For each user,
if the number of bits required across all packets of the generation
exceeds the length of the vector provided, the applied bit vector
is looped. Looping on the bits allows you to define a short pattern,
for example. [1;0;0;1]
, that is repeated as the
input to the PSDU coding across packets and users. In each packet
generation, for the ith user, the ith
element of the cfgFormat
.PSDULength
indicates
the number of data bytes taken from its stream. Multiple PSDULength
by
eight to compute the number of bits
Example: [1 1 0 1 0 1 1]
Data Types: double
 int8
cfgFormat
— Packet format configurationwlanHEMUConfig
 wlanHESUConfig
 wlanDMGConfig
object  wlanS1GConfig
object  wlanVHTConfig
object  wlanHTConfig
object  wlanNonHTConfig
objectPacket format configuration, specified as a wlanHEMUConfig
, wlanHESUConfig
, wlanDMGConfig
, wlanS1GConfig
, wlanVHTConfig
, wlanHTConfig
, or wlanNonHTConfig
object. The
type of cfgFormat
object determines the IEEE^{®}
802.11™ format of the generated waveform. For a description of the
properties and valid settings for the various packet format configuration
objects, see:
The data rate and PSDU length of generated PPDUs is determined based on the properties of the packet format configuration object.
Name,Value
— NameValue Pair ArgumentsName1,Value1,...,NameN,ValueN
Specify optional
commaseparated pairs of Name,Value
arguments. Name
is
the argument name and Value
is the corresponding value.
Name
must appear inside quotes. You can specify several name and value
pair arguments in any order as
Name1,Value1,...,NameN,ValueN
.
Example: 'NumPackets',21,'ScramblerInitialization',[52,17]
NumPackets
— Number of packetsNumber of packets to generate in a single function call, specified as a positive integer.
Data Types: double
IdleTime
— Idle time added after each packetIdle time added after each packet, specified as a nonnegative
scalar in seconds. The default value is 0. If IdleTime
is
not set to the default value, it must be:
≥ 1e06 seconds for DMG format
≥ 2e06 seconds for VHT, HTmixed, nonHT formats
Example: 20e6
Data Types: double
ScramblerInitialization
— Initial scrambler stateInitial scrambler state of the data scrambler for each packet generated, specified as an integer from 1 to 127, or as an N_{P}byN_{Users} matrix of integers with values from 1 to 127. N_{P} is the number of packets, and N_{Users} is the number of users.
The default value of 93 is the example state given in IEEE Std 802.112012 [3], Section
L.1.5.2 and applies for S1G, VHT, HT, and NonHT OFDM formats. For
the DMG format, specifying ScramblerInitialization
with wlanWaveformGenerator
overrides
the value specified by the wlanDMGConfig
configuration
object. For more information, see Scrambler Initialization.
When specified as a scalar, the same scrambler initialization value is used to generate each packet for each user of a multipacket waveform.
When specified as a matrix, each element represents an initial state of the scrambler for packets in the multipacket waveform generated for each user. Each column specifies the initial states for a single user, therefore up to four columns are supported. If a single column is provided, the same initial states are used for all users. Each row represents the initial state of each packet to generate. Therefore, a matrix with multiple rows enables you to use a different initial state per packet, where the first row contains the initial state of the first packet. If the number of packets to generate exceeds the number of rows of the matrix provided, the rows are looped internally.
ScramblerInitialization
is not valid for
nonHT DSSS.
Example: [3 56 120]
Data Types: double
 int8
WindowTransitionTime
— Duration of the window transitionDuration of the window transition applied to each OFDM symbol, specified in seconds as a
nonnegative scalar. No windowing is applied if WindowTransitionTime
= 0. The default and maximum value permitted is shown for the various formats, type of
guard interval, and channel bandwidth.
Format  Bandwidth  Permitted
WindowTransitionTime (seconds)  

Default  Maximum  Maximum Permitted Based on Guard Interval Duration  
3.2 µs  1.6 µs  0.8 µs (Long)  0.4 µs (Short)  
DMG  2640 MHz  6.0606e09 (= 16/2640e6)  9.6969e08 (= 256/2640e6)  –  –  –  – 
S1G  1, 2, 4, 8, or 16 MHz  1.0e07  –  –  –  1.6e05  8.0e06 
HESU / HEMU  20, 40, 80, or 160 MHz  1.0e07  –  6.4e06  3.2e06  1.6e06  – 
VHT  20, 40, 80, or 160 MHz  1.0e07  –  –  –  1.6e06  8.0e07 
HTmixed  20 or 40 MHz  1.0e07  –  –  –  1.6e06  8.0e07 
nonHT  20 MHz  1.0e07  –  –  –  1.6e06  – 
10 MHz  1.0e07  –  –  –  3.2e06  –  
5 MHz  1.0e07  –  –  –  6.4e06  – 
Data Types: double
waveform
— Packetized waveformPacketized waveform, returned as an N_{S}byN_{T} matrix. N_{S} is
the number of timedomain samples, and N_{T} is
the number of transmit antennas. waveform
contains
one or more packets of the same IEEE 802.11 PPDU Format. Each packet can contain different information
bits. Waveform packet windowing is enabled by setting WindowTransitionTime
> 0. Windowing is enabled by default.
For more information, see Waveform Sampling Rate, OFDM Symbol Windowing, and Waveform Looping.
Data Types: double
Complex Number Support: Yes
Supported IEEE 802.11^{[1]} PPDU formats defined for transmission include VHT, HT, nonHT, S1G, DMG, and HE. For all formats, the PPDU field structure includes preamble and data portions. For a detailed description of the packet structures for the various formats supported, see WLAN Packet Structure.
At the output of wlanWaveformGenerator
,
the generated waveform has a sampling rate equal to the channel bandwidth.
For all HE, VHT, HT, and nonHT format OFDM modulation, the channel bandwidth is configured
via the ChannelBandwidth
property of the format configuration
object.
For the DMG format modulation schemes, the channel bandwidth is always 2640 MHz and the channel spacing is always 2160 MHz These values are specified in IEEE 802.11ad™2012 [4], Section 21.3.4 and Annex E1, respectively.
For the nonHT format DSSS modulation scheme, the chipping rate is always 11 MHz, as specified in IEEE 802.112012[3], Section 17.1.1.
This table indicates the waveform sampling rates associated with standard channel spacing for each configuration format prior to filtering.
Configuration Object 

 Channel Spacing (MHz)  Sampling Rate (MHz) (F_{S}, F_{C}) 

 Control PHY  For DMG, the channel bandwidth is fixed at 2640 MHz.  2160  F_{C} = ⅔ F_{S} = 1760 
SC  
OFDM  F_{S} = 2640  
 OFDM 
 1  F_{S} = 1 
 2  F_{S} = 2  
 4  F_{S} = 4  
 8  F_{S} = 8  
 16  F_{S} = 16  
 OFDMA 
 20  F_{S} = 20 
 40  F_{S} = 40  
 80  F_{S} = 80  
 160  F_{S} = 160  
 OFDM 
 20  F_{S} = 20 
 40  F_{S} = 40  
 80  F_{S} = 80  
 160  F_{S} = 160  
 OFDM 
 20  F_{S} = 20 
 40  F_{S} = 40  
 DSSS/CCK  Not applicable  11  F_{C} = 11 
OFDM 
 5  F_{S} = 5  
 10  F_{S} = 10  
 20  F_{S} = 20  
F_{S} is the OFDM sampling rate. F_{C} is the chip rate for single carrier, control PHY, and DSSS/CCK modulations. 
OFDM naturally lends itself to processing with
Fourier transforms. A negative side effect of using an IFFT to process
OFDM symbols is the resulting symboledge discontinuities. These discontinuities
cause outofband emissions in the transition region between consecutive
OFDM symbols. To smooth the discontinuity between symbols and reduce
the intersymbol outofband emissions, you can use the wlanWaveformGenerator
function
to apply OFDM symbol windowing. To apply windowing, set WindowTransitionTime
to
greater than zero.
When windowing is applied, transition regions are added to the
leading and trailing edge of the OFDM symbol by the wlanWaveformGenerator
.
Windowing extends the length of the OFDM symbol by WindowTransitionTime
(T_{TR}).
The extended waveform is windowed by pointwise multiplication in the time domain, using the windowing function specified in IEEE Std 802.112012 [3], Section 18.3.2.5:
$${w}_{\text{T}}(t)=\{\begin{array}{c}{\mathrm{sin}}^{2}\left({\scriptscriptstyle \frac{\pi}{2}}\left(0.5+\frac{t}{{T}_{\text{TR}}}\right)\right)\text{}\left(\raisebox{1ex}{${T}_{\text{TR}}$}\!\left/ \!\raisebox{1ex}{$2$}\right.<t<\raisebox{1ex}{${T}_{\text{TR}}$}\!\left/ \!\raisebox{1ex}{$2$}\right.\right)\\ 1\text{}\left(\raisebox{1ex}{${T}_{\text{TR}}$}\!\left/ \!\raisebox{1ex}{$2$}\right.<t<T\raisebox{1ex}{${T}_{\text{TR}}$}\!\left/ \!\raisebox{1ex}{$2$}\right.\right)\\ {\mathrm{sin}}^{2}\left({\scriptscriptstyle \frac{\pi}{2}}\left(0.5\frac{tT}{{T}_{\text{TR}}}\right)\right)\text{}\left(T\raisebox{1ex}{${T}_{\text{TR}}$}\!\left/ \!\raisebox{1ex}{$2$}\right.<t<T+\raisebox{1ex}{${T}_{\text{TR}}$}\!\left/ \!\raisebox{1ex}{$2$}\right.\right)\end{array}$$
The windowing function applies over the leading and trailing portion of the OFDM symbol:
–T_{TR}/2 to T_{TR}/2
–T – T_{TR}/2 to T + T_{TR}/2
After windowing is applied to each symbol, pointwise addition is used to combine the overlapped regions between consecutive OFDM symbols. Specifically, the trailing shoulder samples at the end of OFDM symbol 1 (T – T_{TR}/2 to T + T_{TR}/2) are added to the leading shoulder samples at the beginning of OFDM symbol 2 (–T_{TR}/2 to T_{TR}/2).
Smoothing the overlap between consecutive OFDM symbols in this
manner reduces the outofband emissions. wlanWaveformGenerator
applies
OFDM symbol windowing between:
Each OFDM symbol within a packet
Consecutive packets within the waveform, considering
the IdleTime
between packets
The last and the first packet of the generated waveform
Windowing DMG Format Packets
For DMG format, windowing is only applicable to packets transmitted using the OFDM PHY and is applied only to the OFDM modulated symbols. For OFDM PHY, only the header and data symbols are OFDM modulated. The preamble (STF and CEF) and the training fields are single carrier modulated and are not windowed. Similar to the out of band emissions experienced by consecutive OFDM symbols, as shown here the CEF and the first training subfield are subject to a nominal amount out of band emissions from the adjacent windowed OFDM symbol.
For more information on how wlanWaveformGenerator
handles
windowing for the consecutive packet IdleTime
and
for the last waveform packet, see Waveform Looping.
To produce a continuous input stream, you can have your code loop on a waveform from the last packet back to the first packet.
Applying windowing to
the last and first OFDM symbols of the generated waveform smooths
the transition between the last and first packet of the waveform.
When WindowTransitionTime
is greater than zero, wlanWaveformGenerator
applies OFDM Symbol Windowing.
When looping a waveform, the last symbol of packet_N is followed by the first OFDM symbol of packet_1. If the waveform has only one packet, the waveform loops from the last OFDM symbol of the packet to the first OFDM symbol of the same packet.
When windowing is applied to the last OFDM symbol of a packet
and the first OFDM of the next packet, the idle time between the packets
factors into the windowing applied. Specify the idle time using the IdleTime
property
of wlanWaveformGenerator
.
If IdleTime
is zero, OFDM Symbol Windowing is applied as it
would be for consecutive OFDM symbols within a packet.
If the IdleTime
is nonzero, the
extended windowed portion of the first OFDM symbol in packet_1 (from
–T_{TR}/2 to 0–T_{S}),
is included at the end of the waveform. This extended windowed portion
is applied for looping when computing the OFDM Symbol Windowing between the last OFDM symbol of packet_N and
the first OFDM symbol of packet_1. T_{S} is
the sample time.
Looping DMG Format Waveforms
For DMG format waveforms there are three looping scenarios,
The looping behavior for a waveform composed of DMG OFDMPHY packets with no training subfields is similar to the general case outlined in Waveform Looping but the first symbol of the waveform (and each packet) is not windowed.
If IdleTime
is zero for the waveform,
the windowed portion (from T to T + T_{TR}/2)
of the last data symbols is added to the start of the STF field.
If IdleTime
is nonzero for the
waveform, the IdleTime
is appended at the end
of the windowed portion (after T + T_{TR}/2)
of the last OFDM symbol.
When a waveform composed of DMG OFDMPHY packets includes training subfields, no windowing is applied to the single carrier modulated symbols the end of the waveform. The last sample of the last training subfield is followed by the first STF sample of the first packet in the waveform.
If IdleTime
is zero for the waveform,
there is no overlap.
If IdleTime
is nonzero for the
waveform, the value specifies the delay between the last sample of packet_N and
the first sample of in packet_1.
When a waveform is composed of DMGSC or DMGControl PHY packets, the end of the waveform is single carrier modulated, so no windowing is applied to the last waveform symbol. The last sample of the last training subfield is followed by the first STF sample of the first packet in the waveform.
If IdleTime
is zero for the waveform,
there is no overlap.
If IdleTime
is nonzero for the
waveform, the value specifies the delay between the last sample of packet_N and
the first sample of in packet_1.
The same looping behavior applies for a waveform composed of DMG OFDMPHY packets with training subfields, DMGSC PHY packets, or DMGControl PHY packets.
The scrambler initialization used on the transmission data follows the process described in IEEE Std 802.112012, Section 18.3.5.5 and IEEE Std 802.11ad2012, Section 21.3.9. The header and data fields that follow the scrambler initialization field (including data padding bits) are scrambled by XORing each bit with a length127 periodic sequence generated by the polynomial S(x) = x^{7}+x^{4}+1. The octets of the PSDU (Physical Layer Service Data Unit) are placed into a bit stream, and within each octet, bit 0 (LSB) is first and bit 7 (MSB) is last. The generation of the sequence and the XOR operation are shown in this figure:
Conversion from integer to bits uses leftMSB orientation. For the
initialization of the scrambler with decimal 1
, the bits are mapped to the
elements shown.
Element  X^{7}  X^{6}  X^{5}  X^{4}  X^{3}  X^{2}  X^{1} 

Bit Value  0  0  0  0  0  0  1 
To generate the bit stream equivalent to a decimal, use de2bi
. For example, for decimal
1
:
de2bi(1,7,'leftmsb') ans = 0 0 0 0 0 0 1
[1] IEEE Std P802.11ax™/D2.0 Draft 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 6: Enhancements for High Efficiency WLAN.
[2] IEEE Std 802.11™2016 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.
[3] IEEE Std 802.11™2012 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.
[4] IEEE Std 802.11ad™2012 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 3: Enhancements for Very High Throughput in the 60 GHz Band.
getPSDULength
 packetFormat
 phyType
 ruInfo
 wlanDMGConfig
 wlanFieldIndices
 wlanHEMUConfig
 wlanHESUConfig
 wlanHTConfig
 wlanNonHTConfig
 wlanS1GConfig
 wlanVHTConfig
^{[1]} IEEE Std 802.112016 Adapted and reprinted with permission from IEEE. Copyright IEEE 2016. All rights reserved.
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
Select web siteYou can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.