Skip to content

Commit 1e64165

Browse files
committed
mimo lmmse_equalizer: fix negative no_eff
1 parent 13bb9d7 commit 1e64165

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sionna/mimo/equalization.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"""Classes and functions related to MIMO channel equalization"""
66

77
import tensorflow as tf
8+
import numpy as np
89
from sionna.utils import expand_to_rank, matrix_inv, matrix_pinv
910
from sionna.mimo.utils import whiten_channel
1011

@@ -139,6 +140,9 @@ def lmmse_equalizer(y, h, s, whiten_interference=True):
139140
# Compute residual error variance
140141
one = tf.cast(1, dtype=d.dtype)
141142
no_eff = tf.math.real(one/d - one)
143+
# Deal with negative or zero values due to numerical error.
144+
eps = np.finfo(d.dtype.as_numpy_dtype).eps
145+
no_eff += 4 * eps
142146

143147
return x_hat, no_eff
144148

@@ -353,3 +357,4 @@ def mf_equalizer(y, h, s):
353357

354358
no_eff = tf.abs(tf.linalg.diag_part(tf.matmul(i-gh, i-gh, adjoint_b=True) + gsg))
355359
return x_hat, no_eff
360+

0 commit comments

Comments
 (0)