sdr.diff_decode(y: ArrayLike, y_prev: int = 0) NDArray[int_]

Differentially decodes the input data \(y[k]\).

Parameters:
y: ArrayLike

The input encoded data \(y[k]\).

y_prev: int = 0

The previous value of the encoded data \(y[k-1]\).

Returns:

The differentially decoded data \(x[k]\).

Notes

Differential Decoder Block Diagram
           +------+  y[k-1]
y[k] --+-->| z^-1 |----------@--> x[k]
       |   +------+          ^
       |                     |
       +---------------------+

y[k] = Encoded data
x[k] = Decoded data
z^-1 = Unit delay
@ = Adder

Examples

In [1]: sdr.diff_decode([0, 1, 1, 1, 0, 1])
Out[1]: array([0, 1, 0, 0, 1, 1])

In [2]: sdr.diff_encode([0, 1, 0, 0, 1, 1])
Out[2]: array([0, 1, 1, 1, 0, 1])