From cc855b89412edccce4b20e6a0511d9ca20105320 Mon Sep 17 00:00:00 2001 From: Andreas Tsouchlos Date: Mon, 7 Nov 2022 11:55:25 +0100 Subject: [PATCH] Formatting --- sw/decoders/__init__.py | 3 +-- sw/decoders/utility.py | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/sw/decoders/__init__.py b/sw/decoders/__init__.py index b3cda83..0bdd5f4 100644 --- a/sw/decoders/__init__.py +++ b/sw/decoders/__init__.py @@ -1,2 +1 @@ -"""This package contains a number of different decoder implementations for LDPC codes -""" \ No newline at end of file +"""This package contains a number of different decoder implementations for LDPC codes.""" diff --git a/sw/decoders/utility.py b/sw/decoders/utility.py index d4d3d4c..06ae46c 100644 --- a/sw/decoders/utility.py +++ b/sw/decoders/utility.py @@ -20,8 +20,8 @@ def _get_noise_amp_from_SNR(SNR: float, signal_amp: float = 1) -> float: def add_awgn(c: np.array, SNR: float, signal_amp: float = 1) -> np.array: - """Add Additive White Gaussian Noise to a data vector. As this function adds random noise to the input, - the output changes, even if it is called multiple times with the same input. + """Add Additive White Gaussian Noise to a data vector. As this function adds random noise to + the input, the output changes, even if it is called multiple times with the same input. :param c: Binary vector representing the data to be transmitted :param SNR: Signal-to-Noise-Ratio in dB @@ -78,8 +78,8 @@ def test_decoder(encoder: typing.Any, leave=False, bar_format="{l_bar}{bar}| {n_fmt}/{total_fmt}"): - # TODO: Is this a valid simulation? Can we just add AWGN to the codeword, ignoring and modulation and ( - # e.g. matched) filtering? + # TODO: Is this a valid simulation? Can we just add AWGN to the codeword, + # ignoring and modulation and (e.g. matched) filtering? y = add_awgn(x, SNR, signal_amp=np.sqrt(2)) y_hat = decoder.decode(y)