Contents

Sionna MIMO Processing (mimo/): Equalization, Detection, Precoding, and Stream Management

MIMO & Detection
#Sionna#MIMO#detection#equalization

mimo/ deals with the “spatial dimension”: how to combine across multiple antennas, how to make decisions, and how to preprocess at the transmitter. The model is uniformly written as

y=Hx+n\mathbf{y} = \mathbf{H}\mathbf{x} + \mathbf{n}

where y∈CNr\mathbf{y} \in \mathbb{C}^{N_r}, H∈CNr×Nt\mathbf{H} \in \mathbb{C}^{N_r \times N_t}, and x∈CNt\mathbf{x} \in \mathbb{C}^{N_t}.

1. Files and Responsibilities

FileFunctionMain Public Classes/Functions
__init__.pyEntry point of the MIMO subpackageRe-exports symbols from utils/equalization/detection/precoding/stream_management
equalization.pyMIMO channel equalizationlmmse_matrix, lmmse_equalizer, zf_equalizer, mf_equalizer
detection.pyMIMO channel detectionLinearDetector, MaximumLikelihoodDetector, KBestDetector, EPDetector, MMSEPICDetector
precoding.pyMIMO transmit precodingrzf_precoding_matrix, rzf_precoder, cbf_precoding_matrix, grid_of_beams_dft_ula, grid_of_beams_dft, flatten_precoding_mat, normalize_precoding_power
stream_management.pyMIMO stream managementStreamManagement(Object): decides which transmitter sends which streams to which receiver, and exposes properties such as rx_tx_association and num_streams_per_tx
utils.pyMIMO utility functions and layerscomplex2real_vector/real2complex_vector, complex2real_matrix/real2complex_matrix, complex2real_covariance/real2complex_covariance, complex2real_channel/real2complex_channel, whiten_channel, List2LLR (abstract), List2LLRSimple

The Three Equalizers

A linear equalizer essentially looks for a matrix W\mathbf{W} such that x^=Wy\hat{\mathbf{x}} = \mathbf{W}\mathbf{y}. The three differ only in the choice of W\mathbf{W}:

EqualizerW\mathbf{W}Characteristics
MF (matched filter)HH\mathbf{H}^{\mathrm{H}}Maximizes the per-stream SNR but ignores inter-stream interference
ZF (zero forcing)(HHH)−1HH(\mathbf{H}^{\mathrm{H}}\mathbf{H})^{-1}\mathbf{H}^{\mathrm{H}}Eliminates interference completely, but severely amplifies noise at low SNR
LMMSE(HHH+Rnn)−1HH(\mathbf{H}^{\mathrm{H}}\mathbf{H} + \mathbf{R}_{nn})^{-1}\mathbf{H}^{\mathrm{H}}Trades off interference suppression against noise enhancement

LMMSE is the most commonly used one. It also outputs no_eff (the effective noise variance) for the downstream demapper to compute LLRs:

x^=(HHH+Rnn)−1HHy\hat{\mathbf{x}} = \left(\mathbf{H}^{\mathrm{H}}\mathbf{H} + \mathbf{R}_{nn}\right)^{-1}\mathbf{H}^{\mathrm{H}}\mathbf{y}

Here Rnn\mathbf{R}_{nn} is the noise (and interference) covariance. I previously wrote a separate note on per-RB estimation of Rnn\mathbf{R}_{nn} and its low-rank structure (Interference Covariance Estimation in MMSE Equalization)—where this matrix comes from and why the noise floor must be topped up are covered there. Here I only want to stress one point: the validity of the inverse depends entirely on Rnn+HHH\mathbf{R}_{nn} + \mathbf{H}^{\mathrm{H}}\mathbf{H} being positive definite, so in practice a small diagonal perturbation is always added.

The Five Detectors

DetectorOutput formatTypical use case
LinearDetectorBits/symbolsEqualize-then-demodulate, lowest complexity
MaximumLikelihoodDetectorBits/symbolsExhausts the constellation; best performance but exponential complexity
KBestDetectorBits/symbolsSphere-decoding-style approximation; k controls the number of retained candidates
EPDetectorBitsExpectation propagation; a good performance/complexity balance for massive MIMO
MMSEPICDetectorBitsIterative detection with MMSE + parallel interference cancellation

LinearDetector internally is just two stages, “equalize first, then demodulate”, so you can directly specify equalizer="lmmse" and demapping_method="app".

2. Usage Examples

MIMO equalization:

import torch
from sionna.phy.mimo import lmmse_equalizer, zf_equalizer, mf_equalizer

