Generate VHT-Data field

generates
a VHT-Data field`y`

= wlanVHTData(`psdu`

,`cfg`

)^{[1]}
time-domain
waveform from the input user data bits, `psdu`

,
for the specified configuration object, `cfg`

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

Generate the waveform for a MIMO 20 MHz VHT-Data field.

Create a VHT configuration object. Assign a 20 MHz channel bandwidth, two transmit antennas, two space-time streams, and set MCS to four.

cfgVHT = wlanVHTConfig('ChannelBandwidth','CBW20','NumTransmitAntennas',2,'NumSpaceTimeStreams',2,'MCS',4);

Generate the user payload data and the VHT-Data field waveform.

psdu = randi([0 1],cfgVHT.PSDULength*8,1); y = wlanVHTData(psdu,cfgVHT); size(y)

`ans = `*1×2*
2160 2

The 20 MHz waveform is an array with two columns, corresponding to two transmit antennas. There are 2160 complex samples in each column.

y(1:10,:)

`ans = `*10×2 complex*
-0.0598 + 0.1098i -0.1904 + 0.1409i
0.6971 - 0.3068i -0.0858 - 0.2701i
-0.1284 + 0.9268i -0.8318 + 0.3314i
-0.1180 + 0.0731i 0.1313 + 0.4956i
0.3591 + 0.5485i 0.9749 + 0.2859i
-0.9751 + 1.3334i 0.0559 + 0.4248i
0.0881 - 0.8230i -0.1878 - 0.2959i
-0.2952 - 0.4433i -0.1005 - 0.4035i
-0.5562 - 0.3940i -0.1292 - 0.5976i
1.0999 + 0.3292i -0.2036 - 0.0200i

`psdu`

— PHY service data unitvector

PHY service data unit (PSDU),
specified as an *N*_{b}-by-1
vector. *N*_{b} is the number
of bits and equals `PSDULength`

× 8.

**Data Types: **`double`

`cfg`

— Format configuration`wlanVHTConfig`

objectFormat configuration, specified as a `wlanVHTConfig`

object.
The `wlanVHTData`

function uses the object properties
indicated.

`ChannelBandwidth`

— Channel bandwidth `'CBW80'`

(default) | `'CBW20'`

| `'CBW40'`

| `'CBW160'`

Channel bandwidth, specified as `'CBW20'`

, `'CBW40'`

, `'CBW80'`

,
or `'CBW160'`

. If the transmission has multiple users,
the same channel bandwidth is applied to all users. The default value
of `'CBW80'`

sets the channel bandwidth to 80 MHz.

**Data Types: **`char`

| `string`

`NumTransmitAntennas`

— Number of transmit antennas`1`

(default) | integer in the range [1, 8]Number of transmit antennas, specified as an integer in the range [1, 8].

**Data Types: **`double`

`NumSpaceTimeStreams`

— Number of space-time streams1 (default) | integer from 1 to 8 | 1-by-

Number of space-time streams in the transmission, specified as a scalar or vector.

For a single user, the number of space-time streams is a scalar integer from 1 to 8.

For multiple users, the number of space-time streams is a 1-by-

*N*vector of integers from 1 to 4, where the vector length,_{Users}*N*, is an integer from 1 to 4._{Users}

**Example: **`[1 3 2]`

is the number of space-time
streams for each user.

The sum of the space-time stream vector elements must not exceed eight.

