wlanPSDULength
Calculate PSDU length in octets
Description
returns PSDULength
= wlanPSDULength(cfgPHY
,unit
,value
)PSDULength
, the physical layer conformance procedure (PLCP)
service data unit (PSDU) length, in octets from the given value
and the
physical layer configuration cfgPHY
. The value
can
be in terms of PLCP protocol data unit (PPDU) transmission time or number of data symbols,
specified by the unit
input argument.
Examples
Generate Non-HT Waveform with Specified Transmission Time
Create a wlanNonHTConfig
object, 'cfgPHY'
, and specify the transmission time, 'txTime'
, in microseconds.
cfgPHY = wlanNonHTConfig; txTime = 300;
Calculate the PSDU length in octets.
psduLength = wlanPSDULength(cfgPHY,'TxTime',txTime)
psduLength = 207
Set the number of bytes carried in the user payload for the configuration object, 'cfgPHY'
, to this PSDU length. Create a random PSDU, 'psdu'
, using the calculated PSDU length.
cfgPHY.PSDULength = psduLength; data = randi([0 1],psduLength*8,1);
Generate a non-HT waveform using 'cfgPHY'
and 'data'
.
waveform = wlanWaveformGenerator(data,cfgPHY);
Generate HT Waveform with Specified Number of Data Symbols
Create a wlanHTConfig
object, 'cfgPHY'
, and specify the number of data symbols, 'numDataSymbols'
.
cfgPHY = wlanNonHTConfig; numDataSymbols = 200;
Calculate the PSDU length in octets.
psduLength = wlanPSDULength(cfgPHY,'NumDataSymbols',numDataSymbols)
psduLength = 597
Set the number of bytes carried in the user payload for the configuration object, 'cfgPHY'
, to this PSDU length. Create a random PSDU, 'psdu'
, with the calculated PSDU length.
cfgPHY.PSDULength = psduLength; data = randi([0 1],psduLength*8,1);
Generate a non-HT waveform using 'cfgPHY'
and 'data'
.
waveform = wlanWaveformGenerator(data,cfgPHY);
Input Arguments
cfgPHY
— PHY format configuration
wlanEHTMUConfig
object | wlanHESUConfig
object | wlanVHTConfig
object | wlanHTConfig
object | wlanNonHTConfig
object
PHY format configuration, specified as a wlanEHTMUConfig
, wlanHESUConfig
,
wlanVHTConfig
, wlanHTConfig
, or wlanNonHTConfig
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
'TxTime'
or 'NumDataSymbols'
. This value
indicates the units of value
from which the PSDU length is
calculated.
Data Types: char
| string
value
— Value from which PSDU length is calculated
numeric scalar
Value from which the PSDU 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 PPDU transmission time in microseconds |
'NumDataSymbols' | Scalar number specifying the number of symbols in the
'Data' field of PPDU |
Data Types: double
Output Arguments
PSDULength
— Length of PSDU in octets
numeric scalar
Length of the PSDU in octets, returned as a numeric scalar. This value returns the
maximum PSDU 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 PSDU length for EHT SU configurations
You can now calculate the maximum PSDU length for EHT single-user configurations. To use
this feature, specify the cfgPHY
input as a
wlanEHTMUConfig
object that has one user.
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 (한국어)