-
sdr.diff_encode(x: ArrayLike, y_prev: int =
0
) NDArray[int_] Differentially encodes the input data \(x[k]\).
\[y[k] = x[k] \oplus y[k-1]\]Notes
x[k] -->@--------------+--> y[k] ^ | | +------+ | y[k-1] +---| z^-1 |<--+ +------+ x[k] = Input data y[k] = Encoded data z^-1 = Unit delay @ = Adder
Examples
In [1]: sdr.diff_encode([0, 1, 0, 0, 1, 1]) Out[1]: array([0, 1, 1, 1, 0, 1]) In [2]: sdr.diff_decode([0, 1, 1, 1, 0, 1]) Out[2]: array([0, 1, 0, 0, 1, 1])