wlanVHTDataRecover
Recover bits from VHT-Data field
Syntax
Description
recovers dataBits
= wlanVHTDataRecover(rxDataSig
,chEst
,noiseVarEst
,cfgVHT
)dataBits
, a vector of bits, from
rxDataSig
, the received VHT-Data field of a
very-high-throughput (VHT) single-user transmission. The function recovers
dataBits
by using chEst
, a channel
estimate for the occupied subcarriers, noiseVarEst
, an
estimate of noise variance, and cfgVHT
, a configuration
object that contains VHT transmission parameters.
For more information about the VHT-Data field, see VHT-Data Field.
specifies algorithm options by using one or more name-value pair arguments, in
addition to any input argument combination from previous syntaxes. For example,
dataBits
= wlanVHTDataRecover(___,Name,Value
)'LDPCDecodingMethod','layered-bp'
specifies the layered
belief propagation low-density parity-check (LDPC) decoding algorithm.
Examples
Recover Bits from VHT Signal Transmitted Through 2x2 Fading Channel
Recover bits from the VHT-Data field of a VHT waveform transmitted though a 2x2 fading channel by using channel estimation on the VHT long training field (VHT-LTF).
Configure a VHT transmission with a channel bandwidth of 160 MHz, two transmit antennas, and two transmission paths.
cfgVHT = wlanVHTConfig('ChannelBandwidth','CBW160','NumTransmitAntennas',2, ... 'NumSpaceTimeStreams',2,'APEPLength',512);
Generate VHT-LTF and VHT-Data fields signals.
psduLength = 8*cfgVHT.PSDULength; bits = randi([0 1],psduLength,1); txLTF = wlanVHTLTF(cfgVHT); txDataSig = wlanVHTData(bits,cfgVHT);
Pass the transmitted waveform through a 2x2 quasi-static fading channel with additive white Gaussian noise (AWGN).
snr = 10; H = complex(randn(2,2),randn(2,2))/sqrt(2); rxLTF = awgn(txLTF*H,snr); rxDataSig = awgn(txDataSig*H,snr);
Calculate the received signal power and estimate the noise variance.
powerDB = 10*log10(var(rxDataSig)); noiseVarEst = mean(10.^(0.1*(powerDB-snr)));
Perform channel estimation based on the VHT-LTF.
sym = wlanVHTLTFDemodulate(rxLTF,cfgVHT,1); chEst = wlanVHTLTFChannelEstimate(sym,cfgVHT);
Recover the bits from the received VHT-Data field and confirm that the received bits match the transmitted bits.
dataBits = wlanVHTDataRecover(rxDataSig,chEst,noiseVarEst,cfgVHT); numErr = biterr(bits,dataBits)
numErr = 0
Recover Bits from VHT Signal Transmitted through MU-MIMO Channel
Recover bits from the VHT-Data field of a VHT multi-user transmission recovered from a fading MU-MIMO channel by using channel estimation on the VHT-LTF.
This example can return high bit error rates because the transmission does not include precoding to mitigate the interference between space-time streams. However, the example shows a typical VHT signal recovery workflow and appropriate syntax use for the functions.
Configure a VHT transmission with a channel bandwidth of 160 MHz, two users, and four transmit antennas. Assign one space-time stream to the first user and three space-time streams to the second user.
cbw = 'CBW160'; numSTS = [1 3]; cfgVHT = wlanVHTConfig('ChannelBandwidth',cbw,'NumUsers',2, ... 'NumTransmitAntennas',4,'NumSpaceTimeStreams',numSTS);
Generate a payload of bits for each user. This payload must be in a 1-by-N cell array, where N is the number of users.
psduLength = 8*cfgVHT.PSDULength; numUsers = cfgVHT.NumUsers; bits = cell(1,2); for nu = 1:numUsers bits{nu} = randi([0 1],psduLength(nu),1); end
Generate VHT-LTF and VHT-Data field signals.
txLTF = wlanVHTLTF(cfgVHT); txDataSym = wlanVHTData(bits,cfgVHT);
Pass the VHT-Data field signal for the first user through a 4x1 channel because this signal consists of a single space-time stream. Pass the VHT-Data field for the second user through a 4x3 channel because this signal consists of three space-time streams. Apply AWGN to each signal, assuming an SNR of 15 dB.
snr = 15; H{1} = complex(randn(4,1),randn(4,1))/sqrt(2); H{2} = complex(randn(4,3),randn(4,3))/sqrt(2); number = zeros(2,1); ratio = zeros(2,1); for userIdx = 1:numUsers rxDataSym = awgn(txDataSym*H{userIdx},snr,'measured');
Apply the same channel processing to the VHT-LTF for each user.
rxLTF = awgn(txLTF*H{userIdx},snr,'measured');
Calculate the received signal power for each user and estimate the noise variance.
powerDB = 10*log10(var(rxDataSym)); noiseVarEst = mean(10.^(0.1*(powerDB-snr)));
Estimate the channel characteristics by using the VHT-LTF.
demod = wlanVHTLTFDemodulate(rxLTF,cbw,numSTS); chEst = wlanVHTLTFChannelEstimate(demod,cbw,numSTS);
Recover the bits from the received VHT-Data field for each user and determine the bit error rate by comparing the recovered bits with the original payload bits.
dataBits = wlanVHTDataRecover(rxDataSym,chEst,noiseVarEst,cfgVHT,userIdx);
[number(userIdx),ratio(userIdx)] = biterr(bits{userIdx},dataBits);
disp(number(userIdx))
disp(ratio(userIdx))
end
4232
0.5038
2434
0.0964
Recover Bits from VHT-Data Field Using Zero-Forcing Equalization
Recover bits from the VHT-Data field signal of a VHT transmission recovered from a SISO AWGN channel by using a zero-forcing equalization algorithm.
Configure a VHT transmission and generate the VHT-Data field for a random payload of bits.
cfgVHT = wlanVHTConfig('APEPLength',512);
psduLength = 8*cfgVHT.PSDULength;
bits = randi([0 1],psduLength,1);
txDataSig = wlanVHTData(bits,cfgVHT);
Pass the transmission through an AWGN channel.
snr = 10; rxDataSig = awgn(txDataSig,snr);
Recover the payload bits using a perfect channel estimate of all ones and zero-forcing equalization.
chEst = ones(242,1); noiseVarEst = 10^(-snr/10); [dataBits,crcBits,eqSym,cpe] = wlanVHTDataRecover(rxDataSig,chEst,noiseVarEst,... cfgVHT,'EqualizationMethod','ZF');
Verify that the recovered signal contains no bit errors.
number = biterr(bits,dataBits)
number = 0
Display the VHT-Data field CRC checksum bits.
disp(crcBits')
1 1 0 1 0 1 1 0
Calculate and display the maximum common phase error.
max(abs(cpe))
ans = 0.2172
Recover VHT-Data Field and Calculate Amplitude Error
Configure a VHT transmission with default parameters, then generate the corresponding VHT-Data field.
cfgVHT = wlanVHTConfig; psduLength = 8*cfgVHT.PSDULength; bits = randi([0 1],psduLength,1); tx = wlanVHTData(bits,cfgVHT);
Modify the signal by applying an amplitude droop of 10 dB, starting at the halfway point.
signalLength = size(tx,1); droopGain = 10; droopGainLinear = 10^(droopGain/20); txDroop = [ones(signalLength/2,1); droopGainLinear*ones(signalLength/2,1)].*tx;
Specify a channel estimate.
chEst = ones(242,1);
Recover the bits from the ideal and impaired VHT-Data fields and confirm that the recovered bits match the transmitted bits.
[databits_1,crcBits_1,eqSym_1,cpe_1,ae_1] = wlanVHTDataRecover(tx,chEst,0, ... cfgVHT,EqualizationMethod="ZF",PilotAmplitudeTracking="PreEQ"); [databits_2,crcBits_2,eqSym_2,cpe_2,ae_2] = wlanVHTDataRecover(txDroop,chEst,0 ... ,cfgVHT,EqualizationMethod="ZF",PilotAmplitudeTracking="PreEQ"); isequal(databits_1, databits_2, bits)
ans = logical
1
Plot the absolute value of the measured amplitude errors for the ideal and impaired VHT-Data fields.
plot(abs(ae_1)) title('Average amplitude error vs. OFDM symbol index') ylabel('Average amplitude error (dB)') xlabel('OFDM symbol index') ylim([-50 50]) hold on plot(abs(ae_2)) legend('Unmodified signal', 'Droop applied')
Input Arguments
rxDataSig
— Received VHT-Data field
complex-valued array
Received VHT-Data field, specified as a complex-valued array of size NS-by-NR.
NS is an integer greater than or equal to the number of time-domain samples.
NR is the number of receive antennas.
Note
The function processes one PPDU data field per entry. If you
specify NS as a value
greater than the field length, the function does not process
additional samples at the end of rxDataSig
. To
process a concatenated stream of PPDU data fields, you must call the
function multiple times.
Data Types: double
| single
Complex Number Support: Yes
chEst
— Channel estimate
complex-valued array
Channel estimate, specified as a complex-valued array of size NST-by-NSTS-by-NR.
NST is the number of occupied subcarriers, which depends on the
ChannelBandwidth
property of thecfgVHT
input in accordance with this table.Value of ChannelBandwidth
PropertyValue of NST 'CBW20'
56 'CBW40'
114 'CBW80'
242 'CBW160'
484 NSTS is the number of space-time streams, which must match the
NumSpacetimeStreams
property of thecfgVHT
input. For multi-user transmissions, NSTS is the total number of space-time streams for all users.NR is the number of receive antennas.
Data Types: double
| single
Complex Number Support: Yes
noiseVarEst
— Noise variance estimate
nonnegative scalar
Noise variance estimate, specified as a nonnegative scalar.
Data Types: double
| single
cfgVHT
— VHT transmission configuration
wlanVHTConfig
object
VHT transmission configuration, specified as a wlanVHTConfig
object.
userIdx
— User index
integer in the interval [1,
NUsers]
User index, specified as an integer in the interval [1, NUsers], where NUsers is the total number of users in the transmission.
numSTS
— Number of space-time streams
integer in the interval [1, 4] | row vector of integers in the interval [1, 4]
Number of space-time streams.
For a single-user transmission, specify this input as an integer in the interval [1, 4]
for a multi-user transmission, specify this input as a row vector of integers in the interval [1, 4] of length NUsers, where NUsers is the total number of users in the transmission.
Example: [1 3 2]
indicates the number of space-time streams in a three-user
transmission. In this case, the transmission allocates one, three, and two
space-time streams to the first, second, and third users,
respectively.
Note
The sum of the elements of this property must not exceed eight.
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.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Example: 'PilotPhaseTracking','None'
disables pilot phase
tracking.
OFDMSymbolOffset
— OFDM symbol sampling offset
0.75
(default) | scalar in the interval [0, 1]
OFDM symbol sampling offset represented as a fraction of the cyclic prefix (CP)
length, specified as the name-value pair 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
EqualizationMethod
— Equalization method
'MMSE'
(default) | 'ZF'
Equalization method, specified as the comma-separated pair consisting
of 'EqualizationMethod'
and 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.
Note
Specify this argument as 'ZF'
when either
of these conditions applies.
The
NumSpaceTimeStreams
property of thecfgVHT
input is1
.The
NumSpaceTimeStreams
andSTBC
properties of thecfgVHT
input are2
and1
(true
), respectively.
Data Types: char
| string
PilotPhaseTracking
— Pilot phase tracking
'PreEQ'
(default) | 'None'
Pilot phase tracking, specified as the name-value pair consisting of
'PilotPhaseTracking'
and 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
PilotAmplitudeTracking
— Pilot amplitude tracking
'None'
(default) | 'PreEQ'
Pilot amplitude tracking, specified as the comma-separated pair
consisting of 'PilotAmplitudeTracking'
and one of
these values.
'None'
— Disable pilot amplitude tracking.'PreEQ'
— Enable pilot amplitude tracking, which the function performs before any equalization operation.
Note
Due to the limitations of the algorithm used, disable pilot amplitude tracking when filtering a waveform through a MIMO fading channel.
Data Types: char
| string
LDPCDecodingMethod
— LDPC decoding algorithm
'bp'
(default) | 'layered-bp'
| 'norm-min-sum'
| 'offset-min-sum'
LDPC decoding algorithm, specified as the comma-separated pair
consisting of 'LDPCDecodingMethod'
and one of these values.
'bp'
— Use the belief propagation (BP) decoding algorithm. For more information, see Belief Propagation Decoding.'layered-bp'
— Use the layered BP decoding algorithm, suitable for quasi-cyclic parity check matrices (PCMs). For more information, see Layered Belief Propagation Decoding.'norm-min-sum'
— Use the layered BP decoding algorithm with the normalized min-sum approximation. For more information, see Normalized Min-Sum Decoding.'offset-min-sum'
— Use the layered BP decoding algorithm with the offset min-sum approximation. For more information, see Offset Min-Sum Decoding.
Note
When you specify this input as 'norm-min-sum'
or 'offset-min-sum'
, the function sets input
log-likelihood ratio (LLR) values that are greater than
1e10
or less than -1e10
to
1e10
and -1e10
,
respectively. The function then uses these values when executing the
LDPC decoding algorithm.
Dependencies
To enable this argument, set the
ChannelCoding
property of the
cfgVHT
input to 'LDPC'
for the user corresponding to the userIdx
input.
Data Types: char
| string
MinSumScalingFactor
— Scaling factor for normalized min-sum LDPC decoding
0.75
(default) | scalar in interval (0, 1]
Scaling factor for normalized min-sum LDPC decoding, specified as the name-value
argument consisting of MinSumScalingFactor
and a scalar in the
interval (0, 1].
Dependencies
To enable this argument, specify the
'
LDPCDecodingMethod
'
name-value argument as "norm-min-sum"
.
Data Types: double
MinSumOffset
— Offset for offset min-sum LDPC decoding
0.5
(default) | nonnegative scalar
Offset for offset min-sum LDPC decoding, specified as the name-value argument
consisting of MinSumOffset
and a nonnegative scalar.
Dependencies
To enable this argument, specify the
'
LDPCDecodingMethod
'
name-value argument as offset-min-sum
.
Data Types: double
MaximumLDPCIterationCount
— Maximum number of LDPC decoding iterations
12
(default) | positive integer
Maximum number of LDPC decoding iterations, specified as the
comma-separated pair consisting of
'MaximumLDPCIterationCount'
and a positive
integer.
Dependencies
To enable this argument, set the
ChannelCoding
property of the
cfgVHT
input to 'LDPC'
for the user corresponding to the userIdx
input.
Data Types: double
EarlyTermination
— Enable early termination of LDPC decoding
false
or
0
(default) | true
or 1
Enable early termination of LDPC decoding, specified as the
comma-separated pair consisting of 'EarlyTermination'
and 1
(true
) or
0
(false
).
When you set this value to
0
(false
), LDPC decoding completes the number of iterations specified by'MaximumLDPCIterationCount'
regardless of parity check status.When you set this value to
1
(true
), LDPC decoding terminates when all parity checks are satisfied.
Dependencies
To enable this argument, set the
ChannelCoding
property of the
cfgVHT
input to 'LDPC'
for the user corresponding to the userIdx
input.
Data Types: logical
Output Arguments
dataBits
— Bits recovered from VHT-Data field
binary-valued column vector
Bits recovered from the VHT-Data field, returned as a column vector of length 8×LPSDU, where LPSDU is the length of the PSDU in bytes.
Data Types: int8
crcBits
— VHT-SIG-B checksum bits
binary-valued column vector
VHT-SIG-B checksum bits, returned as a binary-valued column vector of length 8.
Data Types: int8
eqSym
— Equalized OFDM symbols
complex-valued array
Equalized OFDM symbols comprising the VHT-Data field, returned as a complex-valued array of size NSD-by-NSym-by-NSS.
NSD is the number of data subcarriers.
NSym is the number of OFDM symbols in the VHT-Data field.
NSS is the number of spatial streams. When the
STBC
property of thecfgVHT
input is0
(false
), NSS is equal to NSTS, the number of space-time streams in the transmission. When theSTBC
property of thecfgVHT
input is0
(false
), NSS is equal to NSTS/2.
Data Types: double
| single
Complex Number Support: Yes
cpe
— Common phase error
real-valued column vector
Common phase error between the received and expected OFDM symbols, in radians, returned as a real-valued column vector. The length of this output is NSym, the number of OFDM symbols in the VHT-Data field. This output is averaged over the receive antennas.
Data Types: double
| single
ae
— Average amplitude error
real-valued array
Average amplitude error, in dB, returned as a real-valued array of size NSym-by- NR.
NSym is the number of OFDM symbols in the VHT-Data field.
NR is the number of receive antennas.
Each element of this matrix contains the amplitude error for all subcarriers with respect to the estimated received pilots for the corresponding OFDM symbol and receive antenna.
Data Types: double
| single
More About
VHT-Data Field
The VHT-Data field carries one or more frames from the medium access control (MAC) layer. This field follows the VHT-SIG-B field in a VHT PPDU.
For a detailed description of the VHT-Data field, see section 21.3.10 of IEEE® Std 802.11™-2016. The VHT Data field consists 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 cyclic redundancy check (CRC) field
PSDU — Variable-length field containing a PLCP service data unit
PHY Pad — Variable number of bits passed to the transmitter to create a complete OFDM symbol
Tail — Bits required to terminate a convolutional code (not required when the transmission uses LDPC channel coding)
Algorithms
This function supports these four LDPC decoding algorithms.
Belief Propagation Decoding
The function implements the BP algorithm based on the decoding algorithm presented in [2]. For transmitted LDPC-encoded codeword , the input to the LDPC decoder is the LLR given by
.
In each iteration, the function updates the key components of the algorithm based on these equations:
,
, initialized as before the first iteration, and
.
At the end of each iteration, is an updated estimate of the LLR value for the transmitted bit, . The value is the soft-decision output for . If is negative, the hard-decision output for is 1. Otherwise, the output is 0.
Index sets and are based on the PCM such that the sets and correspond to all nonzero elements in column i and row j of the PCM, respectively.
This figure demonstrates how to compute these index sets for PCM for the case i = 5 and j = 3.
To avoid infinite numbers in the algorithm equations, atanh(1) and atanh(–1) are set to 19.07 and –19.07, respectively. Due to finite precision, MATLAB® returns 1 for tanh(19.07) and –1 for tanh(–19.07).
When you specify the
'
EarlyTermination
'
name-value pair argument as 0
(false
), the
decoding terminates after the number of iterations specified by the
'
MaximumLDPCIterationCount
'
name-value pair argument. When you specify the
'
EarlyTermination
'
name-value pair argument as 1
(true
), the
decoding terminates when all parity checks are satisfied () or after the number of iterations specified by the
'
MaximumLDPCIterationCount
'
name-value pair argument.
Layered Belief Propagation Decoding
The function implements the layered BP algorithm based on the decoding algorithm presented in Section II.A of [3]. The decoding loop iterates over subsets of rows (layers) of the PCM.
For each row, m, in a layer and each bit index, j, the implementation updates the key components of the algorithm based on these equations.
(1)
(2)
(3)
(4)
(5)
(6)
For each layer, the decoding equation (6) works on the combined input obtained from the current LLR inputs, , and the previous layer updates, .
Because the layered BP algorithm updates only a subset of the nodes in a layer, this algorithm is faster than the BP algorithm. To achieve the same error rate as attained with BP decoding, use half the number of decoding iterations when using the layered BP algorithm.
Normalized Min-Sum Decoding
The function implements the normalized min-sum decoding algorithm by following the layered BP algorithm with equation (3) replaced by
,
where α is the scaling factor specified by the
'
MinSumScalingFactor
'
name-value pair argument. This equation is an adaptation of equation (4) presented
in [4].
Offset Min-Sum Decoding
The function implements the offset min-sum decoding algorithm by following the layered BP algorithm with equation (3) replaced by
,
where β is the offset specified by the
'
MinSumOffset
'
name-value pair argument. This equation is an adaptation of equation (5) presented
in [4].
References
[1] IEEE Std 802.11-2020 (Revision of IEEE Std 802.11-2016). “Part 11: Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) Specifications.” IEEE Standard for Information Technology — Telecommunications and Information Exchange between Systems — Local and Metropolitan Area Networks — Specific Requirements.
[2] Gallager, Robert G. Low-Density Parity-Check Codes. Cambridge, MA: MIT Press, 1963.
[3] Hocevar, D.E. "A Reduced Complexity Decoder Architecture via Layered Decoding of LDPC Codes." In IEEE Workshop on Signal Processing Systems, 2004. SIPS 2004., 107-12. Austin, Texas, USA: IEEE, 2004. https://doi.org/10.1109/SIPS.2004.1363033.
[4] Jinghu Chen, R.M. Tanner, C. Jones, and Yan Li. "Improved Min-Sum Decoding Algorithms for Irregular LDPC Codes." In Proceedings. International Symposium on Information Theory, 2005. ISIT 2005., 449-53, 2005. https://doi.org/10.1109/ISIT.2005.1523374.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Version History
Introduced in R2015bR2024a: Single precision support
This function supports single-precision values for its numeric input arguments.
R2022b: Pilot amplitude tracking
You can perform pilot amplitude tracking by setting the
PilotAmplitudeTracking
input argument to
'PreEQ'
. The average amplitude error is returned in the
output argument ae
.
MATLAB-Befehl
Sie haben auf einen Link geklickt, der diesem MATLAB-Befehl entspricht:
Führen Sie den Befehl durch Eingabe in das MATLAB-Befehlsfenster aus. Webbrowser unterstützen keine MATLAB-Befehle.
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)