Now using an R matrix for decoding in the soft decision decoder
This commit is contained in:
parent
0ea297ad45
commit
3e7dd37827
@ -9,14 +9,17 @@ class SoftDecisionDecoder:
|
|||||||
one with the largest correlation.
|
one with the largest correlation.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, G: np.array, H: np.array):
|
# TODO: What is the proper name for 'R'? Is it actually 'decoding matrix'?
|
||||||
|
def __init__(self, G: np.array, H: np.array, R: np.array):
|
||||||
"""Construct a new SoftDecisionDecoder object.
|
"""Construct a new SoftDecisionDecoder object.
|
||||||
|
|
||||||
:param G: Generator matrix
|
:param G: Generator matrix
|
||||||
:param H: Parity check matrix
|
:param H: Parity check matrix
|
||||||
|
:param R: Decoding matrix
|
||||||
"""
|
"""
|
||||||
self._G = G
|
self._G = G
|
||||||
self._H = H
|
self._H = H
|
||||||
|
self._R = R
|
||||||
self._datawords, self._codewords = self._gen_codewords()
|
self._datawords, self._codewords = self._gen_codewords()
|
||||||
self._codewords_bpsk = self._codewords * 2 - 1 # The codewords, but mapped to [-1, 1]^n
|
self._codewords_bpsk = self._codewords * 2 - 1 # The codewords, but mapped to [-1, 1]^n
|
||||||
|
|
||||||
@ -47,4 +50,4 @@ class SoftDecisionDecoder:
|
|||||||
"""
|
"""
|
||||||
correlations = np.dot(self._codewords_bpsk, y)
|
correlations = np.dot(self._codewords_bpsk, y)
|
||||||
|
|
||||||
return self._datawords[numpy.argmax(correlations)]
|
return np.dot(self._R, self._codewords[numpy.argmax(correlations)])
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user