From 20049e55f039fe000104371b78ba1b6496efe7a6 Mon Sep 17 00:00:00 2001 From: Andreas Tsouchlos Date: Thu, 10 Nov 2022 11:27:29 +0100 Subject: [PATCH] Removed confusion relating to n and k --- sw/utility/codes.py | 2 +- sw/utility/simulations.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sw/utility/codes.py b/sw/utility/codes.py index af34ba0..efb6c66 100644 --- a/sw/utility/codes.py +++ b/sw/utility/codes.py @@ -238,7 +238,7 @@ def get_systematic_H(G: np.array) -> np.array: P = G[:, k:] - H = np.zeros(shape=(n - k, k + n - k)) + H = np.zeros(shape=(n - k, n)) H[:, :k] = P.T H[:, k:] = np.identity(n - k) diff --git a/sw/utility/simulations.py b/sw/utility/simulations.py index ab8ebbf..419c404 100644 --- a/sw/utility/simulations.py +++ b/sw/utility/simulations.py @@ -29,8 +29,8 @@ def test_decoder(n: int, This function assumes the all-zeros assumption holds. Progress is printed to stdout. - :param n: Length of a codeword of the used code (n_cols of the H-matrix) - :param k: Length of a dataword of the used code (n_rows of the H-matrix) + :param n: Length of a codeword of the used code + :param k: Length of a dataword of the used code :param decoder: Instance of the decoder to be tested :param SNRs: List of SNRs for which the BER should be calculated :param target_frame_errors: Number of frame errors after which to stop the simulation @@ -88,8 +88,8 @@ def test_decoders(n: int, This function assumes the all-zeros assumption holds. Progress is printed to stdout. - :param n: Length of a codeword of the used code (n_cols of the H-matrix) - :param k: Length of a dataword of the used code (n_rows of the H-matrix) + :param n: Length of a codeword of the used code + :param k: Length of a dataword of the used code :param decoders: List of decoder objects to be tested :param SNRs: List of SNRs for which the BER should be calculated :param target_frame_errors: Number of frame errors after which to stop the simulation