Skip to content

Commit

Permalink
mimo lmmse_equalizer: fix negative no_eff
Browse files Browse the repository at this point in the history
  • Loading branch information
japm48 committed Feb 4, 2024
1 parent 13bb9d7 commit 1e64165
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sionna/mimo/equalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"""Classes and functions related to MIMO channel equalization"""

import tensorflow as tf
import numpy as np
from sionna.utils import expand_to_rank, matrix_inv, matrix_pinv
from sionna.mimo.utils import whiten_channel

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

return x_hat, no_eff

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

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

0 comments on commit 1e64165

Please sign in to comment.