wlanFormatDetect
R2026bDetect packet format
Syntax
Description
detects and returns format = wlanFormatDetect(rx,chanEst,nVar,cbw)format, the packet format of a received
time-domain signal. The function detects the packet format by performing a series of
checks on rx, a portion of the signal whose contents uniquely
determine the packet format. For more information, see Format Detection Processing. To perform these checks, the function also
requires estimated channel characteristics chanEst, estimated
noise variance noiseVarEst, and channel bandwidth
cbw.
Examples
Detect the format of a WLAN HE SU waveform.
Generate an HE SU waveform and obtain a received signal by adding noise.
cbw = 'CBW20'; % Specify channel bandwidth of 20 MHz cfgHESU = wlanHESUConfig('ChannelBandwidth',cbw); % Create configuration object for HE SU format bits = [1;0;0;1]; tx = wlanWaveformGenerator(bits,cfgHESU); % Generate HE SU waveform snr = 10; % Specify signal-to-noise ratio (SNR) rx = awgn(tx,snr); % Create receive waveform
Specify the sample rate and durations of the relevant PPDU fields.
sr = 20e6; % Sample rate in samples per second tLSTF = 8e-6; % Duration of legacy short training field (L-STF) tLLTF = tLSTF; % Duration of legacy long training field (L-LTF)
Determine the field indices and estimate the channel using the L-LTF.
ind = tLSTF*sr+(1:tLLTF*sr); y = wlanLLTFDemodulate(rx(ind,:),cbw); chanEst = wlanLLTFChannelEstimate(y,cbw);
Specify the channel noise variance estimate and detect the format of the waveform.
nVar = 10^(-snr/20);
rxSig = rx((tLSTF+tLLTF)*sr+(1:sr*(16e-6)),:); % 16 microseconds corresponding to four OFDM symbols after HE L-LTF
format = wlanFormatDetect(rxSig,chanEst,nVar,cbw);
disp(format)HE-SU
Perform format detection on a WLAN high-throughput mixed format (HT-MF) waveform.
Generate an HT-MF waveform and add noise to the transmitted waveform.
cbw = 'CBW20'; cfgTx = wlanHTConfig('ChannelBandwidth',cbw); tx = wlanWaveformGenerator([1;0;0;1],cfgTx); snr = 10; rxSig = awgn(tx,snr);
Demodulate Received Signal and Perform Channel Estimation
Determine indices for the L-LTF of the 20 MHz bandwidth waveform. For this calculation, define local variables for the sample rate and duration of the L-STF and L-LTF fields in seconds.
Demodulate the L-LTF.
Perform channel estimation using the L-LTF.
Estimate the noise variance.
sr = 20e6; Tlstf = 8e-6; Tlltf = 8e-6; idxlltf = Tlstf*sr+(1:Tlltf*sr); lltfDemod = wlanLLTFDemodulate(rxSig(idxlltf,:),cbw); chanEst = wlanLLTFChannelEstimate(lltfDemod,cbw); nVar = 10^(-snr/20);
Detect Signal Format
Determine indices for the three symbols following the L-LTF. For a 20 MHz bandwidth waveform, the duration for three symbols is 12 µs.
Perform format detection.
idxDetectionSymbols = (Tlstf+Tlltf)*sr+(1:12e-6*sr); in = rxSig(idxDetectionSymbols,:); format = wlanFormatDetect(in,chanEst,nVar,cbw)
format = 'HT-MF'
Detect the format of a WLAN very high throughput (VHT) waveform, adjusting the default recovery algorithm settings.
Generate a VHT waveform and add white Gaussian noise to the transmitted waveform.
cbw = 'CBW80'; cfgTx = wlanVHTConfig('ChannelBandwidth',cbw); tx = wlanWaveformGenerator([1;0;0;1],cfgTx); snr = 10; rxSig = awgn(tx,snr);
Demodulate Received Signal and Estimate Channel
Determine indices for the L-LTF of the 80 MHz bandwidth waveform. For this calculation, define local variables for the sample rate and duration of the L-STF and L-LTF in seconds.
Demodulate the L-LTF.
Perform channel estimation using the L-LTF.
Estimate the noise variance.
sr = 80e6; Tlstf = 8e-6; Tlltf = 8e-6; idxlltf = Tlstf*sr+(1:Tlltf*sr); lltfDemod = wlanLLTFDemodulate(rxSig(idxlltf,:),cbw); chanEst = wlanLLTFChannelEstimate(lltfDemod,cbw); nVar = 10^(-snr/20);
Detect Format
Determine indices for the three symbols following the L-LTF. For an 80 MHz bandwidth waveform, the duration for three symbols is 12 µs.
Detect the format using modified recovery settings.
TdetectionSymbols = 12e-6; idxDetectionSymbols = (Tlstf+Tlltf)*sr+(1:TdetectionSymbols*sr); in = rxSig(idxDetectionSymbols,:); format = wlanFormatDetect(in,chanEst,nVar,cbw, ... 'OFDMSymbolOffset',0.5,'PilotPhaseTracking','None')
format = 'VHT'
Input Arguments
Post-long-training-field (post-LTF) portion of the received time-domain signal, specified as a complex-valued NS-by-NR matrix, where:
NS is the number of time-domain samples.
NR is the number of receive antennas.
To successfully detect the format of a UHR, EHT, or HE
packet, the input must contain all time-domain samples from the four OFDM
symbols immediately following the L-LTF (sym1,
sym2, sym3, and
sym4). To detect the presence of an ELR-Mark field
and identify the packet format as UHR-ELR, the input must contain all
time-domain samples from the six OFDM symbols immediately following the
L-LTF (sym1, sym2,
sym3, sym4,
sym5, and sym6). The first entry
in each column of this input must be the first time-domain sample of the
symbol received by the corresponding antenna. For more information about how
the wlanFormatDetect function uses this input for format
detection, see Format Detection Processing.
Note
If the number of received OFDM symbols is greater than six, the function ignores additional samples after sym6.
Data Types: single | double
Complex Number Support: Yes
Channel estimate for data and pilot subcarriers based on the L-LTF, specified as a numeric matrix or array of size NST-by-1-by-NR, where:
NST is the number of occupied subcarriers.
NR is the number of receive antennas.
The second dimension corresponds to the single transmitted stream in the L-LTF. If the transmission uses multiple antennas, the single transmitted stream includes the combined cyclic shifts.
Data Types: single | double
Complex Number Support: Yes
Noise variance estimate, specified as a nonnegative scalar.
Data Types: double
Channel bandwidth, in MHz, specified as one of these values.
'CBW5'— Channel bandwidth of 5 MHz'CBW10'— Channel bandwidth of 10 MHz'CBW20'— Channel bandwidth of 20 MHz'CBW40'— Channel bandwidth of 40 MHz'CBW80'— Channel bandwidth of 80 MHz'CBW160'— Channel bandwidth of 160 MHz'CBW320'— Channel bandwidth of 320 MHz
Data Types: char
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN, where Name is
the argument name and Value is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: PilotPhaseTracking='None' disables pilot phase
tracking.
OFDM symbol sampling offset represented as a fraction of the
cyclic prefix (CP) length, specified as the name-value argument
consisting of OFDMSymbolOffset and a scalar in
the interval [0, 1]. The value you specify indicates the start
location for OFDM demodulation relative to the beginning of the CP.
The value 0 represents the start of the CP, and
the value 1 represents the end of the CP.
Data Types: double
Equalization method, specified as one of these values.
"MMSE"— The receiver uses a minimum mean-square error equalizer."ZF"— The receiver uses a zero-forcing equalizer.
When the received signal has multiple receive antennas,
the function exploits receiver diversity during
equalization. When the number of transmitted space-time
streams is one and you specify this argument as
"ZF", the function performs
maximal-ratio combining.
Data Types: char | string
Pilot phase tracking, specified as one of these values.
"PreEQ"— Enable pilot phase tracking, which the function performs before any equalization operation."None"— Disable pilot phase tracking.
Data Types: char | string
Warning suppression, specified as false or
true. Set to true to suppress
warning messages.
Data Types: logical
Output Arguments
Packet format, returned as one of these values:
'Non-HT'— Non-high-throughput (non-HT) format'HT-MF'— High-throughput mixed format (HT MF)'HT-GF'— High-throughput greenfield format (HT GF)'VHT'— Very-high-throughput (VHT) format'HE-SU'— High-efficiency single-user (HE SU) format'HE-EXT-SU'— HE extended-range single-user (HE ER SU) format'HE-MU'— HE multi-user (HE MU) format'HE-TB'— HE trigger-based (HE TB) format'EHT-MU'— EHT multi-user (EHT MU) format (since R2023a)'EHT-TB'— EHT trigger-based (EHT TB) format (since R2023a)'EHTValidate'— Validation bit detected. See Section 36.3.12.7.2 of [2]. (since R2023a)'UHRValidate'— Validation bit detected. See Table 38-25 of [1]. (since R2026b)
Algorithms
The wlanFormatDetect function determines packet format by checking
relevant attributes of the rx input.
For the function to successfully detect the format of a UHR, EHT or HE packet,
rxmust contain all time-domain samples in the four OFDM symbols following the L-LTF.To detect the presence of an ELR-Mark field and identify the format as UHR-ELR, the input must contain all time-domain samples from the six OFDM symbols following the L-LTF.
For the function to successfully detect the format of a non-HT, HT-MF, or VHT packet, the
rxinput argument must contain all time-domain samples from the three OFDM symbols following the L-LTF.For the function to successfully detect the format of an HT-GF packet,
rxmust contain all time-domain samples in the three OFDM symbols following the HT-LTF1.
The first entry in each column of rx must be the
first time-domain sample of the first OFDM symbol following the relevant LTF
received by the corresponding antenna. The function does not use additional samples
after the last sample of the sixth OFDM symbol.
Before demodulating any packet symbols, the function checks the channel bandwidth.
If the channel bandwidth is 5 MHz or 10 MHz, the function identifies the packet
format as non-HT and returns. Otherwise, the function checks the number of OFDM
symbols in the input signal. If it detects four or more symbols, it determines the
packet format by following the steps described in HE Format Detection, EHT Format Detection and UHR Format Detection . If these steps
do not identify a format, or if the function detects fewer than four symbols, it
determines the packet format by following the steps described in Legacy Format Detection. In addition,
when the channel bandwidth is 20 MHz and the rx input argument
contains six or more OFDM symbols, the function checks for the UHR-ELR format by
performing ELR-Mark sequence detection on the fifth and sixth symbols following the
L-LTF.
Check for the repeated L-SIG (RL-SIG) field by cross-correlating the first and second OFDM symbols. If the function does not detect the RL-SIG field, it determines the packet format by following the steps described in Legacy Format Detection.
If the function detects the RL-SIG field, it demodulates and decodes the L-SIG field. The function then checks the parity and data rate to validate the L-SIG field.
If the L-SIG parity check passes and the detected MCS is 0, check whether the L-SIG length modulo 3 satisfies these conditions.
If the L-SIG length modulo 3 is not 0, the function identifies the packet format as HE. The function then demodulates the HE-SIG-A field and follows the steps described in HE Format Detection.
If the L-SIG length modulo 3 equals 0, the function determines the packet format by following the steps described in EHT and UHR Format Detection.
Otherwise, proceed to Legacy Format Detection.
This figure shows the frame structure of the HE format.
To detect the HE format, the function performs these steps.
Check the modulation of second HE-SIG-A symbol (sym4). If the modulation is QBPSK:
If ELR-Mark detection is enabled and the function detects the ELR-Mark sequence, identify the format as UHR-ELR.
Otherwise, identify the format as HE-EXT-SU.
If the modulation is BPSK and the L-SIG length modulo 3 equals 2:
If ELR-Mark detection is enabled, check the HE-SIG-A CRC and validate the field values. If the CRC check fails or any field value is invalid, check for the ELR-Mark sequence. If the function detects the ELR-Mark sequence, it identifies the format as UHR-ELR. Otherwise, it identifies the format as HE-MU.
If ELR-Mark detection is disabled, the function identifies the format as HE-MU.
If the modulation is BPSK and the L-SIG length modulo 3 equals 1:
If the HE-SIG-A CRC check fails:
If ELR-Mark detection is enabled, check for the ELR-Mark sequence. If the function detects the ELR-Mark sequence, it identifies the format as UHR-ELR. Otherwise, follow the steps described in Legacy Format Detection.
If ELR-Mark detection is disabled, follow the steps described in Legacy Format Detection.
If the HE-SIG-A CRC check passes:
If ELR-Mark detection is enabled, validate the HE-SIG-A field values. If any field value is invalid, check for the ELR-Mark sequence. If the function detects the ELR-Mark sequence, it identifies the format as UHR-ELR. Otherwise, follow the steps described in Legacy Format Detection.
If ELR-Mark detection is disabled and the first bit of the HE-SIG-A field is 0, the format is HE-TB. If the first bit of the HE-SIG-A field is 1, the format is HE-SU.
This figure shows the frame structure for the EHT or UHR format.

