Formatting
This commit is contained in:
parent
2c620a77df
commit
cc855b8941
@ -1,2 +1 @@
|
||||
"""This package contains a number of different decoder implementations for LDPC codes
|
||||
"""
|
||||
"""This package contains a number of different decoder implementations for LDPC codes."""
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user