**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 of `'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 apply a beamforming steering matrix, and
to rotate and scale the constellation mapper output vector. If applicable,
scale the space-time block coder output instead. `SpatialMappingMatrix`

applies
when the `SpatialMapping`

property is set to `'Custom'`

.
For more information, see IEEE Std 802.11™-2012, Section 20.3.11.11.2.

When specified as a scalar, a constant value applies to all the subcarriers.

When specified as a matrix, the size must be

*N*-by-_{STS_Total}*N*. The spatial mapping matrix applies to all the subcarriers._{T}*N*is the sum of space-time streams for all users, and_{STS_Total}*N*is the number of transmit antennas._{T}When specified as a 3-D array, the size must be

*N*-by-_{ST}*N*-by-_{STS_Total}*N*._{T}*N*is the sum of the occupied data (_{ST}*N*) and pilot (_{SD}*N*) subcarriers, as determined by_{SP}`ChannelBandwidth`

.*N*is the sum of space-time streams for all users._{STS_Total}*N*is the number of transmit antennas._{T}*N*_{ST}increases with channel bandwidth.`ChannelBandwidth`

Number of Occupied Subcarriers ( *N*_{ST})Number of Data Subcarriers ( *N*_{SD})Number of Pilot Subcarriers ( *N*_{SP})`'CBW20'`

`56`

`52`

`4`

`'CBW40'`

`114`

`108`

`6`

`'CBW80'`

`242`

`234`

`8`

`'CBW160'`

`484`

`468`

`16`

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 two space-time streams and three transmit antennas.

**Data Types: **`double`

**Complex Number Support: **Yes

`STBC`

— Enable space-time block coding`false`

(default) | `true`

Enable space-time block coding (STBC) of the PPDU data field, specified as a logical. STBC transmits multiple copies of the data stream across assigned antennas.

When set to

`false`

, no STBC is applied to the data field, and the number of space-time streams is equal to the number of spatial streams.When set to

`true`

, STBC is applied to the data field, and the number of space-time streams is double the number of spatial streams.

See IEEE^{®} 802.11ac™-2013, Section 22.3.10.9.4
for further description.

`STBC`

is relevant for single-user transmissions
only.

**Data Types: **`logical`

`MCS`

— Modulation and coding scheme0 (default) | integer from 0 to 9 | 1-by-

Modulation and coding scheme used in transmitting the current packet, specified as a scalar or vector.

For a single user, the MCS value is a scalar integer from 0 to 9.

For multiple users, MCS is a 1-by-

*N*vector of integers or a scalar with values from 0 to 9, where the vector length,_{Users}*N*, is an integer from 1 to 4._{Users}

MCS | Modulation | Coding Rate |
---|---|---|

0 | `BPSK` | `1/2` |

1 | `QPSK` | `1/2` |

2 | `QPSK` | `3/4` |

3 | `16QAM` | `1/2` |

4 | `16QAM` | `3/4` |

5 | `64QAM` | `2/3` |

6 | `64QAM` | `3/4` |

7 | `64QAM` | `5/6` |

8 | `256QAM` | `3/4` |

9 | `256QAM` | `5/6` |

**Data Types: **`double`

`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`

`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`

`APEPLength`

— Number of bytes in the A-MPDU pre-EOF padding1024 (default) | nonnegative integer | vector of nonnegative integers

Number of bytes in the A-MPDU pre-EOF padding, specified as a scalar integer or vector of integers.

For a single user,

`APEPLength`

is a nonnegative integer in the interval [0, 2^{20}– 1].For multi-user,

`APEPLength`

is a 1-by-*N*vector of nonnegative integers, where_{Users}*N*is an integer in [1, 4]. The entries in_{Users}`APEPLength`

are integers in the interval [0, 2^{20}– 1].For a null data packet (NDP),

`APEPLength = 0`

.

`APEPLength`

is used internally to determine the number of OFDM symbols in
the data field. For more information, see IEEE Std 802.11ac-2013, Table 22-1.

**Data Types: **`double`

`PSDULength`

— Number of bytes carried in the user payloadinteger | vector of integers

This property is read-only.

Number of bytes carried in the user payload, including the A-MPDU and any MAC padding. For a null data packet (NDP) the PSDU length is zero.

For a single user, the PSDU length is a scalar integer from 1 to 1,048,575.

For multiple users, the PSDU length is a 1-by-

*N*_{Users}vector of integers from 1 to 1,048,575, where the vector length,*N*_{Users}, is an integer from 1 to 4.When undefined,

`PSDULength`

is returned as an empty of size 1×0. This can happen when the set of property values for the object are in an invalid state.

`PSDULength`

is a read-only property
and is calculated internally based on the `APEPLength`

property
and other coding-related properties, as specified in IEEE Std 802.11ac-2013,
Section 22.4.3. It is accessible by direct property call.

**Example: **`[1035 4150]`

is the PSDU length vector
for a `wlanVHTConfig`

object with two users, where
the MCS for the first user is 0 and the MCS for the second user is
3.

**Data Types: **`double`

`scramInit`

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

Initial scrambler state of the data scrambler for each packet
generated, specified as an integer, a binary vector, a 1-by-`N`

_{U} integer
row vector, or a 7-by-`N`

_{U} binary
matrix. `N`

_{U} is the number
of users, from 1 to 4. If specified as an integer or binary vector,
the setting applies to all users. If specified as a row vector or
binary matrix, the setting for each user is specified in the corresponding
column, as a scalar integer from 1 to 127 or the corresponding binary
vector.

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`

— VHT-Data field time-domain waveformmatrix

VHT-Data field time-domain
waveform, 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. See VHT-Data Field Processing for waveform generation details.

The very high throughput data (VHT data) field is used to transmit one or more frames from the MAC layer. It follows the VHT-SIG-B field in the packet structure for the VHT format PPDUs.

The VHT data field is defined in IEEE Std 802.11ac-2013, Section 22.3.10. It is composed of four subfields.

**Service field**— Contains a seven-bit scrambler initialization state, one bit reserved for future considerations, and eight bits for the VHT-SIG-B CRC field.**PSDU**— Variable-length field containing the PLCP service data unit. In 802.11, the PSDU can consist of an aggregate of several MAC service data units.**PHY Pad**— Variable number of bits passed to the transmitter to create a complete OFDM symbol.**Tail**— Bits used to terminate a convolutional code. Tail bits are not needed when LDPC is used.

Physical layer (PHY) Service Data Unit (PSDU). A PSDU can consist of one medium access control (MAC) protocol data unit (MPDU) or several MPDUs in an aggregate MPDU (A-MPDU). In a single user scenario, the VHT-Data field contains one PSDU. In a multi-user scenario, the VHT-Data field carries up to four PSDUs for up to four users.

The VHT-Data field encodes
the service, PSDU, pad bits, and
tail bits. The `wlanVHTData`

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

N is the number
of BCC encoders._{ES} |

N is the number
of spatial streams._{SS} |

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

N is the number
of transmit antennas._{T} |

BCC channel coding is shown.

For algorithm details, refer to IEEE Std 802.11ac-2013 [1], Section 22.3.4.9 and 22.3.4.10, respectively, single user and multi-user.

[1] IEEE Std 802.11ac™-2013 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 4: Enhancements for Very High Throughput for Operation in Bands below 6 GHz.

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

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

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

아래 MATLAB 명령에 해당하는 링크를 클릭하셨습니다.

이 명령을 MATLAB 명령 창에 입력해 실행하십시오. 웹 브라우저에서는 MATLAB 명령을 지원하지 않습니다.

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)