comnum.Otfs#

class comnum.Otfs(n_fft, n_symbols, *, n_cp=0)#

Orthogonal time frequency space (Raviteja et al. 2019) with rectangular pulses: the symbols of the n_fft × n_symbols delay–Doppler grid (x[n * M + m], delay m, Doppler n) through the ISFFT and the Heisenberg transform, one cyclic prefix per frame.

Parameters:
  • n_fft (int) – delay bins M (subcarriers).

  • n_symbols (int) – Doppler bins N (symbols of a frame).

  • n_cp (int) – the cyclic prefix of a frame (samples).

Raises:

ValueError – for an invalid parameter (the message names it).

Examples

>>> import comnum, numpy as np
>>> o = comnum.Otfs(16, 8, n_cp=4)
>>> x = np.exp(2j * np.pi * np.arange(128) / 7)
>>> s = o.modulate(x)
>>> s.size == o.block_len, bool(np.allclose(o.demodulate(s), x))
(True, True)
demodulate(r)#

Demodulate whole frames: drop the prefix, DFT along the Doppler axis.

Parameters:

r (array_like) – a multiple of block_len samples.

Returns:

the delay–Doppler samples (complex128).

Return type:

numpy.ndarray

Raises:

ValueError – for an invalid parameter or input (the message names it).

effective_channel(paths, fs)#

The effective MN × MN delay–Doppler channel of paths (Raviteja et al. 2019, Theorem 1, eq. (12)), the prefix phase included.

Parameters:
  • paths (list[tuple[complex, int, float]]) – (gain, delay in samples, Doppler in Hz), as delay_doppler_paths draws them; the Doppler shifts must be whole bins ν M N / fs.

  • fs (float) – the sampling rate (Hz).

Returns:

(MN, MN) (complex128).

Return type:

numpy.ndarray

Raises:

ValueError – for an invalid parameter (the message names it).

modulate(x)#

Modulate whole frames of MN delay–Doppler symbols.

Parameters:

x (array_like) – the symbols, x[n * M + m] frame after frame.

Returns:

the samples, prefixes included (complex128).

Return type:

numpy.ndarray

Raises:

ValueError – for an invalid parameter or input (the message names it).

block_len#

Samples per frame, MN plus the prefix.

Type:

int

n_cp#

The cyclic prefix of a frame (samples).

Type:

int

n_fft#

Delay bins M.

Type:

int

n_symbols#

Doppler bins N.

Type:

int