# 802.11be Waveform Generation

This example shows how to parameterize and generate IEEE® 802.11be™ extremely high throughput (EHT) multi-user waveforms.

### Introduction

#### 802.11be

The physical layer of 802.11be (Wi-Fi 7) [1] is an extension of 802.11ax (Wi-Fi 6) [2], focusing on WLAN indoor and outdoor operation with a maximum throughput of 30 Gbps [1]. EHT devices coexist with legacy 802.11-compliant devices operating in the 2.4 GHz, 5 GHz, and 6 GHz unlicensed spectra. The standard introduces these key new features in the EHT format [1].

• 320 MHz channel bandwidth

• Multiple Resource Units (MRUs) per stations (STAs)

• 4096-QAM

• Non-OFDMA preamble puncturing

IEEE P802.11be/D2.0 [1] specifies two packet formats.

• EHT multi-user (EHT MU)

• EHT trigger-based (EHT TB)

The EHT MU packet can be configured for OFDMA transmission, non-OFDMA transmission, or a combination of the two. With this flexibility, an EHT MU packet can transmit to a single user over the whole band, multiple users over different parts of the band (OFDMA), or multiple users over the same part of the band (MU-MIMO). This example shows how to generate an EHT MU packet for each of these different waveforms and demonstrates some of the key features of the draft standard [1].

The EHT TB packet allows for OFDMA or MU-MIMO transmission in the uplink. The access point (AP) controls EHT TB transmissions. A trigger frame sent to all STAs participating in the transmission contains all the parameters required for the transmission. Each STA transmits an EHT TB packet simultaneously when triggered by the AP. This example shows how to generate an EHT TB transmission in response to a trigger frame for four users in an OFDMA/MU-MIMO transmission.

#### Subcarriers and Resource Allocation

As in HE transmissions, the channel bandwidth of an EHT transmission is divided into RUs. An RU is a group of subcarriers assigned to one or more users. An RU is defined by the size (the number of subcarriers) and an index. The RU index specifies the location of the RU within the channel. For example, an 80 MHz transmission contains four possible 242-tone RUs, one in each 20 MHz subchannel. RU# 242-1 (size 242, index 1) is the RU occupying the lowest absolute frequency within the 80 MHz, and RU# 242-4 (size 242, index 4) is the RU occupying the highest absolute frequency. The draft standard defines possible sizes and locations of RUs in section 36.3.2 of [1].

In EHT, the RU sizes in tones are 26, 52, 106, 242, 484, 996, 2x996, or 4x996, where 242, 484, 996, 2x996, and 4x996 correspond to the entire 20 MHz, 40 MHz, 80 MHz, 160 MHz, and 320 MHz channel bandwidth, respectively. An EHT AP can assign 26-, 52-, or 106-tone RUs to a single user, or 242-, 484-, 996-, 2x996-, or 4x996-tone RUs to a single user or multiple users in MU-MIMO configuration.

Unlike in HE, more than one RU can be assigned to a STA. RUs can be aggregated to form an MRU. RUs are classified as small-size RUs or large-size RUs.

Small-size RUs are 26-, 52-, and 106-tone RUs. Small-size RUs can only be combined with other small-size RUs to form a small-size MRU. Small-size MRUs are used for both uplink and downlink transmission in OFDMA format. These combinations of small-size MRUs can be assigned to a single STA:

• 52+26-tone MRU

• 106+26-tone MRU

Large-size RUs are 242-, 484-, 996-, 2x996-, and 4x996-tone RUs. Large-size RUs can only be combined with other large-size RUs to form a large-size MRU. The large-size MRUs are defined for both uplink and downlink transmission in non-OFDMA and OFDMA format. These combinations of large-size MRUs can be assigned to a STA as defined in section 36.3.2.2.3 of [1]:

• 484+242-tone MRU

• 996+484-tone MRU

• 996+484+242-tone MRU (can only be assigned to non-OFDMA STAs)

• 2x996+484-tone MRU

• 3x996-tone MRU (2x996 + 996 tones)

• 3x996+484-tone MRU (2x996 + 996 + 484 tones)

The index and size of an MRU is the combined indices and sizes of the RUs that form it. For example, take a 20 MHz transmission that contains a 106+26-tone RU and a 106-tone RU. RU# 106+26 (size 106 and 26, index 1 and 5) is an MRU occupying the lowest absolute frequency within the 20 MHz, and RU# 106 (size 106, index 2) is the RU occupying the highest absolute frequency. The draft standard defines possible sizes and locations of RUs in section 36.3.2 of [1]. See also Appendix A.

### EHT Multi-User (EHT MU) Non-OFDMA Packet Format

A full-band non-OFDMA packet is an EHT MU packet that contains the transmission of a single user or multiple users in an MU-MIMO configuration over the full channel bandwidth.

#### Single-User Packet Generation