y = torch.complex(torch.randn(4), torch.randn(4))
h = torch.complex(torch.randn(4, 2), torch.randn(4, 2))
s = torch.eye(4, dtype=torch.complex64)      # Noise covariance

x_hat, no_eff = lmmse_equalizer(y, h, s)     # Can also switch to zf_equalizer / mf_equalizer

Detectors:

from sionna.phy.mimo import (LinearDetector, KBestDetector,
                             MaximumLikelihoodDetector, EPDetector)

detector = LinearDetector(equalizer="lmmse", output="bit",
                          demapping_method="app",
                          constellation_type="qam", num_bits_per_symbol=4)
llr = detector(y, h, s)

ml = MaximumLikelihoodDetector(output="bit", demapping_method="maxlog",
                               num_streams=2, constellation_type="qam",
                               num_bits_per_symbol=4)
kbest = KBestDetector(output="bit", num_streams=2, k=16,
                      constellation_type="qam", num_bits_per_symbol=4)

An Easy Pitfall

sionna.phy.mimo and sionna.phy.ofdm contain same-named detectors with completely different interfaces:

InputConstructor arguments
mimo version(y, h, s)Only the constellation and stream count
ofdm version(y, h_hat, err_var, no)Also requires resource_grid and stream_management

The extra err_var in the ofdm version is the channel-estimate error variance, and no is the noise power—because in an OFDM setting the channel is estimated, and the error must be passed to the detector explicitly (see the OFDM processing article).

Stream management:

import numpy as np
from sionna.phy.mimo import StreamManagement

num_tx, num_rx, num_streams_per_tx = 4, 1, 1
rx_tx_association = np.zeros([num_rx, num_tx])
rx_tx_association[0, :] = 1     # A single receiver receives streams from all 4 transmitters
sm = StreamManagement(rx_tx_association, num_streams_per_tx)

rx_tx_association is a [num_rx, num_tx] 0/1 matrix, where 1 means the receiver must demodulate that transmitter’s streams. The example above is uplink multi-user: one base station simultaneously receiving from 4 users. For multi-cell interference scenarios, set the columns of the interfering cells to 0—streams zeroed out do not enter detection; they show up as interference inside the noise covariance, which ties directly back to the Rnn\mathbf{R}_{nn} discussed earlier.

Precoding:

import torch
from sionna.phy.mimo import rzf_precoder, grid_of_beams_dft

x = torch.complex(torch.randn(4), torch.randn(4))
h = torch.complex(torch.randn(4, 8), torch.randn(4, 8))
x_precoded = rzf_precoder(x, h, alpha=0.1)        # [8]

gob = grid_of_beams_dft(num_ant_v=4, num_ant_h=8)  # [4, 8, 32]

For rzf_precoder, the larger the regularization coefficient alpha, the closer it gets to matched filtering (more robust to channel errors); the smaller, the closer to zero forcing (more thorough interference suppression). grid_of_beams_dft generates the beam grid of a DFT codebook, commonly used for beam sweeping and fixed-codebook precoding.

Complex/real domain conversion and channel whitening:

import torch
from sionna.phy.mimo import complex2real_channel, whiten_channel

y = torch.complex(torch.randn(4), torch.randn(4))
h = torch.complex(torch.randn(4, 2), torch.randn(4, 2))
s = torch.eye(4, dtype=torch.complex64) * 0.5
yr, hr, sr = complex2real_channel(y, h, s)     # Equivalent real-valued model
yw, hw, sw = whiten_channel(y, h, s)           # Whitens colored noise

These two groups of functions are front-ends for the detectors: the real-domain conversion lets complex models use real-valued optimization algorithms (detectors such as EPDetector require real-valued inputs); whitening turns colored noise n∼CN(0,Rnn)\mathbf{n} \sim \mathcal{CN}(0, \mathbf{R}_{nn}) into standard white noise with W=Rnn−1/2\mathbf{W} = \mathbf{R}_{nn}^{-1/2}. List2LLRSimple is the default implementation for converting candidate lists into LLRs and can be reused directly when writing a custom detector.

3. Summary

  • The three functions in equalization.py are stateless and immediately usable—the easiest place to start;
  • The classes in detection.py are stateful Blocks that must be build, but they raise the performance ceiling step by step;
  • stream_management.py decides “which streams to decode and which to treat as interference” and is the key to configuring multi-user/multi-cell scenarios;
  • The complex/real conversion and whitening in utils.py are generic front-end processing you will constantly run into when reading detector source code.

Comments

Loading comments…

    ← Back to home