1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//! # comnum-waveform — time–frequency structures
//!
//! Waveforms carry mapped symbols, so this crate uses `comnum-mapping` (the sibling
//! dependency allowed by the architecture guide) and, for MIMO-OFDM, the detectors of
//! `comnum-mimo` (ADR 0009).
//!
//! | Module | Content |
//! |---|---|
//! | [`ofdm`] | OFDM and DFT-spread OFDM: oversampled modulator, cyclic prefix, demodulator; resource grid and pilots, LS/LMMSE channel estimation, Schmidl & Cox synchronisation, MIMO-OFDM detection |
//! | [`otfs`] | orthogonal time frequency space: ISFFT and Heisenberg transform with rectangular pulses and one prefix per frame, the sparse effective delay–Doppler channel (Raviteja et al. 2019) |
//! | [`papr`] | peak-to-average power ratio: theory of its distribution, clipping (Bussgang), and the reduction techniques (clipping and filtering, SLM, PTS, tone reservation, ACE, companding) |
//! | [`ce_ofdm`] | constant-envelope OFDM (Thompson et al. 2008): modulator, phase demodulator (principal or unwrapped phase), and the error rates of its linear regime |
//! | [`css`] | chirp spread spectrum (the frequency-shift chirp modulation of LoRa): modulator at any oversampling, noncoherent DFT receiver, exact error rates, cross-correlation, spectrum in Fresnel functions, same-SF interference (Chiani & Elzanaty 2019, Afisiadis et al. 2020) |
//! | [`fbmc`] | filter-bank multicarrier with offset QAM (FBMC/OQAM): PHYDYAS prototype, polyphase modulator and demodulator, OQAM staggering, intrinsic interference |
//! | [`ufmc`] | universal filtered multicarrier: OFDM filtered per sub-band by Dolph–Chebyshev filters, no prefix, receiver on the even bins of a DFT of twice the size (Schaich & Wild 2014) |
//! | [`cpm`] | continuous-phase modulation (CPFSK, MSK, GMSK, raised-cosine pulses): modulator with an exact phase state, coherent maximum-likelihood sequence detector, quadrature detector of MSK, differential detector, the MSK spectrum and the Gaussian pulse in closed form, minimum distance |
//!
//! # Conventions
//!
//! A modem is a configuration with public fields, built by a constructor (`new`, or
//! `Css::lora`), changed by struct update and checked by `check` when it is used, with
//! two exceptions: FBMC samples its prototype once in `new` and reads its fields through
//! getters, and CPM tabulates its phase response in `CpmConfig::build`. Every modem
//! implements `Modulate` and `Demodulate` of `comnum-core`, at its `sample_rate` (1 Hz by
//! default, time in samples), and refuses an input at another rate: those that map
//! complex symbols to samples (OFDM, UFMC, OTFS, CE-OFDM, FBMC) on `Symbols`, CSS and CPM,
//! which carry the index of a symbol, on `Labels` (`Modulate<Labels>`,
//! `docs/adr/0012-index-symbol-waveforms.md`). The vocabulary is shared: `n_fft` the size of the transform (the
//! subcarriers of the grid), `n_active` the modulated subcarriers, `n_cp` the cyclic
//! prefix, `block_len()` the samples of a block, prefix included. `oversampling` is the
//! number of samples per Nyquist-rate sample (OFDM, its prefix counted at the Nyquist
//! rate) or per chip (CSS); CE-OFDM folds it into its DFT size and counts its prefix in
//! samples of that DFT. The channels the waveforms cross are in `comnum-channel`.
//!
//! Single-carrier waveforms are planned (see `docs/ARCHITECTURE.md`).
use ;
use Hertz;
use ;
use C64;
/// `Ok` for a sample rate that is positive and finite.
pub
/// `Ok` if the signal `y` has one stream at the sample rate `rate` of the modem `what`:
/// the input check of the `Demodulate` blocks.
pub
/// The one stream of `x`, the input of a single-stream modulator `what` (an error with
/// several streams): the input check of the `Modulate` blocks.
pub