目录

Sionna MIMO 处理(mimo/):均衡、检测、预编码与流管理

MIMO 与检测
#Sionna#MIMO#检测#均衡

mimo/ 处理的是「空间维」:多天线之间怎么合并、怎么判决、怎么在发射端做预处理。模型统一写成

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

其中 y∈CNr\mathbf{y} \in \mathbb{C}^{N_r}、H∈CNr×Nt\mathbf{H} \in \mathbb{C}^{N_r \times N_t}、x∈CNt\mathbf{x} \in \mathbb{C}^{N_t}。

一、文件与职责

文件功能主要公开类/函数
__init__.pyMIMO 子包入口重导出 utils/equalization/detection/precoding/stream_management 的符号
equalization.pyMIMO 信道均衡lmmse_matrix、lmmse_equalizer、zf_equalizer、mf_equalizer
detection.pyMIMO 信道检测LinearDetector、MaximumLikelihoodDetector、KBestDetector、EPDetector、MMSEPICDetector
precoding.pyMIMO 发射预编码rzf_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 流管理StreamManagement(Object):决定哪个发射机向哪个接收机发送哪条流,提供 rx_tx_association、num_streams_per_tx 等属性
utils.pyMIMO 工具函数与层complex2real_vector/real2complex_vector、complex2real_matrix/real2complex_matrix、complex2real_covariance/real2complex_covariance、complex2real_channel/real2complex_channel、whiten_channel、List2LLR(抽象)、List2LLRSimple

三种均衡器

线性均衡的本质是找一个矩阵 W\mathbf{W} 使得 x^=Wy\hat{\mathbf{x}} = \mathbf{W}\mathbf{y}。三者区别只在 W\mathbf{W} 的取法:

均衡器W\mathbf{W}特点
MF(匹配滤波)HH\mathbf{H}^{\mathrm{H}}最大化单流 SNR,但忽略流间干扰
ZF(迫零)(HHH)−1HH(\mathbf{H}^{\mathrm{H}}\mathbf{H})^{-1}\mathbf{H}^{\mathrm{H}}完全消除干扰,低 SNR 下噪声放大严重
LMMSE(HHH+Rnn)−1HH(\mathbf{H}^{\mathrm{H}}\mathbf{H} + \mathbf{R}_{nn})^{-1}\mathbf{H}^{\mathrm{H}}在干扰抑制与噪声放大之间折中

LMMSE 是最常用的一个,它同时输出 no_eff(等效噪声方差),供后面的解调器计算 LLR 使用:

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}

这里的 Rnn\mathbf{R}_{nn} 是噪声(及干扰)协方差。之前单独写过一篇关于 Rnn\mathbf{R}_{nn} 逐 RB 估计与低秩结构的笔记(MMSE 均衡中的干扰协方差估计),那个矩阵怎么来、补噪声底的必要性,都记在那篇里。这里只强调一点:求逆的合法性完全依赖 Rnn+HHH\mathbf{R}_{nn} + \mathbf{H}^{\mathrm{H}}\mathbf{H} 正定,所以实践中总要加上小的对角扰动。

五种检测器

检测器输出形式适用场景
LinearDetector比特/符号均衡后解调,复杂度最低
MaximumLikelihoodDetector比特/符号穷举星座,性能最优但指数复杂度
KBestDetector比特/符号球译码类近似,k 控制保留候选数
EPDetector比特期望传播,大规模 MIMO 下性能与复杂度平衡好
MMSEPICDetector比特MMSE + 并行干扰消除的迭代检测

LinearDetector 内部就是「先均衡、再解调」两段,所以它可以直接指定 equalizer="lmmse" 与 demapping_method="app"。

二、使用示例

MIMO 均衡:

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)      # 噪声协方差

x_hat, no_eff = lmmse_equalizer(y, h, s)     # 亦可换 zf_equalizer / mf_equalizer

检测器:

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)

一个容易踩的坑

sionna.phy.mimo 和 sionna.phy.ofdm 下有同名检测器,但接口完全不同:

输入构造参数
mimo 版(y, h, s)只需星座与流数
ofdm 版(y, h_hat, err_var, no)还需 resource_grid 与 stream_management

ofdm 版多出来的 err_var 是信道估计误差方差,no 是噪声功率——因为 OFDM 场景下信道是估计出来的,误差必须显式传给检测器(见 OFDM 处理那篇)。

流管理:

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     # 单个接收机接收全部 4 个发射机的流
sm = StreamManagement(rx_tx_association, num_streams_per_tx)

rx_tx_association 是一个 [num_rx, num_tx] 的 0/1 矩阵,1 表示该接收机需要解调该发射机的流。上面这个例子是上行多用户:一个基站同时收 4 个用户。多小区干扰场景则把干扰小区的列置 0——被置 0 的流不会进入检测,而是作为干扰体现在噪声协方差里,这一点和前面提到的 Rnn\mathbf{R}_{nn} 直接相关。

预编码:

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]

rzf_precoder 的正则化系数 alpha 越大越接近匹配滤波(对信道误差更鲁棒),越小越接近迫零(干扰抑制更彻底)。grid_of_beams_dft 生成 DFT 码本的波束网格,常用于波束扫描与固定码本预编码。

复/实数域转换与信道白化:

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)     # 转实数域等价模型
yw, hw, sw = whiten_channel(y, h, s)           # 白化有色噪声

这两组函数是给检测器做前置处理的:实数域转换让复模型可以套用实值优化算法(EPDetector 这类就要求实值输入);白化则把有色噪声 n∼CN(0,Rnn)\mathbf{n} \sim \mathcal{CN}(0, \mathbf{R}_{nn}) 变成标准白噪声,W=Rnn−1/2\mathbf{W} = \mathbf{R}_{nn}^{-1/2}。List2LLRSimple 是把候选列表转成 LLR 的默认实现,自定义检测器时可以直接复用。

三、小结

  • equalization.py 的三个函数是无状态函数,直接可用,适合先跑通;
  • detection.py 的类是有状态的 Block,要 build,但性能上限依次抬升;
  • stream_management.py 决定「哪些流要解、哪些流当干扰」,是配置多用户/多小区场景的关键;
  • utils.py 的复实转换与白化是通用前置处理,读检测器源码时会频繁遇到。

评论

评论加载中…

    ← 返回首页