Generate HT-Data field waveform

generates
the HT-Data field`y`

= wlanHTData(`psdu`

,`cfg`

)^{[1]}
time-domain
waveform for the input PLCP service data unit, `psdu`

,
and specified configuration object, `cfg`

. See HT-Data Field Processing for waveform generation
details.

Generate the waveform signal for a 40 MHz HT-mixed data field with multiple transmit antennas. Create an HT format configuration object. Specify 40 MHz channel bandwidth, two transmit antennas, and two space-time streams.

cfgHT = wlanHTConfig('ChannelBandwidth','CBW40','NumTransmitAntennas',2,'NumSpaceTimeStreams', 2,'MCS',12)

cfgHT = wlanHTConfig with properties: ChannelBandwidth: 'CBW40' NumTransmitAntennas: 2 NumSpaceTimeStreams: 2 SpatialMapping: 'Direct' MCS: 12 GuardInterval: 'Long' ChannelCoding: 'BCC' PSDULength: 1024 AggregatedMPDU: 0 RecommendSmoothing: 1

Assign `PSDULength`

bytes of random data to a bit stream and generate the HT data waveform.

PSDU = randi([0 1],cfgHT.PSDULength*8,1); y = wlanHTData(PSDU,cfgHT);

Determine the size of the waveform.

size(y)

`ans = `*1×2*
2080 2

The function returns a complex two-column time-domain waveform. Each column contains 2080 samples, corresponding to the HT-Data field for each transmit antenna.

`psdu`

— PLCP Service Data Unitvector

PLCP Service Data Unit (PSDU),
specified as an *N _{b}*-by-1
vector.

`PSDULength`

× 8.**Data Types: **`double`

`cfg`

— Format configuration`wlanHTConfig`

objectFormat configuration, specified as a `wlanHTConfig`

object.
The `wlanHTData`

function uses the object properties
indicated.

`ChannelBandwidth`

— Channel bandwidth`'CBW20'`

(default) | `'CBW40'`

Channel bandwidth in MHz, specified as `'CBW20'`

or `'CBW40'`

.

**Data Types: **`char`

| `string`

`NumTransmitAntennas`

— Number of transmit antennas1 (default) | 2 | 3 | 4

Number of transmit antennas, specified as 1, 2, 3, or 4.

**Data Types: **`double`

`NumSpaceTimeStreams`

— Number of space-time streams1 (default) | 2 | 3 | 4

Number of space-time streams in the transmission, specified as 1, 2, 3, or 4.

**Data Types: **`double`

`NumExtensionStreams`

— Number of extension spatial streams0 (default) | 1 | 2 | 3

Number of extension spatial streams in the transmission, specified
as 0, 1, 2, or 3. When `NumExtensionStreams`

is
greater than 0, `SpatialMapping`

must be `'Custom'`

.

**Data Types: **`double`

`SpatialMapping`

— Spatial mapping scheme`'Direct'`

(default) | `'Hadamard'`

| `'Fourier'`

| `'Custom'`

Spatial mapping scheme, specified as `'Direct'`

,
`'Hadamard'`

, `'Fourier'`

, or
`'Custom'`

. The default value
`'Direct'`

applies when
`NumTransmitAntennas`

and
`NumSpaceTimeStreams`

are equal.

**Data Types: **`char`

| `string`

`SpatialMappingMatrix`

— Spatial mapping matrix1 (default) | scalar | matrix | 3-D array

Spatial mapping matrix, specified as a scalar, matrix, or 3-D
array. Use this property to rotate and scale the constellation mapper
output vector. This property applies when the `SpatialMapping`

property
is set to `'Custom'`

. The spatial mapping matrix
is used for beamforming and mixing space-time streams over the transmit
antennas.

When specified as a scalar,

`NumTransmitAntennas`

=`NumSpaceTimeStreams`

= 1 and a constant value applies to all the subcarriers.When specified as a matrix, the size must be (

*N*_{STS}+*N*_{ESS})-by-*N*_{T}.*N*_{STS}is the number of space-time streams.*N*_{ESS}is the number of extension spatial streams.*N*_{T}is the number of transmit antennas. The spatial mapping matrix applies to all the subcarriers. The first*N*_{STS}and last*N*_{ESS}rows apply to the space-time streams and extension spatial streams respectively.When specified as a 3-D array, the size must be

*N*_{ST}-by-(*N*_{STS}+*N*_{ESS})-by-*N*_{T}.*N*_{ST}is the sum of the data and pilot subcarriers, as determined by`ChannelBandwidth`

.*N*_{STS}is the number of space-time streams.*N*_{ESS}is the number of extension spatial streams.*N*_{T}is the number of transmit antennas. In this case, each data and pilot subcarrier can have its own spatial mapping matrix.The table shows the

`ChannelBandwidth`

setting and the corresponding*N*_{ST}.`ChannelBandwidth`

*N*_{ST}`'CBW20'`

56 `'CBW40'`

114

The calling function normalizes the spatial mapping matrix for each subcarrier.

**Example: **`[0.5 0.3; 0.4 0.4; 0.5 0.8]`

represents
a spatial mapping matrix having three space-time streams and two transmit
antennas.

**Data Types: **`double`

**Complex Number Support: **Yes

`MCS`

— Modulation and coding scheme0 (default) | integer from 0 to 31

Modulation and coding scheme to use for transmitting the current
packet, specified as an integer from 0 to 31. The MCS setting identifies
which modulation and coding rate combination is used, and the number
of spatial streams (*N _{SS}*).

MCS^{(Note 1)} | N_{SS}^{(Note
1)} | Modulation | Coding Rate |
---|---|---|---|

0, 8, 16, or 24 | 1, 2, 3, or 4 | `BPSK` | `1/2` |

