Main Content

wlanWaveformGenerator

Generate WLAN waveform

Description

waveform = wlanWaveformGenerator(bits,cfg) generates a waveform for bits, the specified information bits, and cfg, the physical layer (PHY) format configuration. For more information, see IEEE 802.11 PPDU Format.

example

waveform = wlanWaveformGenerator(bits,cfg,Name,Value) specifies additional options using one or more name-value pair arguments.

example

wlanWaveformGenerator opens the WLAN Waveform Generator app.

Examples

collapse all

Create a configuration object for a WLAN EHT TB transmission.

cfgEHTTB = wlanEHTTBConfig;

Get the PSDU length, in bytes, from the configuration object by using the psduLength object function.

length = psduLength(cfgEHTTB);

Generate a PSDU of the relevant length, converting bytes to bits by multiplying by eight.

psdu = randi([0 1],8*length,1);

Generate a time-domain waveform for the bits and configuration, specifying an oversampling factor of 3. Plot the waveform.

waveform = wlanWaveformGenerator(psdu,cfgEHTTB,OversamplingFactor=3);
plot(abs(waveform));
title("EHT TB Waveform");
xlabel("Time (Nanoseconds)");
ylabel("Amplitude");

Figure contains an axes object. The axes object with title EHT TB Waveform, xlabel Time (Nanoseconds), ylabel Amplitude contains an object of type line.

Create a configuration object for a non-OFDMA EHT MU packet. Set the channel bandwidth to 160 MHz, the number of users to two, and the number of transmit antennas to two.

cfgEHTMU = wlanEHTMUConfig("CBW160",NumUsers=2,NumTransmitAntennas=2);

Obtain the PSDU length for both users, in bytes, from the configuration object by using the psduLength object function.

length = psduLength(cfgEHTMU);

Create a two-element cell array containing random PSDUs of the relevant length.

psdu = {randi([0 1],8*length(1),1);randi([0 1],8*length(2),1)};

Generate and plot the waveform.

waveform = wlanWaveformGenerator(psdu,cfgEHTMU);
figure;
plot(abs(waveform));
title('EHT MU Waveform');
xlabel('Time (nanoseconds)');
ylabel('Amplitude');
legend('First transmit antenna','Second transmit antenna')

Figure contains an axes object. The axes object with title EHT MU Waveform, xlabel Time (nanoseconds), ylabel Amplitude contains 2 objects of type line. These objects represent First transmit antenna, Second transmit antenna.

Configure and generate a WLAN waveform containing an HE TB uplink packet.

Create a configuration object for a WLAN HE TB uplink transmission.

cfgHETB = wlanHETBConfig;

Obtain the PSDU length, in bytes, from the configuration object by using the getPSDULength object function.

psduLength = getPSDULength(cfgHETB);

Generate a PSDU of the relevant length.

psdu = randi([0 1],8*psduLength,1);

Generate and plot the waveform.

waveform = wlanWaveformGenerator(psdu,cfgHETB);
figure;
plot(abs(waveform));
title('HE TB Waveform');
xlabel('Time (nanoseconds)');
ylabel('Amplitude');

Figure contains an axes object. The axes object with title HE TB Waveform, xlabel Time (nanoseconds), ylabel Amplitude contains an object of type line.

Generate a time-domain signal for an 802.11ac VHT transmission with one packet.

Create a VHT configuration object. Assign two transmit antennas and two spatial streams, and disable space-time block coding (STBC). Set the modulation and coding scheme 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 A-MPDU pre-EOF padding, APEPLength, to 1024.

cfg = wlanVHTConfig('NumTransmitAntennas',2,'NumSpaceTimeStreams',2,'STBC',0,'MCS',1,'APEPLength',1024);

Generate the transmit waveform.

bits = [1;0;0;1];
txWaveform = wlanWaveformGenerator(bits,cfg);

HE MU-MIMO Configuration With SIGB Compression

Generate a full bandwidth HE MU-MIMO configuration at 20 MHz 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))

Figure contains an axes object. The axes object contains 3 objects of type line.

Generate a full bandwidth HE MU-MIMO waveform at 80 MHz bandwidth with SIGB compression. HE-SIG-B content channel 1 has four users. HE-SIG-B 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));

Figure contains an axes object. The axes object contains 7 objects of type line.

HE MU-MIMO Configuration Without SIGB Compression

Generate a full bandwidth HE MU-MIMO configuration at 20 MHz 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))

Figure contains an axes object. The axes object contains 3 objects of type line.

Generate an 80 MHz HE MU waveform for six users without SIGB compression. HE-SIG-B content channel 1 has four users. HE-SIG-B 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));

Figure contains an axes object. The axes object contains 6 objects of type line.