To detect EHT and UHR, the function performs these steps.
Check the modulation scheme of the second U-SIG symbol (
Sym4).If the modulation scheme of
Sym4is QBPSK, the function returns 'EHTValidate'.If the modulation scheme of
Sym4is not QBPSK, the function checks the CRC of the U-SIG field.
If the U-SIG CRC check fails:
If ELR-Mark detection is enabled, check for the ELR-Mark sequence. If the function detects the ELR-Mark sequence, it identifies the format as UHR-ELR. Otherwise, follow the steps described in Legacy Format Detection.
If ELR-Mark detection is disabled, follow the steps described in Legacy Format Detection.
If the U-SIG CRC check passes, parse the PHY Version Identifier, Uplink Indication, PPDU Type, Compression Mode, and U-SIG-2 Bit 2 fields.
If the PHY Version Identifier equals 1, the function identifies the format as UHR. The function then determines the specific UHR format by following the steps described in UHR Format Detection.
If the PHY Version Identifier equals 0, the function identifies the format as EHT. The function then determines the specific EHT format by following the steps described in EHT Format Detection.
Otherwise, if ELR-Mark detection is enabled, check for the ELR-Mark sequence. If the function detects the ELR-Mark sequence, it identifies the format as UHR-ELR. Otherwise, follow the steps described in Legacy Format Detection.
This figure shows the frame structure for the UHR-ELR format.

