Proximal decoder now return the decoded dataword instead of the codeword

This commit is contained in:
Andreas Tsouchlos 2022-11-07 14:07:46 +01:00
parent 3e7dd37827
commit 323b103d6f
2 changed files with 9 additions and 6 deletions

View File

@ -9,7 +9,7 @@ class SoftDecisionDecoder:
one with the largest correlation. one with the largest correlation.
""" """
# TODO: What is the proper name for 'R'? Is it actually 'decoding matrix'? # TODO: Is 'R' actually called 'decoding matrix'?
def __init__(self, G: np.array, H: np.array, R: np.array): def __init__(self, G: np.array, H: np.array, R: np.array):
"""Construct a new SoftDecisionDecoder object. """Construct a new SoftDecisionDecoder object.

View File

@ -5,20 +5,23 @@ class ProximalDecoder:
"""Class implementing the Proximal Decoding algorithm. See "Proximal Decoding for LDPC Codes" """Class implementing the Proximal Decoding algorithm. See "Proximal Decoding for LDPC Codes"
by Tadashi Wadayama, and Satoshi Takabe. by Tadashi Wadayama, and Satoshi Takabe.
""" """
# TODO: How large should K be?
# TODO: Is 'R' actually called 'decoding matrix'?
# TODO: How large should eta be? # TODO: How large should eta be?
# TODO: How large should step_size be? # TODO: How large should step_size be?
def __init__(self, H: np.array, K: int = 100, step_size: float = 0.5, gamma: float = 0.05, def __init__(self, H: np.array, R: np.array, K: int = 100, step_size: float = 0.5,
eta: float = 1.1): gamma: float = 0.05, eta: float = 1.1):
"""Construct a new ProximalDecoder Object. """Construct a new ProximalDecoder Object.
:param H: Parity Check Matrix :param H: Parity Check Matrix
:param R: Decoding matrix
:param K: Max number of iterations to perform when decoding :param K: Max number of iterations to perform when decoding
:param step_size: Step size for the gradient descent process :param step_size: Step size for the gradient descent process
:param gamma: Positive constant. Arises in the approximation of the prior PDF :param gamma: Positive constant. Arises in the approximation of the prior PDF
:param eta: Positive constant slightly larger than one. See 3.2, p. 3 :param eta: Positive constant slightly larger than one. See 3.2, p. 3
""" """
self._H = H self._H = H
self._R = R
self._K = K self._K = K
self._step_size = step_size self._step_size = step_size
self._gamma = gamma self._gamma = gamma
@ -92,7 +95,7 @@ class ProximalDecoder:
:param y: Vector of received values. (y = x + w, where 'x' is element of [-1, 1]^n :param y: Vector of received values. (y = x + w, where 'x' is element of [-1, 1]^n
and 'w' is noise) and 'w' is noise)
:return: Most probably sent symbol :return: Most probably sent dataword (element of [0, 1]^k)
""" """
s = 0 s = 0
x_hat = 0 x_hat = 0
@ -107,4 +110,4 @@ class ProximalDecoder:
if self._check_parity(x_hat): if self._check_parity(x_hat):
break break
return x_hat return np.dot(self._R, x_hat)