wlanAPEPLength
Calculate APEP length in octets
Description
returns APEPLength
= wlanAPEPLength(cfgPHY
,unit
,value
)APEPLength
, the aggregate MAC protocol data unit (A-MPDU)
pre-EOF padding (APEP) length, in octets from the given value
and the
physical layer configuration, cfgPHY
. The units of
value
can be in terms of physical layer conformance procedure (PLCP)
protocol data unit (PPDU) transmission time or number of data symbols, specified by the
unit
input argument.
Examples
Generate VHT Waveform with Specified Transmission Time
Create a wlanVHTConfig
object, 'cfgPHY'
, and specify the transmission time, 'txTime'
, in microseconds.
cfgPHY = wlanVHTConfig; txTime = 200;
Calculate the APEP length in octets.
apepLength = wlanAPEPLength(cfgPHY,'TxTime',txTime)
apepLength = 580
Set the number of bytes carried in the user payload for the configuration object, 'cfgPHY'
, to this APEP length.
cfgPHY.APEPLength = apepLength;
Create a wlanMACFrameConfig
object, 'cfgMAC'
. Use this object to generate a VHT-format QoS data frame.
cfgMAC = wlanMACFrameConfig('FrameType','QoS Data', ... 'FrameFormat','VHT');
Calculate the MAC service data unit (MSDU) lengths required to generate a MAC frame of size 'APEPLength'
.
msduLengths = wlanMSDULengths(apepLength,cfgMAC,cfgPHY);
Create random MSDUs using 'msduLengths'
.
msduList = cell(1, numel(msduLengths)); for i = 1:numel(msduLengths) msduList{i} = randi([0 255],1,msduLengths(i)); end
Generate MAC frame bits using the MSDUs, 'msduList'
.
macFrameBits = wlanMACFrame(msduList,cfgMAC,cfgPHY,'OutputFormat','bits');
Generate a VHT waveform using 'cfgPHY'
and the generated MAC frame bits, 'macFrameBits'
.
waveform = wlanWaveformGenerator(macFrameBits,cfgPHY);
Generate HE-SU Waveform with Specified Number of Data Symbols
Create a wlanHESUConfig
object, 'cfgPHY'
.
cfgPHY = wlanHESUConfig;
Calculate the APEP length in octets, specifying 200 data symbols.
apepLength = wlanAPEPLength(cfgPHY,'NumDataSymbols',200)
apepLength = 2920
Set the number of bytes carried in the user payload for the configuration object, 'cfgPHY'
, to this APEP length. Calculate the PSDU length.
cfgPHY.APEPLength = apepLength; psduLength = getPSDULength(cfgPHY)*8;
Create a random PSDU, 'psdu'
, using the calculated PSDU length.
psdu = randi([0 1],getPSDULength(cfgPHY)*8,1);
Generate an HE-SU waveform using 'cfgPHY'
and 'psdu'
.
waveform = wlanWaveformGenerator(psdu,cfgPHY);
Input Arguments
cfgPHY
— PHY format configuration
wlanEHTMUConfig
object | wlanHESUConfig
object | wlanVHTConfig
object
PHY format configuration, specified as a wlanEHTMUConfig
, wlanHESUConfig
,
or wlanVHTConfig
object. This object defines a PHY
format configuration and its applicable properties.
Note
When you specify this input as a wlanEHTMUConfig
object, it must
be single-user.
unit
— Units of argument value
'TxTime'
| 'NumDataSymbols'
Units of the argument value
, specified as one of
'TxTime'
or 'NumDataSymbols'
. This value
indicates the units of value
from which the APEP length is
calculated.
Data Types: char
| string
value
— Value from which APEP length is calculated
numeric scalar
Value from which the APEP length is calculated, specified as a numeric scalar. Input
argument unit
specifies the unit of value
.
This table describes how the function interprets value
based on
unit
.
unit
Value | value
Description |
'TxTime' | Scalar number specifying the time in microseconds |
'NumDataSymbols' | Scalar number specifying the number of data symbols |
Data Types: double
Output Arguments
APEPLength
— Length of APEP
numeric scalar
Length of the APEP, in octets, returned as a numeric scalar. This value returns the
maximum APEP length that fits into the specified value of 'TxTime'
or
'NumDataSymbols'
.
Data Types: double
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Version History
Introduced in R2019bR2024b: Calculate APEP length for EHT SU configurations
You can now calculate the maximum APEP length for EHT single-user configurations. To use
this feature, specify the cfgPHY
input as a
wlanEHTMUConfig
object that has one user.
R2024b: Exceeding TxTime
limit for symbol boundary no longer causes error
When you specify unit
as
'TxTime'
and the value
you specify
makes the transmit time that corresponds to the next symbol boundary higher than the maximum
allowed, the function returns the APEP length that corresponds to the highest valid transmit
time. Previously, the function threw an error in this case.
MATLAB Command
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.
Select a Web Site
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: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)