Demapper
Demapper class is used for demodulating the estimated “qam”, “bpsk” or “\(\frac{\pi}{2}\)-bpsk” symbols. The demapper supports two implementations
Max-log-MAP: Sub-optimal (3dB performance loss for AWGN channel) but has an order lower complexity than Log-MAP. It is configured using
demapping_method
= “maxlog”Log-MAP: Optimal performance for AWGN channels. It is configured using
demapping_method
= “app”
The decoder can be configured to return soft or hard output by using hard_out
flag. The demapper for “qam” methods is
imported from Sionna-demapper.
Important
When the output of demapper is passed to a channel coder or descrambler, the channel coder should be configured to either accept the hard inputs or the hard inputs must be converted to bipolar \(\{-1, 1\}\) format.
The demapping is performed as follows:
Log-MAP bpsk Demapper generating soft output:
demapMethod = "app" # Demapping method
constType = "bpsk" # Symbol mapping type
modOrder = 1 # Mordulation order or number of bits per symbol
hard_out = False # Whether to return hard output or soft output
# Symbol demapping object
demapper = Demapper(demapMethod, constType, modOrder, hard_out = hard_out)
llr = demapper([symbols, 1/snr]) # LLR Computation
Max-Log-MAP QAM Demapping generating hard output:
demapMethod = "maxlog" # Demapping method
constType = "qam" # Symbol mapping type
modOrder = 4 # Mordulation order or number of bits per symbol
hard_out = True # Whether to return hard output or soft output
# Symbol demapping object
demapper = Demapper(demapMethod, constType, modOrder, hard_out = hard_out)
bitEst = demapper([symbols, 1/snr]) # LLR Computation
The details about the input-output interface of the Symbol demapper detailed below.
- class toolkit5G.SymbolMapping.Demapper(*args, **kwargs)[source]
Generates the channel state information reference sequence (CSI-RS) for 5G system. The constructor expects scramblingID, slot index and, symbol index. The call method expect the length to be generated for the PRS and returns 1 or multiple CSI-RS based on the size of slot index and symbol index passed as input. The details about the implementation of the sequence are provided in section 7.4.1.7 of [3GPPTS38211_CSIRS].
- Parameters:
demapping_method (str) – Defines the demapping method \(\in \{\)“app”, “maxlog”}.
constellation_type (str) – Defines symbol modulation/mapping type \(\in \{\)“qam”,”bpsk”,”pi/2-bpsk”\(\}\).
num_bits_per_symbol (int) – Defines the modulation order (number of bits per symbol).
constellation (
sionna
constellation class) – Defines the sionna constellation class object. It is used for defining custom symbol mapping.hard_out (bool) – Defines the type of output demapper will return.
dtype (NumPy data type) – Defines the data type for the output. The type conversion is supported as per NumPy type conversion.
**kwargs (keyValue) – keyvalue pairs for Sionna Demapper.
- Input:
inputs ([…, numSymbols], np.complex64/np.complex128) – Define input symbols to be mapped to either log likelihood ratios or bits.
- Output:
[…, numSymbols*
num_bits_per_symbol
], np.float32 or np.int8 – Bit estimate (whenhard_out
is False) or log-likelihood (whenhard_out
is True)- Raises:
Exception – [Error-Demapper]: ‘inputs’ must be a list of length 2