An EHT MU single-user (SU) packet is a full-band, non-OFDMA transmission to a single user. Use EHT MU configuration object `wlanEHTMUConfig` to configure the transmission parameters of a full-band EHT MU packet for a single user. Create a full-band 320 MHz single-user MIMO configuration and set the transmission parameters of the user.

```cfgSU = wlanEHTMUConfig('CBW320'); numTx = 2; % Number of transmit antennas cfgSU.NumTransmitAntennas = numTx; cfgSU.User{1}.APEPLength = 8000; % A-MPDU length pre-EOF padding, in bytes cfgSU.User{1}.MCS = 12; % Modulation and coding scheme cfgSU.User{1}.NumSpaceTimeStreams = numTx;```

Get the required PSDU length for the specified transmission configuration and create a random PSDU of this length for transmission.

`psdu = randi([0 1],psduLength(cfgSU)*8,1,'int8');`

Generate the EHT MU single-user packet by using the `wlanWaveformGenerator` function.

`tx = wlanWaveformGenerator(psdu,cfgSU); %#ok<*NASGU> % Create packet`

#### MU-MIMO Packet Generation

Configure transmission parameters for a full-band non-OFDMA EHT MU packet for multiple users by using the EHT MU configuration object. Use the `NumUsers` property of `wlanEHTMUConfig` object to specify the number of users in an MU-MIMO configuration.

Create a 20 MHz (MU-MIMO) EHT MU configuration for two users and set parameters common to all users.

```numTx = 2; % Set common transmission parameters for all users cfgMUMIMO = wlanEHTMUConfig('CBW20','NumUsers',2); cfgMUMIMO.NumTransmitAntennas = numTx; cfgMUMIMO.GuardInterval = 3.2; cfgMUMIMO.EHTLTFType = 4;```

The `ruInfo` object function provides details of the RUs in the configuration. In this case a single RU contains two users.

```allocInfo = ruInfo(cfgMUMIMO); disp('Allocation info:')```
```Allocation info: ```
`disp(allocInfo)`
``` NumUsers: 2 NumRUs: 1 RUIndices: {[1]} RUSizes: {[242]} NumUsersPerRU: 2 NumSpaceTimeStreamsPerRU: 2 PowerBoostFactorPerRU: 1 RUNumbers: 1 ```

The properties of `cfgMUMIMO` describe the transmission configuration. The `cfgMUMIMO.RU` and `cfgMUMIMO.User` properties of `cfgMUMIMO` are cell arrays. Each element of the cell arrays contains an object which configures an RU or a user. When you create the `cfgMUMIMO` object, the elements of `cfgMUMIMO.RU` and `cfgMUMIMO.User` create the desired number of RUs and users. Each element of `cfgMUMIMO.RU` is a `wlanEHTRU` object describing the configuration of an RU. Similarly, each element of `cfgMU.User` is a `wlanEHTUser` object describing the configuration of a user. This figure shows the object hierarchy.

This example creates a single RU in non-OFDMA format for a channel bandwidth of 20 MHz, so `cfgMUMIMO.RU` is a cell array with one element. The index and size of each RU are configured according to the channel bandwidth specified when `cfgMUMIMO` was created.

`disp('RU configuration:')`
```RU configuration: ```
`disp(cfgMUMIMO.RU{1})`
``` wlanEHTRU with properties: PowerBoostFactor: 1 SpatialMapping: direct Read-only properties: Size: 242 Index: 1 UserNumbers: [1 2] ```

After creating the object, you can configure each RU to create the desired transmission configuration by setting the properties of the appropriate RU object. For example, the spatial mapping and power boost factor can be configured per RU.

Create a random spatial mapping array and configure RU index 1.

```ruIndex = 1; ofdmInfo = wlanEHTOFDMInfo('EHT-Data',cfgMUMIMO,ruIndex); numST = ofdmInfo.NumTones; % Number of occupied subcarriers numSTS = allocInfo.NumSpaceTimeStreamsPerRU(ruIndex); cfgMUMIMO.RU{ruIndex}.SpatialMapping = 'Custom'; cfgMUMIMO.RU{ruIndex}.SpatialMappingMatrix = rand(numST,numSTS,numTx);```

In this section, the `NumUsers` property specifies two users in the transmission, so `cfgMUMIMO.User` contains two elements. The transmission properties of users can be configured by modifying individual user objects, for example the modulation and coding scheme (MCS), APEP length, and channel coding scheme.

Set transmission properties of user 1.

```cfgMUMIMO.User{1}.APEPLength = 500; % A-MPDU length pre-EOF padding in bytes cfgMUMIMO.User{1}.MCS = 12; cfgMUMIMO.User{1}.ChannelCoding = 'LDPC'; cfgMUMIMO.User{1}.NumSpaceTimeStreams = 1;```

Set transmission properties of user 2.

```cfgMUMIMO.User{2}.APEPLength = 700; % A-MPDU length pre-EOF padding in bytes cfgMUMIMO.User{2}.MCS = 7; cfgMUMIMO.User{2}.ChannelCoding = 'BCC'; cfgMUMIMO.User{2}.NumSpaceTimeStreams = 1;```

