Main Content

wlanPSDULength

Calculate PSDU length in octets

Since R2019b

Description

example

PSDULength = wlanPSDULength(cfgPHY,unit,value) returns 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

collapse all

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);

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

collapse all

PHY format configuration, specified as a wlanHESUConfig, wlanVHTConfig, wlanHTConfig, or wlanNonHTConfig object. This object defines a PHY format configuration and its applicable properties.

Units of 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 from which 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 Valuevalue 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

collapse all

Length of 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 R2019b

See Also

Functions