class sdr.BlockInterleaver(sdr.Interleaver)

Implements a block interleaver.

Notes

A block interleaver feeds the input down the columns of a \(R \times C\) matrix and then reads the output across the rows.

Examples

Create a \(3 \times 4\) block interleaver.

In [1]: interleaver = sdr.BlockInterleaver(3, 4)

In [2]: interleaver.map
Out[2]: array([ 0,  4,  8,  1,  5,  9,  2,  6, 10,  3,  7, 11])

In [3]: interleaver.inverse_map
Out[3]: array([ 0,  3,  6,  9,  1,  4,  7, 10,  2,  5,  8, 11])

Interleave and deinterleave a sequence.

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

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

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

Constructors

BlockInterleaver(rows: int, cols: int)

Creates a \(R \times C\) block 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}\).