Generate a full bandwidth HE MU-MIMO waveform at 80 MHz bandwidth without SIGB compression. HE-SIG-B content channel 1 has seven users. HE-SIG-B content channel 2 has zero 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))

Figure contains an axes object. The axes object contains 7 objects of type line.

Generate a time-domain signal for an 802.11ac VHT transmission with five packets and a 30-microsecond idle period between packets. Use a random scrambler initial state for each packet.

Create a VHT configuration object and confirm the channel bandwidth for scaling the x-axis of the plot.

cfg = wlanVHTConfig;
disp(cfg.ChannelBandwidth)
CBW80

Generate and plot the waveform. Display the time in microseconds on the x-axis.

numPkts = 5;
bits = [1;0;0;1];
scramInit = randi([1 127],numPkts,1);
txWaveform = wlanWaveformGenerator(bits,cfg,'NumPackets',numPkts,'IdleTime',30e-6,'ScramblerInitialization',scramInit);
time = [0:length(txWaveform)-1]/80e-6;
plot(time,abs(txWaveform));
title('Five Packets Separated by 30-Microsecond Idle Periods');
xlabel ('Time (microseconds)');
ylabel('Amplitude');

Figure contains an axes object. The axes object with title Five Packets Separated by 30-Microsecond Idle Periods, xlabel Time (microseconds), ylabel Amplitude contains an object of type line.

Input Arguments

collapse all

Information bits, including any MAC padding representing multiple concatenated PSDUs, specified as one of these values.

  • 0 or 1. The specified bit applies to all users.

  • A binary-valued vector. The specified bits apply to all users.

  • A one-by-one cell array containing a binary-valued scalar or vector. The specified bits apply to all users.

  • A vector cell array of binary-valued scalars or vectors. The kth element of the cell array applies to the kth user. The length of the cell array must be equal to the number of users. For each user, if the number of bits required across all packets of the generation exceeds the length of the vector provided, the function loops the applied bit vector. Looping the bits enables you to define a short pattern, for example, [1; 0; 0; 1], that the function repeatedly uses as the input to the PSDU coding across packets and users. In each packet generation, for the kth user, the kth element of the PSDULength property of the cfg input indicates the number of data bytes in its stream. To compute the number of bits, multiply PSDULength by 8.

Internally, the function loops this input to generate the specified number of packets. The PSDULength property of the cfg input specifies the number of data bits taken from the bit stream for each transmission packet generated. The 'NumPackets' input specifies the number of packets to generate.

Example: [1 1 0 1 0 1 1]

Data Types: double | int8

Packet format configuration, specified as one of these objects: wlanEHTMUConfig, wlanEHTTBConfig, wlanHEMUConfig, wlanHESUConfig, wlanHETBConfig, wlanWURConfig, wlanDMGConfig, wlanS1GConfig, wlanVHTConfig, wlanHTConfig, or wlanNonHTConfig. The type of object you specify determines the IEEE® 802.11™ format of the generated waveform.

The properties of the packet format configuration object determine the data rate and PSDU length of generated PPDUs.

Name-Value Arguments

collapse all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: 'NumPackets',21,'ScramblerInitialization',[52,17]

Number of packets to generate in a single function call, specified as a positive integer.

Data Types: double

Idle time, in seconds, added after each packet, specified as a nonnegative scalar. Except for the default value, this input must be greater than or equal to:

  • 1e-6 for DMG format

  • 2e-6 for all other formats

Example: 2e-5

Data Types: double

Oversampling factor, specified as a scalar greater than or equal to 1. The oversampled cyclic prefix length must be an integer number of samples. For more information about oversampling, see FFT-Based Oversampling.

Dependencies

This argument applies only for EHT, HE, WUR, VHT, HT, S1G, and non-HT OFDM formats.