The read-only `RUNumber` property indicates which RU is used to transmit this user.

`disp('First user configuration:')`
```First user configuration: ```
`disp(cfgMUMIMO.User{1})`
``` wlanEHTUser with properties: APEPLength: 500 MCS: 12 NumSpaceTimeStreams: 1 ChannelCoding: ldpc STAID: 0 NominalPacketPadding: 0 PostFECPaddingSource: mt19937arwithseed PostFECPaddingSeed: 1 Read-only properties: RUNumber: 1 ```

In this example the non-OFDMA configuration consists of a single RU and two users. The `UserNumbers` property of an RU object indicates which users (elements of the `cfgMUMIMO.User` cell array) are transmitted on that RU. Similarly, the `RUNumber` property of each `User` object indicates which RU (element of the `cfgMUMIMO.RU` cell array) is used to transmit the user. For more information, see the 802.11ax Waveform Generation example.

The `showAllocation` object function visualizes the occupied RUs or MRUs and subcarriers for the specified configuration. The colored blocks illustrate the occupied subcarriers in the pre-EHT and EHT portions of the packet. White indicates unoccupied subcarriers. The pre-EHT portion illustrates the occupied subcarriers in the fields preceding the EHT-STF. The EHT portion illustrates the occupied subcarriers in the EHT-STF, EHT-LTF, and EHT-Data field and therefore shows the RU/MRU allocation. To display information about an RU or MRU, click on the RU or MRU. The RU number corresponds to the $i$th `RU` element of the `cfgMUMIMO.RU` property. The `showAllocation` object function also shows the size of each RU or MRU, and the users assigned to each. The user number corresponds to the $i$th `User` element of the `cfgMUMIMO`.

`showAllocation(cfgMUMIMO);`

To generate a non-OFDMA EHT MU waveform, create a random PSDU for each user. Use a cell array to store the PSDU for each user as the PSDU lengths differ. The `psduLength` object function returns a vector with the required PSDU per user for the specified configuration.

```psduLen = psduLength(cfgMUMIMO); psdu = cell(1,allocInfo.NumUsers); for i = 1:allocInfo.NumUsers psdu{i} = randi([0 1],psduLen(i)*8,1,'int8'); end```

Generate a 20 MHz non-OFDMA (MU-MIMO) packet with two users.

`tx = wlanWaveformGenerator(psdu,cfgMUMIMO);`

#### EHT DUP Mode Packet Generation

An EHT DUP mode transmission is a non-OFDMA transmission to a single user where the data payload is duplicated in frequency. EHT DUP mode is only applicable for 80 MHz, 160 MHz, and 320 MHz transmissions. Configure the transmission of an EHT DUP using the EHT MU configuration object by setting the `EHTDUPMode` property of `wlanEHTMUConfig` to true. Create a 320 MHz EHT DUP mode configuration and set the transmission parameters of the user. Note the MCS of the user is automatically set to 14.

```cfgDUPMode = wlanEHTMUConfig('CBW320','EHTDUPMode',true); cfgDUPMode.User{1}.APEPLength = 200; disp(cfgDUPMode.User{1}.MCS)```
``` 14 ```

Get the required PSDU length for the specified transmission configuration and create a random PSDU of this length for transmission.

`psdu = randi([0 1],psduLength(cfgDUPMode)*8,1,'int8');`

Generate the EHT DUP mode packet by using the `wlanWaveformGenerator` function.

`tx = wlanWaveformGenerator(psdu,cfgDUPMode); %#ok<*NASGU> % Create packet`

#### Punctured Packet Generation with Large MRUs

The draft standard allows for punctured 20 MHz subchannels in a non-OFDMA or OFDMA 80 MHz, 160 MHz, or 320 MHz transmission to allow a legacy system to operate in the punctured subchannel. The preamble portion of the punctured 20 MHz subchannel is not transmitted and the corresponding RU is not allocated to any user (no data transmitted). This method is also described as channel bonding.

In a non-OFDMA format, large-size MRUs are obtained by puncturing any one of the 242-, 484-, or 996-tone RUs within an 80 MHz, 160 MHz, or 320 MHz channel bandwidth. As an example, a 996+484+242-tone MRU is obtained by puncturing any one of eight 242-tone RUs in the 160 MHz channel, see section 36.3.12.11.3 of [1]. The preamble is not transmitted in the punctured subchannel within a large MRU and the corresponding RU is not allocated to any user. The non-OFDMA packet format supports single-user and MU-MIMO packet transmission in large MRUs. The EHT-USIG field of an EHT MU packet carries the punctured sub-channel indication for a non-OFDMA transmission.

Use the EHT MU configuration object to configure the non-OFDMA transmission properties of an EHT MU packet transmission on a large MRU. Appendix B lists possible puncturing patterns for 80 MHz, 160 MHz, and 320 MHz channel bandwidths and the corresponding value of the `PuncturedChannelFieldValue` property when creating the `wlanEHTMUConfig` object.