If ELR-Mark detection is enabled, validate the U-SIG field values.
If the U-SIG field values are invalid, check for the ELR-Mark sequence. If the function detects the ELR-Mark sequence, it identifies the format as UHR-ELR. Otherwise, follow the steps described in Legacy Format Detection.
If the U-SIG field values are valid, or if ELR-Mark detection is disabled (See Table 38-25 of [1]):
If the Compression Mode equals 3, the function identifies the format as UHR-ELR.
If the Compression Mode equals 0, 1, or 2:
If the Compression Mode equals 0 and Bit 2 of the U-SIG-2 field equals 0, the function returns
"UHRValidate".If the Uplink Indication equals 0, the function identifies the format as UHR-MU.
If the Uplink Indication, the Compression Mode, and Bit 2 of the U-SIG-2 field all equal 1, the function identifies the format as UHR-MU.
If the Uplink Indication equals 1 and the Compression Mode equals 0, the function identifies the format as UHR-TB
For all other combinations, the function returns
"UHRValidate".
If ELR-Mark detection is enabled, validate the U-SIG field values.
If the U-SIG field values are invalid, check for the ELR-Mark sequence. If the function detects the ELR-Mark sequence, it identifies the format as UHR-ELR. Otherwise, follow the steps described in Legacy Format Detection.
If ELR-Mark detection is disabled or the U-SIG field values are valid, determine the EHT format from the Uplink Indication and Compression Mode fields (see Table 36-29 of [2]):
If the Uplink Indication equals 0 and the Compression Mode equals 0, 1, or 2, the function identifies the format as EHT-MU.
If the Uplink Indication equals 1 and the Compression Mode equals 0, the function identifies the format as EHT-TB.
If the Uplink Indication equals 1 and the Compression Mode equals 1, the function identifies the format as EHT-MU.
For all other combinations, the function returns 'EHTValidate'.
If the channel bandwidth is 5 MHz or 10 MHz, the function identifies the packet format as non-HT.
Demodulate and equalize the first three OFDM symbols after the L-LTF, or the first six OFDM symbols if ELR-Mark detection is enabled. If the channel bandwidth is 20 MHz or 40 MHz and the modulation scheme of the first symbol after the L-LTF is QBPSK, the function identifies the format as HT-GF.
Otherwise, decode the L-SIG field. If the L-SIG parity check fails and ELR-Mark detection is enabled, check for the ELR-Mark sequence. If the function detects the ELR-Mark sequence, it identifies the format as UHR-ELR. Otherwise, if ELR-Mark detection is disabled or the function does not detect the ELR-Mark sequence, it continues format detection by checking the MCS.
Check the MCS. If the MCS is not 0, check for the ELR-Mark sequence. If detected, the format is UHR-ELR. If not detected, the format is non-HT.
If the MCS equals 0, check the modulation scheme of the first symbol after the L-SIG field.
If the modulation scheme is QBPSK and the channel bandwidth is 20 MHz or 40 MHz:
If ELR-Mark detection is enabled, recover the HT-SIG bits and perform the CRC check and validate HT-SIG field values. If the CRC check fails or field values are invalid, check for the ELR-Mark sequence. If the sequence is detected, the format is UHR-ELR. If the CRC check and the field validation both pass, or if the function does not detect the sequence, the format is HT-MF.
If ELR-Mark detection is disabled, the function identifies the format as HT-MF.
Otherwise, check the modulation scheme of the second symbol after the L-SIG field.
If the modulation scheme is QBPSK:
If ELR-Mark detection is enabled, recover the VHT-SIG-A bits and perform the CRC check and validate HT-SIG-A field values. If the CRC check or field interpretation fails, check for the ELR-Mark sequence. If the sequence is detected, the format is UHR-ELR. If the CRC check and the field validation both pass, or if the function does not detect the sequence, the format is VHT.
If ELR-Mark detection is disabled, the function identifies the format as VHT.
If the function does not detect QBPSK, check for the ELR-Mark sequence. If the sequence is detected, the format is UHR-ELR. If the sequence is not detected, the format is non-HT.
This figure shows the frame structure of the legacy format.
References
[1] IEEE® 802.11bn™. Draft 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 6: Enhancements for ultra-high reliability (UHR).
[2] IEEE Std 802.11be™-2024 “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 2: Enhancements for Extremely High Throughput (EHT).” https://ieeexplore.ieee.org/document/11090080
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Version History
Introduced in R2016bThe wlanFormatDetect now enables you to detect UHR MU, UHR
ELR, and UHR TB packet formats.
Starting in R2026b, when the channel bandwidth is 20 MHz and at least six OFDM
symbols are available in the rx input, the wlanFormatDetect function also uses ELR-Mark sequence detection
during EHT, HE, VHT, HT, and non-HT format detection. When format detection relies
on signal field values, the function checks for the ELR-Mark sequence if the CRC
check fails or if it detects invalid field values. If the function does not detect
the ELR-Mark sequence during EHT or HE format detection, it proceeds with VHT, HT,
or non-HT format detection.
In previous releases, the wlanFormatDetect function checks the CRC and if the check fails, the
function proceeds with VHT, HT, or non-HT format detection.
You can suppress warning messages by specifying the SuppressWarnings name-value argument as
true.
You can detect EHT MU and EHT TB packet formats.
See Also
Functions
wlanLLTFChannelEstimate|wlanLSIGRecover|wlanHTSIGRecover|wlanHESIGABitRecover|wlanVHTSIGARecover
Objects
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)