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_symbolsdelay–Doppler grid (x[n * M + m], delaym, Dopplern) through the ISFFT and the Heisenberg transform, one cyclic prefix per frame.- Parameters:
- 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_lensamples.- Returns:
the delay–Doppler samples (complex128).
- Return type:
- Raises:
ValueError – for an invalid parameter or input (the message names it).
- effective_channel(paths, fs)#
The effective
MN × MNdelay–Doppler channel of paths (Raviteja et al. 2019, Theorem 1, eq. (12)), the prefix phase included.- Parameters:
- Returns:
(MN, MN)(complex128).- Return type:
- Raises:
ValueError – for an invalid parameter (the message names it).
- modulate(x)#
Modulate whole frames of
MNdelay–Doppler symbols.- Parameters:
x (array_like) – the symbols,
x[n * M + m]frame after frame.- Returns:
the samples, prefixes included (complex128).
- Return type:
- Raises:
ValueError – for an invalid parameter or input (the message names it).