Create a configuration for a 160 MHz EHT MU packet transmission on a large 996+484+242-tone MRU. Puncture the second 20 MHz subchannel in a 160 MHz channel as shown in Appendix B by setting the `PuncturedChannelFieldValue` property to `2`.

```cfgPunc = wlanEHTMUConfig('CBW160','PuncturedChannelFieldValue',2); tx = wlanWaveformGenerator([1 0 1 0],cfgPunc);```

View the punctured RU allocation.

`showAllocation(cfgPunc);`

Create a configuration for two users in MU-MIMO configuration in a 320 MHz channel. The EHT MU packet transmission is on a large 3x996+484-tone MRU, see section 36.3.2.2.3 of [1]. Create the `wlanEHTMUConfig` object, setting the `PuncturedChannelFieldValue` property to `3` to puncture the third 40 MHz subchannel in a 320 MHz channel as shown in Appendix B.

```cfg = wlanEHTMUConfig('CBW320','NumUsers',2,'PuncturedChannelFieldValue',3); cfg.NumTransmitAntennas = 8;```

Set transmission properties of user 1.

```cfg.User{1}.NumSpaceTimeStreams = 4; cfg.User{1}.APEPLength = 500000; cfg.User{1}.MCS = 12;```

Set transmission properties of user 2.

```cfg.User{2}.NumSpaceTimeStreams = 4; cfg.User{2}.APEPLength = 400000; cfg.User{2}.MCS = 13;```

View the punctured RU allocation.

`showAllocation(cfg);`

Create a random PSDU for each user. Use a cell array to store the PSDU for each user as the PSDU lengths differ. The `psduLength` object function returns a vector with the required PSDU per user for the specified configuration.

```psduLen = psduLength(cfg); allocInfo = ruInfo(cfg); % Get allocation information psdu = cell(1,allocInfo.NumUsers); for i=1:allocInfo.NumUsers psdu{i} = randi([0 1],psduLen(i)*8,1); end```

Create an oversampled waveform using the `wlanWaveformGenerator` function. This function generates an oversampled waveform by using a larger inverse fast Fourier transform (IFFT) size than required for the nominal baseband rate.

```osf = 1.5; tx = wlanWaveformGenerator(psdu,cfg,'OversamplingFactor',osf);```

Generate the spectrum and spectrogram of the generated signal. The spectrogram shows the punctured 40 MHz subchannel in the 320 MHz channel.

`sa = plotSpectrumAndSpectrogram(tx,cfg,osf,'3x996+484-tone MRU with punctured 40 MHz subchannel in 320 MHz channel');`

### EHT Multi-User (EHT MU) OFDMA Packet Format

The allocation index defines the assignment of RUs/MRUs in an OFDMA transmission. Appendix A lists the allocation indices for all RU/MRU assignments. For each 20 MHz subchannel, a 9-bit index describes the number and size of RUs/MRUs and the number of users transmitted on each RU/MRU. The length of allocation Index must be 1, 2, 4, 8, or 16 to define the assignment for each 20 MHz subchannel in a 20 MHz, 40 MHz, 80 MHz, 160 MHz, or 320 MHz channel bandwidth, respectively. The allocation index also determines which content channel the EHT-SIG field uses to signal a user.

#### Small MRU Packet Generation

Configure transmission parameters for an EHT MU packet format in a OFDMA configuration with an EHT MU configuration object. Create an OFDMA configuration for a 20 MHz EHT MU packet with two 52-tone RUs, one 106+26-tone MRU, and one user per RU, as defined by allocation index 47.

`cfgOFDMA = wlanEHTMUConfig(47);`

Visualize the RU allocation with the `showAllocation` object function.

`showAllocation(cfgOFDMA)`

The `ruInfo` object function provides details of the RUs in the configuration. You can see three RUs with a user in each RU.

```allocInfo = ruInfo(cfgOFDMA); disp('Allocation info:')```
```Allocation info: ```
`disp(allocInfo)`
``` NumUsers: 3 NumRUs: 3 RUIndices: {[1 5] [3] [4]} RUSizes: {[106 26] [52] [52]} NumUsersPerRU: [1 1 1] NumSpaceTimeStreamsPerRU: [1 1 1] PowerBoostFactorPerRU: [1 1 1] RUNumbers: [1 2 3] ```

Set common transmission parameters for all users.

```numTx = 3; cfgOFDMA.NumTransmitAntennas = numTx; cfgOFDMA.EHTLTFType = 2; cfgOFDMA.GuardInterval = 1.6```
```cfgOFDMA = wlanEHTMUConfig with properties: RU: {[1x1 wlanEHTRU] [1x1 wlanEHTRU] [1x1 wlanEHTRU]} User: {[1x1 wlanEHTUser] [1x1 wlanEHTUser] [1x1 wlanEHTUser]} NumTransmitAntennas: 3 GuardInterval: 1.6000 EHTLTFType: 2 NumExtraEHTLTFSymbols: 0 EHTSIGMCS: 0 UplinkIndication: 0 BSSColor: 0 SpatialReuse: 0 TXOPDuration: [] Read-only properties: ChannelBandwidth: 'CBW20' AllocationIndex: 47 ```

