Recover data bits from HE-Data field
recovers dataBits
= wlanHEDataBitRecover(rxDataSym
,noiseVarEst
,cfg
)dataBits
, the HE-Data bits in a high-efficiency single-user
(HE SU) transmission.
The function recovers dataBits
from
rxDataSym
, the equalized HE-Data OFDM symbols. The
cfg
input parameterizes the transmission, which is subject to noise
variance estimate noiseVarEst
.
returns the recovered data bits for the specified user of a high-efficiency multi-user (HE
MU) transmission, as determined by the user index dataBits
= wlanHEDataBitRecover(rxDataSym
,noiseVarEst
,cfg
,userIdx
)userIdx
.
specifies algorithm options by using one or more name-value pair arguments. When you do
not specify a name-value pair, the function uses the default value.dataBits
= wlanHEDataBitRecover(___,Name,Value
)
Recover the HE-Data field for an HE-SU-format packet by decoding the HE signaling fields, updating the unknown properties in the recovery configuration object, and passing the updated object into the HE-Data recovery function.
Create an HE-SU-format configuration object, specifying the MCS, and extract the channel bandwidth.
cfgHESU = wlanHESUConfig('MCS',0);
cbw = cfgHESU.ChannelBandwidth;
Generate a waveform for the specified configuration object.
bits = randi([0 1],8*getPSDULength(cfgHESU),1,'int8');
waveform = wlanWaveformGenerator(bits,cfgHESU);
Create a WLAN recovery configuration object, specifying the known channel bandwidth and an HE-SU-format packet.
cfgRx = wlanHERecoveryConfig('ChannelBandwidth',cbw,'PacketFormat','HE-SU');
Recover the HE signaling fields by retrieving the field indices and performing the relevant demodulation operations.
ind = wlanFieldIndices(cfgRx); heLSIGandRLSIG = waveform(ind.LSIG(1):ind.RLSIG(2),:); symLSIG = wlanHEDemodulate(heLSIGandRLSIG,'L-SIG',cbw); info = wlanHEOFDMInfo('L-SIG',cbw);
Merge the L-SIG and RL-SIG fields for diversity and obtain the data subcarriers.
symLSIG = mean(symLSIG,2); lsig = symLSIG(info.DataIndices,:);
Decode the L-SIG field, assuming a noiseless channel, and use the length field to update the recovery object.
[~,~,lsigInfo] = wlanLSIGBitRecover(lsig,0); cfgRx.LSIGLength = lsigInfo.Length;
Recover and demodulate the HE-SIG-A field, obtain the data subcarriers and recover the HE-SIG-A bits.
heSIGA = waveform(ind.HESIGA(1):ind.HESIGA(2),:);
symSIGA = wlanHEDemodulate(heSIGA,'HE-SIG-A',cbw);
siga = symSIGA(info.DataIndices,:);
[sigaBits,failCRC] = wlanHESIGABitRecover(siga,0);
Update the recovery configuration object with the recovered HE-SIG-A bits and obtain the updated field indices.
cfgRx = interpretHESIGABits(cfgRx,sigaBits); ind = wlanFieldIndices(cfgRx);
Retrieve and decode the HE-Data field.
heData = waveform(ind.HEData(1):ind.HEData(2),:); symData = wlanHEDemodulate(heData,'HE-Data', ... cbw,cfgRx.GuardInterval,[cfgRx.RUSize cfgRx.RUIndex]); infoData = wlanHEOFDMInfo('HE-Data',cbw,cfgRx.GuardInterval,[cfgRx.RUSize cfgRx.RUIndex]); data = symData(infoData.DataIndices,:,:); dataBits = wlanHEDataBitRecover(data,0,cfgRx);
Check that the returned data bits are the same as the transmitted data bits.
isequal(bits,dataBits)
ans = logical
1
Recover HE data from a single-user HE packet waveform transmitted though an AWGN channel.
cfgHE = wlanHESUConfig('MCS',11);
Generate a transmit waveform containing eight data packets.
msgLen = getPSDULength(cfgHE)*8;
txBits = randi([0 1],msgLen,1,'int8');
txWaveform = wlanWaveformGenerator(txBits,cfgHE);
Add noise to the waveform.
snr = 30; rxWaveform = awgn(txWaveform,snr);
Extract the data field.
ind = wlanFieldIndices(cfgHE); rxData = rxWaveform(ind.HEData(1):ind.HEData(2),:);
Assuming 20-MHz channel bandwidth and 3.2-microsecond guard interval, OFDM demodulate the received waveform and extract the data-carrying subcarriers.
Nfft = 256; % FFT length (20 MHz) Ncp = 64; % Cyclic prefix length (3.2 us at 20 MHz) pilotSC = [-116; -90; -48; -22; 22; 48; 90; 116]; % Pilot indices ruSC = [-122:-2 2:122].'; % Active subcarrier indices nullIdx = setdiff((-Nfft/2:(Nfft/2-1)).',ruSC)+Nfft/2+1; pilotIdx = pilotSC+Nfft/2+1; sf = (1/sqrt(numel(ruSC)))*Nfft; % Scaling factor rxSym = ofdmdemod(rxData,Nfft,Ncp,Ncp,nullIdx,pilotIdx)/sf;
Recover the data bits.
csi = ones(length(rxSym),1); % Assume CSI estimate of all ones nVar = 10^(-snr/10); % Noise variance rxBits = wlanHEDataBitRecover(rxSym,nVar,csi,cfgHE);
Compare the recovered bits to the original information bits.
disp(isequal(txBits,rxBits));
1
Decode the HE-Data field for each user in an OFDMA transmission.
Waveform Generation
Create a multiuser HE object and packet configuration.
allocationIndex = 96; % Two 106-tone RUs, two users, 20 MHz
cfg = wlanHEMUConfig(allocationIndex);
cfg.User{1}.MCS = 4;
cfg.User{2}.APEPLength = 1e3;
cfg.User{2}.MCS = 7;
Generate random data based on the specific PSDU length per user.
numUsers = numel(cfg.User); psduLength = getPSDULength(cfg); txBits = cell(1,numUsers); for i = 1:numUsers txBits{i} = randi([0 1],psduLength(i)*8,1); end
Generate an OFDMA waveform signal and add AWGN to the signal.
txWaveform = wlanWaveformGenerator(txBits,cfg); snr = 25; rxWaveform = awgn(txWaveform,snr);
Receiver Processing per User
Using the PPDU field indices structure, extract the HE-Data field for each user.
ind = wlanFieldIndices(cfg)
ind = struct with fields:
LSTF: [1 160]
LLTF: [161 320]
LSIG: [321 400]
RLSIG: [401 480]
HESIGA: [481 640]
HESIGB: [641 880]
HESTF: [881 960]
HELTF: [961 1280]
HEData: [1281 6720]
HEPE: [0x2 double]
rxData = rxWaveform(ind.HEData(1):ind.HEData(2),:);
For each user, OFDM demodulate and extract data-carrying subcarriers assuming 20-MHz channel bandwidth, and 3.2-microsecond guard interval for the appropriate resource unit (RU).
for userIdx = 1:numUsers Nfft = 256; % FFT length (20 MHz) Ncp = 64; % Cyclic prefix length (3.2 us at 20 MHz) pilotSC = [-116; -90; -48; -22; 22; 48; 90; 116]; % Pilot indices if userIdx==1 ruSC = (-122:-17).'; % Active subcarrier indices RU #1 else ruSC = (17:122).'; % Active subcarrier indices RU #2 end nullIdx = setdiff((-Nfft/2:(Nfft/2-1)).',ruSC)+Nfft/2+1; pilotIdx = pilotSC(ismember(pilotSC,ruSC))+Nfft/2+1; sf = (1/sqrt(2*numel(ruSC)))*Nfft; % Scaling factor rxSym = ofdmdemod(rxData,Nfft,Ncp,Ncp,nullIdx,pilotIdx)/sf; % Recover data bits and compare with transmitted csi = ones(length(rxSym),1); % Assume CSI estimate of all ones nVar = 10^(-snr/10); % Noise variance rxBits = wlanHEDataBitRecover(rxSym,nVar,csi,cfg,userIdx); disp(isequal(rxBits,txBits{userIdx})) end
1 1
Generate an HE TB packet, pass through an AWGN channel, then demodulate and recover the HE-Data field from the received waveform.
Generate a WLAN HE TB waveform in response to a frame containing the TRS control subfield.
cfgHE = getTRSConfiguration(wlanHETBConfig);
psduLength = 8*getPSDULength(cfgHE);
psdu = randi([0,1],psduLength,1,'int8');
waveform = wlanWaveformGenerator(psdu,cfgHE);
Pass the waveform through an AWGN channel with an SNR of 30 dB.
snr = 30; rxWaveform = awgn(waveform,snr);
Extract the data field from the received waveform.
ind = wlanFieldIndices(cfgHE); rxData = rxWaveform(ind.HEData(1):ind.HEData(2),:);
Demodulate the waveform and extract the data subcarriers.
demod = wlanHEDemodulate(rxData,'HE-Data',cfgHE); info = wlanHEOFDMInfo('HE-Data',cfgHE); rxDataSym = demod(info.DataIndices,:,:);
Recover the data bits subject to the specified estimates for CSI and noise variance, implementing normalized min-sum LDPC decoding.
csi = ones(length(rxDataSym),1); noiseVarEst = 10^(-snr/10); dataBits = wlanHEDataBitRecover(rxDataSym,noiseVarEst,csi,cfgHE,'LDPCDecodingMethod','norm-min-sum');
Confirm that the recovered information bits match the transmitted PSDU.
disp(isequal(dataBits,psdu))
1
rxDataSym
— Equalized HE-Data field OFDM symbolsEqualized HE-Data field OFDM symbols for a user, specified as an
NSD-by-NSym-by-NSS
complex-valued array. NSD is the number of
data subcarriers in the HE-Data field, NSym is
the number of OFDM symbols, and NSS is the
number of spatial streams. The contents and size of rxDataSym
depend on the HE PPDU format configuration.
Data Types: double
Complex Number Support: Yes
noiseVarEst
— Noise variance estimateNoise variance estimate, specified as a nonnegative scalar.
Data Types: double
csi
— Channel state informationChannel state information, specified as an NST-by-NSS real-valued matrix. NST is the number of subcarriers and NSS is the number of spatial streams.
Data Types: double
cfg
— HE format configurationwlanHESUConfig
object | wlanHEMUConfig
object | wlanHETBConfig
object | wlanHERecoveryConfig
objectHE format configuration, specified as an object of type wlanHESUConfig
,
wlanHEMUConfig
,
wlanHETBConfig
, or wlanHERecoveryConfig
.
userIdx
— User indexUser index, specified as an integer in the interval [1, 8].
Data Types: double
Specify optional
comma-separated pairs of Name,Value
arguments. Name
is
the argument name and Value
is the corresponding value.
Name
must appear inside quotes. You can specify several name and value
pair arguments in any order as
Name1,Value1,...,NameN,ValueN
.
'MaximumLDPCIterationCount','12','EarlyTermination','false'
specifies a maximum of 12 LDPC decoding iterations and disables early termination so that
the decoder completes the 12 iterations.'LDPCDecodingMethod'
— LDPC decoding algorithm'bp'
(default) | 'layered-bp'
| 'norm-min-sum'
| 'offset-min-sum'
LDPC decoding algorithm, specified as 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.
When you specify this input as 'norm-min-sum'
or
'offset-min-sum'
, the wlanHEDataBitRecover
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.
To enable this argument, specify the ChannelCoding
property
of the cfg
input as 'LDPC'
for the user
corresponding to the userIdx
input.
Data Types: char
| string
'MinSumScalingFactor'
— Scaling factor for normalized min-sum LDPC decoding0.75
(default) | scalar in the interval (0, 1]Scaling factor for normalized min-sum LDPC decoding, specified as a scalar in the interval (0, 1].
To enable this argument, specify the
'
LDPCDecodingMethod
'
name-value pair argument as 'norm-min-sum'
.
Data Types: double
'MinSumOffset'
— Offset for offset min-sum LDPC decoding0.5
(default) | nonnegative scalarOffset for offset min-sum LDPC decoding, specified as a nonnegative scalar.
To enable this argument, specify the
'
LDPCDecodingMethod
'
name-value pair argument as 'offset-min-sum'
.
Data Types: double
'MaximumLDPCIterationCount'
— Maximum number of LDPC decoding iterations12
(default) | positive integer'EarlyTermination'
— Enable early termination of LDPC decodingfalse
or 0
(default) | true
or 1
Enable early termination of LDPC decoding, specified as 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.
To enable this argument, specify the ChannelCoding
property
of the cfg
input as 'LDPC'
for the user
corresponding to the userIdx
input.
Data Types: logical
dataBits
— Recovered information bits in the HE-Data field1
| 0
| column vectorRecovered information bits in the HE-Data field, returned as an
8-by-LPSDU column vector, where
LPSDU is the PSDU length. You can determine
the PSDU length by using the getPSDULength
function.
Data Types: int8
The HE-Data field of the HE PPDU contains data for one or more users.
As described in [1], the number of OFDM symbols in the HE-Data field is determined by the length value of the legacy signal (L-SIG) field (see Equation (27-11)), the preamble duration and the settings of the GI+LTF Size, Pre-FEC Padding Factor, and PE Disambiguity fields in the HE-SIG-A field (see 27.3.10.7 (HE-SIG-A)).
Data symbols in an HE PPDU use a discrete Fourier transform (DFT) period of 12.8 μs and subcarrier spacing of 78.125 kHz.
Data symbols in an HE PPDU support guard interval durations of 0.8 μs, 1.6 μs, and 3.2 μs.
HE PPDUs have single stream pilots in the HE-Data field.
When BCC encoding is used, the HE-Data field consists of the SERVICE field, the PSDU, the pre-FEC PHY padding bits, the tail bits, and the post-FEC padding bits. Packet extension is assumed to be zero.
When LDPC encoding is used, the HE-Data field consists of the SERVICE field, the PSDU, the pre-FEC PHY padding bits, the post-FEC padding bits, and the packet extension. No tail bits are present when LDPC encoding is used.
For more information, see WLAN PPDU Structure and Build HE PPDU.
The wlanHEDataBitRecover
function supports these four LDPC decoding
algorithms.
The wlanHEDataBitRecover
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.
The wlanHEDataBitRecover
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.
The wlanHEDataBitRecover
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].
The wlanHEDataBitRecover
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].
[1] IEEE P802.11ax™/D4.1. “Part 11: Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) Specifications. Amendment 1: Enhancements for High Efficiency WLAN.” Draft 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.
wlanHEMUConfig
| wlanHERecoveryConfig
| wlanHESUConfig
| wlanHETBConfig
You have a modified version of this example. Do you want to open this example with your edits?