class sdr.Interleaver

Implements an arbitrary interleaver.

Examples

Create a length-4 interleaver with custom permutation map.

In [1]: pi = np.array([0, 3, 1, 2])

In [2]: interleaver = sdr.Interleaver(pi)

In [3]: interleaver.map
Out[3]: array([0, 3, 1, 2])

In [4]: interleaver.inverse_map
Out[4]: array([0, 2, 3, 1])

Interleave and deinterleave a sequence.

In [5]: x = np.arange(16); x
Out[5]: array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15])

In [6]: y = interleaver.interleave(x); y
Out[6]: array([ 0,  2,  3,  1,  4,  6,  7,  5,  8, 10, 11,  9, 12, 14, 15, 13])

In [7]: interleaver.deinterleave(y)
Out[7]: array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15])

Constructors

Interleaver(map: ArrayLike)

Creates an arbitrary interleaver.

Special methods

__len__() int

The size of the interleaver.

Methods

interleave(x: ArrayLike) NDArray

Interleaves the input sequence \(x[n]\).

deinterleave(y: ArrayLike) NDArray

Deinterleaves the input sequence \(y[n]\).

Properties

property map : NDArray[np.int_]

The interleaver permutation map \(\pi\).

property inverse_map : NDArray[np.int_]

The deinterleaver permutation map \(\pi^{-1}\).