1, 9, 17, or 25 | 1, 2, 3, or 4 | `QPSK` | `1/2` |

2, 10, 18, or 26 | 1, 2, 3, or 4 | `QPSK` | `3/4` |

3, 11, 19, or 27 | 1, 2, 3, or 4 | `16QAM` | `1/2` |

4, 12, 20, or 28 | 1, 2, 3, or 4 | `16QAM` | `3/4` |

5, 13, 21, or 29 | 1, 2, 3, or 4 | `64QAM` | `2/3` |

6, 14, 22, or 30 | 1, 2, 3, or 4 | `64QAM` | `3/4` |

7, 15, 23, or 31 | 1, 2, 3, or 4 | `64QAM` | `5/6` |

^{Note-1} MCS
from 0 to 7 have one spatial stream. MCS from 8 to 15 have two spatial
streams. MCS from 16 to 23 have three spatial streams. MCS from 24
to 31 have four spatial streams. |

See IEEE^{®} 802.11™-2012,
Section 20.6 for further description of MCS dependent parameters.

When working with the HT-Data field, if the number of space-time streams is equal to the number of spatial streams, no space-time block coding (STBC) is used. See IEEE 802.11-2012, Section 20.3.11.9.2 for further description of STBC mapping.

**Example: **`22`

indicates an MCS with three spatial
streams, 64-QAM modulation, and a 3/4 coding rate.

**Data Types: **`double`

`GuardInterval`

— Cyclic prefix length for the data field within a packet`'Long'`

(default) | `'Short'`

Cyclic prefix length for the data field within a packet, specified
as `'Long'`

or `'Short'`

.

The long guard interval length is 800 ns.

The short guard interval length is 400 ns.

**Data Types: **`char`

| `string`

`ChannelCoding`

— Type of forward error correction coding`'BCC'`

(default) | `'LDPC'`

Type of forward error correction coding for the data field,
specified as `'BCC'`

(default) or `'LDPC'`

. `'BCC'`

indicates
binary convolutional coding and `'LDPC'`

indicates
low density parity check coding. Providing a character vector or a
single cell character vector defines the channel coding type for a
single user or all users in a multiuser transmission. By providing
a cell array different channel coding types can be specified per user
for a multiuser transmission.

**Data Types: **`char`

| `cell`

| `string`

`PSDULength`

— Number of bytes carried in the user payload1024 (default) | integer from 0 to 65,535

Number of bytes carried in the user payload, specified as an
integer from 0 to 65,535. A `PSDULength`

of 0 implies
a sounding packet for which there are no data bits to recover.

**Example: **`512`

**Data Types: **`double`

`scramInit`

— Scrambler initialization state93 (default) | integer from 1 to 127 | binary vector

Scrambler initialization state for each packet generated, specified as an integer from 1 to 127 or as the corresponding binary vector of length seven. The default value of 93 is the example state given in IEEE Std 802.11-2012, Section L.1.5.2.

The
scrambler initialization used on the transmission data follows the process described in
IEEE Std 802.11-2012, Section 18.3.5.5 and IEEE Std 802.11ad™-2012, 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
length-127 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 left-MSB 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,'left-msb') ans = 0 0 0 0 0 0 1

**Example: **`[1; 0; 1; 1; 1; 0; 1]`

conveys the
scrambler initialization state of 93 as a binary vector.

**Data Types: **`double`

| `int8`

`y`

— HT-Data field time-domain waveformmatrix

HT-Data field time-domain
waveform for HT-mixed format, returned as an *N*_{S}-by-*N*_{T} matrix. *N*_{S} is
the number of time domain samples, and *N*_{T} is
the number of transmit antennas.

The high throughput data field (HT-Data) follows the last HT-LTF of an HT-mixed packet.

The high throughput data field is used to transmit one or more frames from the MAC layer and consists of four subfields.

**Service field**— Contains 16 zeros to initialize the data scrambler.**PSDU**— Variable-length field containing the PLCP service data unit (PSDU). In 802.11, the PSDU can consist of an aggregate of several MAC service data units.**Tail**— Tail bits required to terminate a convolutional code. The field uses six zeros for each encoding stream.**Pad Bits**— Variable-length field required to ensure that the HT-Data field consists of an integer number of symbols.

Physical layer convergence procedure (PLCP) service data unit (PSDU). This field is composed of a variable number of octets. The minimum is 0 (zero) and the maximum is 2500. For more information, see IEEE Std 802.11™-2012, Section 15.3.5.7.

The HT-Data field follows the last HT-LTF in the packet structure.

The HT-Data field includes the user payload
in the PSDU, plus 16 service bits, 6 × *N*_{ES} tail
bits, and additional padding bits as required to fill out the last
OFDM symbol.

For algorithm details, refer to IEEE Std 802.11™-2012 [1], Section 20.3.11.
The `wlanHTData`

function performs transmitter
processing on the HT-Data field and
outputs the time-domain waveform for *N*_{T} transmit
antennas.

N_{ES} is the number
of BCC encoders. |

N_{SS} is the number
of spatial streams. |

N_{STS} is the number
of space-time streams. |

N_{T} is the number
of transmit antennas. |

BCC channel coding is shown. STBC and spatial mapping are optional modes for HT format.

[1] 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.

Generate C and C++ code using MATLAB® Coder™.

`wlanHTConfig`

| `wlanHTDataRecover`

| `wlanHTLTF`

| `wlanWaveformGenerator`

^{[1]} IEEE Std 802.11-2012 Adapted and reprinted
with permission from IEEE. Copyright IEEE 2012. All rights
reserved.

A modified version of this example exists on your system. Do you want to open this version instead?

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.

- América Latina (Español)
- Canada (English)
- United States (English)

- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)

- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)