comnum.msk_precode#

comnum.msk_precode(bits)#

The differential precoder of MSK: the bits b_1 … b_N give the boundary signs d_n = 2b_n - 1 (d_0 = +1) and the CPM symbols a_n = d_n d_{n+1}, as indices (a_n + 1)/2, so that the signal is OQPSK with half-sinusoid pulses carrying d_n (Proakis & Salehi, Sec. 3.3-2); the ML detector then has the BER of BPSK.

Parameters:

bits (array_like) – the information bits.

Returns:

the symbol indices for Cpm.modulate() (int64).

Return type:

numpy.ndarray

Raises:

ValueError – for bits that are not 0 or 1, or not a 1-D array.

Examples

>>> import comnum
>>> comnum.msk_precode([1, 1, 0, 0, 1]).tolist()
[1, 1, 0, 1, 0]