Skip to content

komm.BinarySequence

General binary sequence. It may be represented either in bit format, denoted by $b[n]$, with elements in the set $\{ 0, 1 \}$, or in polar format, denoted by $x[n]$, with elements in the set $\{ \pm 1 \}$. The correspondences $0 \mapsto +1$ and $1 \mapsto -1$ from bit format to polar format is assumed.

__init__

Constructor for the class. It expects exactly one the following parameters:

Parameters:

  • bit_sequence (Array1D[int])

    The binary sequence in bit format. Must be a 1D-array with elements in $\{ 0, 1 \}$.

  • polar_sequence (Array1D[int])

    The binary sequence in polar format. Must be a 1D-array with elements in $\{ \pm 1 \}$.

Examples:

>>> seq = komm.BinarySequence(bit_sequence=[0, 1, 1, 0])
>>> seq.bit_sequence
array([0, 1, 1, 0])
>>> seq.polar_sequence
array([ 1, -1, -1,  1])
>>> seq = komm.BinarySequence(polar_sequence=[1, -1, -1, 1])
>>> seq.bit_sequence
array([0, 1, 1, 0])
>>> seq.polar_sequence
array([ 1, -1, -1,  1])

bit_sequence property

The binary sequence in bit format, $b[n] \in \{ 0, 1 \}$.

polar_sequence property

The binary sequence in polar format, $x[n] \in \{ \pm 1 \}$.

length property

The length (or period) $L$ of the binary sequence.

autocorrelation

Returns the autocorrelation $R[\ell]$ of the binary sequence in polar format. See komm.autocorrelation for more details.

Parameters:

Returns:

  • autocorrelation (Array1D[complex])

    The autocorrelation $R[\ell]$ of the complex sequence.

Examples:

>>> seq = komm.BinarySequence(bit_sequence=[0, 1, 1, 0])
>>> seq.autocorrelation()
array([ 4, -1, -2,  1])

cyclic_autocorrelation

Returns the cyclic autocorrelation $\tilde{R}[\ell]$ of the binary sequence in polar format. See komm.cyclic_autocorrelation for more details.

Parameters:

Returns:

  • cyclic_autocorrelation (Array1D[complex])

    The cyclic autocorrelation $\tilde{R}[\ell]$ of the complex sequence.

Examples:

>>> seq = komm.BinarySequence(bit_sequence=[0, 1, 1, 0])
>>> seq.cyclic_autocorrelation()
array([ 4,  0, -4,  0])