Configure RU 1 and user 1.

```cfgOFDMA.RU{1}.SpatialMapping = 'Direct'; cfgOFDMA.User{1}.APEPLength = 1e3; cfgOFDMA.User{1}.MCS = 12; cfgOFDMA.User{1}.NumSpaceTimeStreams = numTx; cfgOFDMA.User{1}.ChannelCoding = 'LDPC';```

Configure RU 2 and user 2.

```cfgOFDMA.RU{2}.SpatialMapping = 'Fourier'; cfgOFDMA.User{2}.APEPLength = 500; cfgOFDMA.User{2}.MCS = 5; cfgOFDMA.User{2}.NumSpaceTimeStreams = 2; cfgOFDMA.User{2}.ChannelCoding = 'LDPC';```

Configure RU 3 and user 3.

```cfgOFDMA.RU{3}.SpatialMapping = 'Fourier'; cfgOFDMA.User{3}.APEPLength = 100; cfgOFDMA.User{3}.MCS = 4; cfgOFDMA.User{3}.NumSpaceTimeStreams = 1; cfgOFDMA.User{3}.ChannelCoding = 'BCC';```

Allocation index 47 specifies three RUs and three users, therefore `cfgOFDMA.RU` and `cfgOFDMA.User` are both cell arrays with three elements. This figure shows the object hierarchy.

The `Size` and `Index` properties of `cfgOFDMA.RU{1}` show the size and index of the RUs making up the 106+26-tone MRU.

`disp('First RU configuration:')`
```First RU configuration: ```
`disp(cfgOFDMA.RU{1})`
``` wlanEHTRU with properties: PowerBoostFactor: 1 SpatialMapping: direct Read-only properties: Size: [106 26] Index: [1 5] UserNumbers: 1 ```

Configure the transmission properties of users by modifying individual user object properties. The read-only `RUNumber` property indicates which RU is used to transmit this user.

`disp('First user configuration:')`
```First user configuration: ```
`disp(cfgOFDMA.User{1})`
``` wlanEHTUser with properties: APEPLength: 1000 MCS: 12 NumSpaceTimeStreams: 3 ChannelCoding: ldpc STAID: 0 NominalPacketPadding: 0 PostFECPaddingSource: mt19937arwithseed PostFECPaddingSeed: 1 Read-only properties: RUNumber: 1 ```

The `UserNumbers` property of an `RU` object indicates which users (elements of the `cfgOFDMA.Use`r cell array) are transmitted on that RU. Similarly, the `RUNumber` property of each `User` object, indicates which RU (element of the `cfgMUMIMO.RU` cell array) is used to transmit the user. For more information see the 802.11ax Waveform Generation example.

To generate an EHT MU waveform, create a random PSDU for each user. Store the PSDU for each user in a cell array as the PSDU lengths differ. The `psduLength` object function returns a vector with the required PSDU per user given the configuration.

```psduLen = psduLength(cfgOFDMA); psdu = cell(1,allocInfo.NumUsers); for i=1:allocInfo.NumUsers psdu{i} = randi([0 1],psduLen(i)*8,1); end```

Generate the waveform.

`tx = wlanWaveformGenerator(psdu,cfgOFDMA);`

#### Large MRU Packet Generation

An EHT MU transmission with a channel bandwidth greater than 20 MHz uses two content channels to signal the common and user configuration information. These content channels are duplicated over each 40 MHz subchannel within an 80 MHz segment. When an OFDMA system contains an RU with size greater than 242, the users assigned to the RU can be signaled on either of the two EHT SIG content channels as defined in section 36.3.12.8 of [1].

As an example, consider this 160 MHz configuration, which serves ten users with three RUs including a 996-[ ]-484 MRU:

