Removed TODOs; Formatting; Changed test_decoder() default SNR array
This commit is contained in:
@@ -225,7 +225,6 @@ Gs = {'Hamming_7_4': np.array([[1, 0, 0, 0, 0, 1, 1],
|
||||
#
|
||||
|
||||
|
||||
# TODO: Are n and k switched around or correct?
|
||||
def get_systematic_H(G: np.array) -> np.array:
|
||||
"""Compute the H matrix for a systematic code.
|
||||
|
||||
@@ -239,8 +238,8 @@ 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, k + n - k))
|
||||
H[:, :k] = P.T
|
||||
H[:, k:] = np.identity(n-k)
|
||||
H[:, k:] = np.identity(n - k)
|
||||
|
||||
return H
|
||||
|
||||
@@ -20,7 +20,7 @@ def count_bit_errors(d: np.array, d_hat: np.array) -> int:
|
||||
|
||||
def test_decoder(x: np.array,
|
||||
decoder: typing.Any,
|
||||
SNRs: typing.Sequence[float] = np.linspace(1, 4, 7),
|
||||
SNRs: typing.Sequence[float] = np.linspace(1, 7, 7),
|
||||
target_bit_errors: int = 100,
|
||||
N_max: int = 10000) \
|
||||
-> typing.Tuple[np.array, np.array]:
|
||||
|
||||
Reference in New Issue
Block a user