Added TODOs
This commit is contained in:
parent
6fc01b20ff
commit
bb31b53d98
@ -22,4 +22,5 @@ class Encoder:
|
|||||||
:param d: Dataword (element of [0, 1]^n)
|
:param d: Dataword (element of [0, 1]^n)
|
||||||
:return: Codeword (already element of [-1, 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
|
return np.dot(d, self._G) * 2 - 1
|
||||||
|
|||||||
@ -14,6 +14,9 @@ def get_noise_amp_from_SNR(SNR: float, signal_amp: float = 1) -> float:
|
|||||||
SNR_linear = 10 ** (SNR / 10)
|
SNR_linear = 10 ** (SNR / 10)
|
||||||
noise_amp = (1 / np.sqrt(SNR_linear)) * signal_amp
|
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
|
return noise_amp
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -18,6 +18,7 @@ def count_bit_errors(d: np.array, d_hat: np.array) -> int:
|
|||||||
return np.sum(d != d_hat)
|
return np.sum(d != d_hat)
|
||||||
|
|
||||||
|
|
||||||
|
# TODO: Fix uses of n, k, a everywhere
|
||||||
def test_decoder(encoder: typing.Any,
|
def test_decoder(encoder: typing.Any,
|
||||||
decoder: typing.Any,
|
decoder: typing.Any,
|
||||||
d: np.array,
|
d: np.array,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user