• A large 996+484-tone MRU (RU #1) with eight users (user #1-8)

• A 242-tone RU (RU #2) with one user (user #9)

• A 242-tone RU (RU #3) with one user (user #10)

Configure a 160 MHz OFDMA transmission with eight allocation indices, one for each 20 MHz subchannel. To configure the example scenario, use these allocation indices.

`[X1 X2 X3 X4 64 64 X5 X6]`

• `X1 to X6 `configure the 996+484-tone MRU, with users #1-8.

• Allocation index 64 configures a 242-tone RU with one user.

The selection of `X1` to `X6` configures the appropriate number of users through an allocation index in the 20 MHz subchannel and determines which EHT-SIG content channel signals the users on the 996+484-tone RU. A 996+484-tone RU spans six 20 MHz subchannels. The two 242-tone RUs each indicated by allocation index 64 span two 20 MHz subchannels within MRU 996-[ ]-484. The 996+484-tone MRU requires six allocation indices indicated by `X1` to `X6`. The ten users can be signaled on two EHT-SIG content channels in different combinations. Table 1 shows seven of the numerous possible combinations.

An allocation index within the range 144-151 specifies 1-8 users on a 996+484-tone MRU. To signal no users on a content channel, use allocation index 29 or 30 when the 20 MHz subchannel corresponding to the index overlaps with a 448-tone or 996-tone RU, respectively. Therefore, the combinations in Table 1 require eight allocation indices as shown in Table 2. Other than allocation index 64, the remaining six allocation indices in each row of Table 2 are `X1` to `X6`. Table 2 shows the number of users on each content channel in the two 80 MHz segments for various combinations of RU allocation index.

To configure 'Combination C', use the allocation indices `[145 145 145 145 64 64 29 29]`.

Configure the transmission parameters for an EHT MU packet format for the OFDMA configuration with an EHT MU configuration object.

```cfgLMRU = wlanEHTMUConfig([145 145 145 145 64 64 29 29]); % 1 MRU (996+484) with 8 users and two 242-tone RUs with one user each cfgLMRU.NumTransmitAntennas = 8;```

Set transmission parameters of the users.

```userSTS = [1 1 1 1 1 1 1 1 8 8]; % Number of space time streams per user allocInfo = ruInfo(cfgLMRU); % Get details of the RU/MRU in the configuration for u=1:allocInfo.NumUsers cfgLMRU.User{u}.NumSpaceTimeStreams = userSTS(u); cfgLMRU.User{u}.MCS = 12; cfgLMRU.User{u}.APEPLength = randi([100 500],1,1); end```

Create packet with a repeated bit sequence as the PSDU.

`tx = wlanWaveformGenerator([1 0 1 0],cfgLMRU);`

Visualize the RU allocation.

`showAllocation(cfgLMRU)`

#### Preamble Puncturing

Create a configuration for an OFDMA 160 MHz transmission with punctured subchannels. Use the 20 MHz subchannel allocation index 26 to puncture a 20 MHz subchannel. Puncture the second 20 MHz subchannel in the lower 80 MHz segment. Puncture the second and third 20 MHz subchannels in the upper 80 MHz segment.

```cfgPuncture = wlanEHTMUConfig([64 26 64 64 64 26 26 64]); for u=1:numel(cfgPuncture.User) cfgPuncture.User{u}.APEPLength = 1000; end```

Generate on oversampled waveform using a larger IFFT size than required for the nominal baseband rate.

```osf = 1.5; txPuncture = wlanWaveformGenerator([1 0 1 0],cfgPuncture,'OversamplingFactor',osf);```

View the punctured 20 MHz subchannels in the generated waveform by using the spectrum analyzer.

`sa = plotSpectrumAndSpectrogram(txPuncture,cfgPuncture,osf,'160 MHz EHT MU Transmission with Punctured 20 MHz Channels');`

#### Unassigned RUs

The draft standard allows for RUs to be unassigned (no data transmitted) without the preamble portion of the corresponding 20 MHz being punctured. The standard specifies two methods for creating unassigned RUs: using an unassigned 242-tone allocation index, or signaling a user with STA-ID 2046.

Unassigned 242-tone Allocation Index

Configure a 160 MHz transmission with no data transmission in a 20 MHz subchannel without preamble puncturing by using allocation index 27.

```cfgUnassigned = wlanEHTMUConfig([64 27 64 64]); for u=1:numel(cfgUnassigned.User) cfgUnassigned.User{u}.APEPLength = 1000; end```

Visualize the RU allocation, which shows that the preamble is not punctured.

`showAllocation(cfgUnassigned);`

Generate an oversampled waveform and view the spectrogram. The preamble is visible in all 20 MHz subchannels at the start of the waveform.

```osf = 1.5; tx = wlanWaveformGenerator([1 0 0 1],cfgUnassigned,'OversamplingFactor',osf); sa = plotSpectrumAndSpectrogram(tx,cfgUnassigned,osf,'160 MHz EHT MU Transmission with Unassigned 20 MHz Channel');```

Signal User with STA-ID 2046

The draft standard states an RU is unassigned (no data transmitted) if the STA-ID of the EHT-SIG User field is 2046.

Create a 20 MHz OFDMA configuration with four RUs with a user in each RU using allocation index 52

`cfgUnassigned = wlanEHTMUConfig(52);`

Visualize the RU allocation.

`showAllocation(cfgUnassigned)`

Set the `STAID` property of the third user to 2046 so the 52+26-tone MRU is unassigned.

`cfgUnassigned.User{3}.STAID = 2046; % No data transmitted to 3rd user on MRU 52+26`

Visualize the RU allocation, which shows that the third RU is now unassigned but the preamble is not punctured.

`showAllocation(cfgUnassigned)`

View details of the active RUs in the configuration by using the `ruInfo` object function. This shows three users and three RUs as one user and RU is unassigned.

```allocInfo = ruInfo(cfgUnassigned); disp('Allocation info:')```
```Allocation info: ```
`disp(allocInfo)`
``` NumUsers: 4 NumRUs: 3 RUIndices: {[1] [5] [9]} RUSizes: {[106] [26] [26]} NumUsersPerRU: [1 1 1] NumSpaceTimeStreamsPerRU: [1 1 1] PowerBoostFactorPerRU: [1 1 1] RUNumbers: [1 2 4] ```

### EHT Trigger-Based (EHT TB) Packet Format

The EHT trigger-based (TB) format allows for OFDMA or MU-MIMO transmission in the uplink. Each station (STA) transmits a TB packet simultaneously, when triggered by the access point (AP). An AP controls the TB transmission and provides the parameters to all STAs participating in the TB transmission through a trigger frame. This example shows a TB transmission in response to a trigger frame for four users in an OFDMA/MU-MIMO system. All four STAs will transmit simultaneously to an AP.

The 80 MHz allocation range 104 to 111 corresponds to a large size MRU in a OFDMA/MU-MIMO configuration. As an example, the allocation 104 and 50 corresponds to three RU/MRUs, where:

• A 242-[]-484-tone large size MRU (RU #1) has two users (user #1-2)

• A 106-tone RU (RU #2) has one user (user #3)

• A 106+26-tone small size MRU (RU #3) has one user (user #4)

Use a `wlanEHTMUConfig` object to obtain the allocation information.

```% Generate an OFDMA/MU-MIMO allocation cfgMU = wlanEHTMUConfig([104 50 104 29]); allocationInfo = ruInfo(cfgMU);```

In a TB transmission several parameters are the same for all users in the transmission. Some of these are specified below:

```% These parameters are the same for all users in a TB transmission channelBandwidth = cfgMU.ChannelBandwidth; % Bandwidth of TB waveform lsigLength = 286; % L-SIG length preFECPaddingFactor = 1; % Pre-FEC padding factor numEHTLTFSymbols = 2; % Number of EHT-LTF symbols ldpcExtraSymbol = true; % LDPC extra symbol```

Use a `wlanEHTTBConfig` object to configure a TB transmission for a single user within the system. In this example, an array of four objects is created to describe the transmission of four users.

```% Create a trigger configuration for each user numUsers = allocationInfo.NumUsers; cfgTriggerUser = repmat(wlanEHTTBConfig,1,numUsers);```

The non-default system-wide properties are set for each user.

```for userIdx = 1:numUsers cfgTriggerUser(userIdx).ChannelBandwidth = channelBandwidth; cfgTriggerUser(userIdx).LSIGLength = lsigLength; cfgTriggerUser(userIdx).PreFECPaddingFactor = preFECPaddingFactor; cfgTriggerUser(userIdx).NumEHTLTFSymbols = numEHTLTFSymbols; end```

Next set the per-user properties. When multiple users are transmitting in the same RU, in an MU-MIMO configuration, each user must transmit on different space-time stream indices. Set properties `StartingSpaceTimeStream` and `NumSpaceTimeStreamSteams` for each user. In this example user 1 and 2 are in an MU-MIMO configuration, therefore `StartingSpaceTimeStream` for user two is set to `2`, as user one transmit on a single space-time stream with `StartingSpaceTimeStream = 1`.

```% These parameters are for the first user - Large MRU, MU-MIMO user 1 cfgTriggerUser(1).RUSize = allocationInfo.RUSizes{1}; cfgTriggerUser(1).RUIndex = allocationInfo.RUIndices{1}; cfgTriggerUser(1).MCS = 4; % Modulation and coding scheme cfgTriggerUser(1).NumTransmitAntennas = 2; % Number of transmit antennas cfgTriggerUser(1).NumSpaceTimeStreams = 1; % Number of space-time streams cfgTriggerUser(1).StartingSpaceTimeStream = 1; % The starting index of the space-time streams cfgTriggerUser(1).ChannelCoding = 'ldpc'; % Channel coding cfgTriggerUser(1).LDPCExtraSymbol = ldpcExtraSymbol; % LDPC extra symbols cfgTriggerUser(1).SpatialMapping = 'fourier'; % Spatial mapping % These parameters are for the second user - Large MRU, MU-MIMO user 2 cfgTriggerUser(2).RUSize = allocationInfo.RUSizes{1}; cfgTriggerUser(2).RUIndex = allocationInfo.RUIndices{1}; cfgTriggerUser(2).MCS = 2; % Modulation and coding scheme cfgTriggerUser(2).NumTransmitAntennas = 2; % Number of transmit antennas cfgTriggerUser(2).NumSpaceTimeStreams = 1; % Number of space-time streams cfgTriggerUser(2).StartingSpaceTimeStream = 2; % The starting index of the space-time streams cfgTriggerUser(2).ChannelCoding = 'ldpc'; % Channel coding cfgTriggerUser(2).LDPCExtraSymbol = ldpcExtraSymbol; % LDPC extra symbols cfgTriggerUser(2).SpatialMapping = 'fourier'; % Spatial mapping % These parameters are for the third user - RU#2 cfgTriggerUser(3).RUSize = allocationInfo.RUSizes{2}; cfgTriggerUser(3).RUIndex = allocationInfo.RUIndices{2}; cfgTriggerUser(3).MCS = 3; % Modulation and coding scheme cfgTriggerUser(3).NumTransmitAntennas = 2; % Number of transmit antennas cfgTriggerUser(3).NumSpaceTimeStreams = 1; % Number of space-time streams cfgTriggerUser(3).ChannelCoding = 'bcc'; % Channel coding cfgTriggerUser(3).SpatialMapping = 'fourier'; % Spatial mapping % These parameters are for the fourth user - Small MRU cfgTriggerUser(4).RUSize = allocationInfo.RUSizes{3}; cfgTriggerUser(4).RUIndex = allocationInfo.RUIndices{3}; cfgTriggerUser(4).MCS = 1; % Modulation and coding scheme cfgTriggerUser(4).NumTransmitAntennas = 2; % Number of transmit antennas cfgTriggerUser(4).NumSpaceTimeStreams = 1; % Number of space-time streams cfgTriggerUser(4).ChannelCoding = 'ldpc'; % Channel coding cfgTriggerUser(4).LDPCExtraSymbol = ldpcExtraSymbol; % LDPC extra symbols cfgTriggerUser(4).SpatialMapping = 'fourier'; % Spatial mapping```

A packet containing random data is now transmitted by each user with `wlanWaveformGenerator`. The waveform transmitted by each user is stored for analysis.

```osf = 1.5; % Over sampling factor trigInd = wlanFieldIndices(cfgTriggerUser(1),'OversamplingFactor',osf); % Get the indices of each field txTrigStore = zeros(trigInd.EHTData(2),numUsers); for userIdx = 1:numUsers % Generate waveform for a user cfgTrigger =cfgTriggerUser(userIdx); txPSDU = randi([0 1],psduLength(cfgTrigger)*8,1); txTrig = wlanWaveformGenerator(txPSDU,cfgTrigger,'OversamplingFactor',osf); % Store the transmitted STA waveform for analysis txTrigStore(:,userIdx) = sum(txTrig,2); end```

The spectrum of the transmitted oversampled waveform from each STA shows the different portions of the spectrum used, and the overlap in the MU-MIMO RU.

```fs = wlanSampleRate(cfgTriggerUser(1)); ofdmInfo = wlanEHTOFDMInfo('EHT-Data',cfgTriggerUser(1)); rbw = fs/ofdmInfo.FFTLength; % Resolution bandwidth spectrumScope = spectrumAnalyzer(SampleRate=fs,... RBWSource='property',RBW=rbw,... AveragingMethod='exponential',ForgettingFactor=0.25,... ChannelNames={'MRU#1 User 1','MRU#1 User 2','RU#2','MRU#3'},... ShowLegend=true,Title='Transmitted EHT TB Waveform per User'); spectrumScope(txTrigStore);```

```function spectrumScope = plotSpectrumAndSpectrogram(tx,cfg,osf,titleStr) % Plot the specrum and spectrogram for a given waveform and % configuration fs = wlanSampleRate(cfg.ChannelBandwidth,'OversamplingFactor',osf); % Get baseband sample rate ofdmInfo = wlanEHTOFDMInfo('EHT-Data',cfg,1,'OversamplingFactor',osf); fftsize = ofdmInfo.FFTLength; % Use the data field fft size rbw = fs/fftsize; % Resolution bandwidth spectrumScope = spectrumAnalyzer(SampleRate=fs,... RBWSource='property',RBW=rbw,... AveragingMethod='exponential',ForgettingFactor=0.25,... ReducePlotRate=false,YLimits=[-100,10],... Title=titleStr); spectrumScope.ViewType = 'spectrum-and-spectrogram'; spectrumScope.TimeSpanSource = 'property'; spectrumScope.TimeSpan = length(tx)/fs; spectrumScope(tx) end```

### Appendix A

The RU allocation table for allocations <= 20 MHz is shown below, with annotated descriptions.

RU allocation and EHT-SIG user signaling for allocations >= 20 MHz, with annotated descriptions.

RU allocation and EHT-SIG user signaling for 242-, 484-, 996-, and 2x996-tone RUs.

MRU allocation and EHT-SIG user signaling for allocation >=80 MHz.

### Appendix B

Non-OFDMA punctured channel indication for a 80 MHz PPDU, with annotated descriptions.

Non-OFDMA punctured channel indication for a 160 MHz PPDU, with annotated descriptions.

Non-OFDMA punctured channel indication for a 320 MHz PPDU.

### References

1. IEEE P802.11be™/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 8: Enhancements for extremely high throughput (EHT).

2. IEEE Std 802.11ax(TM)-2021. 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 1: Enhancements for High Efficiency WLAN.