List2LLRSimple#
- class sionna.phy.mimo.List2LLRSimple(num_bits_per_symbol: int, llr_clip_val: float = 20.0, precision: Literal['single', 'double'] | None = None, device: str | None = None, **kwargs)[source]#
Bases:
sionna.phy.mimo.utils.List2LLRComputes LLRs from a list of candidate vectors (or paths) provided by a MIMO detector.
The following channel model is assumed:
\[\bar{\mathbf{y}} = \mathbf{R}\bar{\mathbf{x}} + \bar{\mathbf{n}}\]where \(\bar{\mathbf{y}}\in\mathbb{C}^S\) are the channel outputs, \(\mathbf{R}\in\mathbb{C}^{S\times S}\) is an upper-triangular matrix, \(\bar{\mathbf{x}}\in\mathbb{C}^S\) is the transmitted vector whose entries are uniformly and independently drawn from the constellation \(\mathcal{C}\), and \(\bar{\mathbf{n}}\in\mathbb{C}^S\) is white noise with \(\mathbb{E}\left[\bar{\mathbf{n}}\right]=\mathbf{0}\) and \(\mathbb{E}\left[\bar{\mathbf{n}}\bar{\mathbf{n}}^{\mathsf{H}}\right]=\mathbf{I}\).
It is assumed that a MIMO detector such as
KBestDetectorproduces \(K\) candidate solutions \(\bar{\mathbf{x}}_k\in\mathcal{C}^S\) and their associated distance metrics \(d_k=\lVert \bar{\mathbf{y}} - \mathbf{R}\bar{\mathbf{x}}_k \rVert^2\) for \(k=1,\dots,K\). This layer can also be used with the real-valued representation of the channel.The LLR for the \(i\text{th}\) bit of the \(k\text{th}\) stream is computed as
\[\begin{split}\begin{aligned} LLR(k,i) &= \log\left(\frac{\Pr(b_{k,i}=1|\bar{\mathbf{y}},\mathbf{R})}{\Pr(b_{k,i}=0|\bar{\mathbf{y}},\mathbf{R})}\right)\\ &\approx \min_{j \in \mathcal{C}_{k,i,0}}d_j - \min_{j \in \mathcal{C}_{k,i,1}}d_j \end{aligned}\end{split}\]where \(\mathcal{C}_{k,i,1}\) and \(\mathcal{C}_{k,i,0}\) are the set of indices in the list of candidates for which the \(i\text{th}\) bit of the \(k\text{th}\) stream is equal to 1 and 0, respectively. The LLRs are clipped to \(\pm LLR_\text{clip}\) which can be configured through the parameter
llr_clip_val.If \(\mathcal{C}_{k,i,0}\) is empty, \(LLR(k,i)=LLR_\text{clip}\); if \(\mathcal{C}_{k,i,1}\) is empty, \(LLR(k,i)=-LLR_\text{clip}\).
- Parameters:
num_bits_per_symbol (int) – Number of bits per constellation symbol
llr_clip_val (float) – The absolute values of LLRs are clipped to this value. Defaults to 20.0.
precision (Literal['single', 'double'] | None) – Precision used for internal calculations and outputs. If set to None,
precisionis used.device (str | None) – Device for computation. If None,
deviceis used.
- Inputs:
y – […, M], torch.complex or torch.float. Channel outputs of the whitened channel.
r – […, num_streams, num_streams], same dtype as
y. Upper triangular channel matrix of the whitened channel.dists – […, num_paths], torch.float. Distance metric for each path (or candidate).
path_inds – […, num_paths, num_streams], torch.int32. Symbol indices for every stream of every path (or candidate).
path_syms – […, num_paths, num_streams], same dtype as
y. Constellation symbol for every stream of every path (or candidate).
- Outputs:
llr – […, num_streams, num_bits_per_symbol], torch.float. LLRs for all bits of every stream.
Examples
list2llr = List2LLRSimple(num_bits_per_symbol=4) # Use with KBestDetector outputs
Attributes