Matrix inversion
Many signal processing algorithms are described using inverses and square roots of matrices. However, their actual computation is very rarely required and one should resort to alternatives in practical implementations instead. Below, we will describe two representative examples.
Solving linear systems
One frequently needs to compute equations of the form
and would be tempted to implement this equation in the following way:
# Create random example
x_ = tf.random.normal([10, 1])
h = tf.random.normal([10, 10])
y = tf.linalg.matmul(h, x_)
# Solve via matrix inversion
h_inv = tf.linalg.inv(h)
x = tf.linalg.matmul(h_inv, y)
A much more stable and efficient implementation avoids the inverse computation and solves the following linear system instead
which looks in code like this:
# Solve as linar system
x = tf.linalg.solve(h, y)
When
# Solve via Cholesky decomposition
l = tf.linalg.cholesky(h)
x = tf.linalg.cholesky_solve(l, y)
This is the recommended approach for solving linear systems that we use throughout Sionna.