diff --git a/sw/utility/encoders.py b/sw/utility/encoders.py index 06cd1af..f90b387 100644 --- a/sw/utility/encoders.py +++ b/sw/utility/encoders.py @@ -22,4 +22,5 @@ class Encoder: :param d: Dataword (element of [0, 1]^n) :return: Codeword (already element of [-1, 1]^n) """ + # TODO: (0 -> 1), (1 -> -1); Not (0 -> -1), (-1 -> 1) return np.dot(d, self._G) * 2 - 1 diff --git a/sw/utility/noise.py b/sw/utility/noise.py index f7831cd..992b4e8 100644 --- a/sw/utility/noise.py +++ b/sw/utility/noise.py @@ -14,6 +14,9 @@ def get_noise_amp_from_SNR(SNR: float, signal_amp: float = 1) -> float: SNR_linear = 10 ** (SNR / 10) noise_amp = (1 / np.sqrt(SNR_linear)) * signal_amp + # TODO: Fix noise amp calculation + # sigma**2 = 1 / (2 * (k/n) * (E_b/N_0)) + return noise_amp diff --git a/sw/utility/simulations.py b/sw/utility/simulations.py index 938cfed..95e210b 100644 --- a/sw/utility/simulations.py +++ b/sw/utility/simulations.py @@ -18,6 +18,7 @@ def count_bit_errors(d: np.array, d_hat: np.array) -> int: return np.sum(d != d_hat) +# TODO: Fix uses of n, k, a everywhere def test_decoder(encoder: typing.Any, decoder: typing.Any, d: np.array,