Skip to content

Commit

Permalink
Add equations for differential codes
Browse files Browse the repository at this point in the history
  • Loading branch information
mhostetter committed Nov 19, 2023
1 parent 4eed74c commit b6f3921
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/sdr/_modulation/_symbol_encoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@

@export
def diff_encode(x: npt.ArrayLike, y_prev: int = 0) -> npt.NDArray[np.int_]:
"""
r"""
Differentially encodes the input data $x[k]$.
$$y[k] = x[k] \oplus y[k-1]$$
Args:
x: The input uncoded data $x[k]$.
y_prev: The previous value of the output encoded data $y[k-1]$.
Expand Down Expand Up @@ -66,9 +68,11 @@ def diff_encode(x: npt.ArrayLike, y_prev: int = 0) -> npt.NDArray[np.int_]:

@export
def diff_decode(y: npt.ArrayLike, y_prev: int = 0) -> npt.NDArray[np.int_]:
"""
r"""
Differentially decodes the input data $y[k]$.
$$x[k] = y[k] \oplus y[k-1]$$
Arguments:
y: The input encoded data $y[k]$.
y_prev: The previous value of the encoded data $y[k-1]$.
Expand Down

0 comments on commit b6f3921

Please sign in to comment.