Data Types: double | single | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Initial scrambler state or initial pseudorandom scrambler sequence for each generated packet and each user, specified as one of these values.

  • An integer in the interval [1, 127] — This input represents the initial scrambler state for all packets and users in HE, S1G, VHT, and HT waveforms, and non-HT OFDM waveforms with bandwidth signaling disabled. For multi-user and multipacket waveforms, the function uses the value you specify for all packets and users. The default value, 93, is the example state in Section I.1.5.2 of [1]. For more information, see Scrambler Initialization.

  • An integer in the interval [1, 2047]. This input represents the initial scrambler state for all packets and users in EHT waveforms. For multi-user and multipacket waveforms, the function uses the value you specify for all packets and users.

  • An integer in the interval [min, max] — This input represents the initial pseudorandom scrambler sequence of a non-HT transmission with bandwidth signaling enabled, described in Table 17-7 of [1]. If you do not specify this input, the function uses the NB most significant bits of the default value, 93. The values of min, max, and NB depend on the values of the BandwidthOperation and ChannelBandwidth properties of the cfg input according to this table.

    Value of cfg.BandwidthOperationValue of cfg.ChannelBandwidthValue of minValue of maxValue of NB
    'Absent''CBW20' or 'CBW320'1315
    'CBW5', 'CBW10', 'CBW40', 'CBW80', or 'CBW160'031
    'Static''CBW20' or 'CBW320'1154
    'CBW5', 'CBW10', 'CBW40', 'CBW80', or 'CBW160'015
    'Dynamic' All bandwidths 0154

  • A matrix of integers in the interval [1, 127], of size NP-by-NUsers — Each element represents an initial state of the scrambler for each packet and for each user in VHT, S1G, and HE multi-user (MU) waveforms comprising multiple packets. Each column specifies the initial states for a single user. You can specify up to eight columns for HE MU waveforms, or up to four columns for VHT and S1G. If you specify a single column, the function uses the same initial states for all users. Each row represents the initial state of each packet to generate. 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 function loops the rows internally.

    • NP is the number of packets.

    • NUsers is the number of users.

  • A matrix of integers in the interval [1, 2047], of size NP-by-NUsers — Each element represents an initial state of the scrambler for each packet and for each user in EHT multi-user (MU) waveforms comprising multiple packets. Each column specifies the initial states for a single user. You can specify up to 144 columns for EHT MU waveforms. If you specify a single column, the function uses the same initial states for all users. Each row represents the initial state of each packet to generate. 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 function loops the rows internally.

    • NP is the number of packets.

    • NUsers is the number of users.

For DMG transmissions, specifying this argument overrides the value of the ScramblerInitialization property of the wlanDMGConfig configuration object.

Example: [3 56 120]

Dependencies

This argument is not valid for WUR formats and DSSS non-HT formats.

Data Types: double | int8

Duration, in seconds, of the window transition applied to each OFDM symbol, specified as a nonnegative scalar. The function does not apply windowing if you specify this input as 0. This table shows the default and maximum values permitted for each format, the type of guard interval, and the channel bandwidth.

FormatBandwidthPermitted WindowTransitionTime (seconds)
Default ValueMaximum ValueMaximum Permitted Value Based on Guard Interval Duration
3.2 µs1.6 µs

0.8 µs

(Long)

0.4 µs

(Short)

EHT MU and EHT TB

20, 40, 80, 160, or 320 MHz

1.0e-07

Not applicable

6.4e-06

3.2e-06

1.6e-06

Not applicable

HE SU, HE MU, and HE TB

20, 40, 80, or 160 MHz

1.0e-07

Not applicable

6.4e-06

3.2e-06

1.6e-06

Not applicable

VHT

20, 40, 80, or 160 MHz

1.0e-07

Not applicable

Not applicable

Not applicable

1.6e-06

8.0e-07

HT-mixed

20 or 40 MHz

1.0e-07

Not applicable

Not applicable

Not applicable

1.6e-06

8.0e-07

non-HT

20, 40, 80, or 160 MHz

1.0e-07

Not applicable

Not applicable

Not applicable

1.6e-06

Not applicable

10 MHz

1.0e-07

Not applicable

Not applicable

Not applicable

3.2e-06

Not applicable

5 MHz

1.0e-07

Not applicable

Not applicable

Not applicable

6.4e-06

Not applicable

WUR20, 40, 80 MHz

1.0e-07

Not applicable

Not applicable

Not applicable

Not applicable

Not applicable

DMG

2640 MHz

6.0606e-09

(= 16/2640e6)

9.6969e-08

(= 256/2640e6)

Not applicable

Not applicable

Not applicable

Not applicable

S1G

1, 2, 4, 8, or 16 MHz

1.0e-07

Not applicable

Not applicable

Not applicable

1.6e-05

8.0e-06

Data Types: double

Output Arguments

collapse all

Time-domain waveform, returned as an NS-by-NT matrix. NS is the number of time-domain samples and NT is the number of transmit antennas. waveform contains one or more packets of the same PPDU format. Each packet can contain different information bits. Enable waveform packet windowing by setting the WindowTransitionTime input to a positive value. 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

More About

collapse all

References

[1] IEEE Std 802.11-2020 (Revision of IEEE Std 802.11-2016). “Part 11: Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) Specifications.” IEEE Standard for Information Technology — Telecommunications and Information Exchange between Systems — Local and Metropolitan Area Networks — Specific Requirements.

[2] IEEE Std 802.11ax™-2021 (Amendment to IEEE Std 802.11-2020). “Part 11: Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) Specifications. Amendment 1: Enhancements for High Efficiency WLAN.” IEEE Standard for Information Technology — Telecommunications and Information Exchange between Systems. Local and Metropolitan Area Networks — Specific Requirements.

Extended Capabilities

expand all

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced in R2015b

expand all