Expand description
Timing and carrier-frequency synchronisation of OFDM (Schmidl & Cox 1997).
The preamble is an OFDM symbol whose odd subcarriers are empty: its useful part is two identical halves of $L = LN/2$ samples. With the received samples $r$, the correlation and the energy of the second half,
$$ P(d) = \sum_{m=0}^{L-1} r^{*}[d + m], r[d + m + L], \qquad R(d) = \sum_{m=0}^{L-1} |r[d + m + L]|^{2}, \qquad M(d) = \frac{|P(d)|^{2}}{R(d)^{2}}, $$
the timing metric $M(d)$ reaches a plateau of the length of the cyclic prefix at the start of the preamble; the phase of $P$ there gives the fractional carrier frequency offset, in units of the subcarrier spacing, $\hat\varepsilon = \angle P(\hat d) / \pi$ (an offset of $\varepsilon$ rotates the second half by $\pi\varepsilon$).
schmidl_cox returns the metric; synchronize the timing (the middle of the
points above PLATEAU_FRACTION of the peak, which lies in the cyclic prefix when
data follow the preamble) and the offset, the phase of the correlation $P$ that the
metric was computed from.
§A repeated symbol (Moose 1994)
When a block of $N$ = Ofdm::fft_len samples is sent twice in a row
(repeated_preamble), the DFTs $Y_{1k}$, $Y_{2k}$ of the two received blocks differ by
the phase $2\pi\varepsilon$ of the offset alone, and the maximum-likelihood estimate is
(Moose, eq. (21))
$$ \hat\varepsilon = \frac{1}{2\pi} \angle \sum_{k} Y_{2k} Y_{1k}^{*}, \qquad |\varepsilon| < \tfrac{1}{2}, $$
over the active subcarriers (moose); for small errors it is unbiased, of variance
$1/((2\pi)^{2} E_{s}/N_{0})$ with $E_{s}$ the energy of one block (eq. (26),
moose_std). An offset leaves on subcarrier $k$ the fraction
$\operatorname{diric}(2\pi\varepsilon/N, N)^{2}$ of its power and adds the interference
of the others (eq. (10), ici_power):
$$ \frac{E|I_{k}|^{2}}{|X|^{2}|H|^{2}} = \sum_{l \ne k} \left(\frac{\sin \pi\varepsilon}{N \sin(\pi(l - k + \varepsilon)/N)}\right)^{2} \le 0.5947 \sin^{2}\pi\varepsilon \quad (|\varepsilon| \le \tfrac{1}{2}), $$
hence the lower bound of the SNR after the DFT (eq. (15), cfo_snr_bound),
$\mathrm{SNR}(\varepsilon) \ge \mathrm{SNR}, (\sin\pi\varepsilon/\pi\varepsilon)^{2} /
(1 + 0.5947, \mathrm{SNR} \sin^{2}\pi\varepsilon)$.
§The cyclic prefix (van de Beek, Sandell & Börjesson 1997)
Without a preamble, the $L$ samples of the prefix and their copies $N$ samples later carry the timing and the offset. Over a window of $2N + L$ samples that contains one whole symbol, the joint maximum-likelihood estimates are (their eqs. (6)–(8), (12)–(13))
$$ \hat\theta = \arg\max_{\theta} \left{ |\gamma(\theta)| - \rho, \Phi(\theta) \right}, \qquad \hat\varepsilon = -\frac{1}{2\pi} \angle \gamma(\hat\theta), $$
with $\gamma(\theta) = \sum_{k=\theta}^{\theta+L-1} r(k), r^{*}(k + N)$, the energy
$\Phi(\theta) = \frac{1}{2} \sum_{k=\theta}^{\theta+L-1} |r(k)|^{2} + |r(k+N)|^{2}$ and
$\rho = \mathrm{SNR}/(\mathrm{SNR} + 1)$ (cp_ml: $\hat\theta$ is the first
sample of the prefix).
§Examples
use comnum_waveform::ofdm::Ofdm;
use comnum_waveform::ofdm::sync::{preamble, synchronize};
use comnum_core::rng::Rng;
use comnum_math::{cis, C64};
let ofdm = Ofdm { n_cp: 16, ..Ofdm::new(64, 52)? };
let p = preamble(&ofdm, 1)?; // with its prefix
// silence, the preamble, then a data symbol (random QPSK)
let mut r = Rng::new(4);
let data: Vec<C64> = (0..52).map(|_| cis(std::f64::consts::FRAC_PI_2 * r.below(4) as f64)).collect();
let mut rx = vec![C64::new(0.0, 0.0); 100];
rx.extend(&p);
rx.extend(ofdm.modulate(&data)?);
// an offset of 0.2 subcarrier spacing
let mut rx = rx;
comnum_dsp::signal::rotate(&mut rx, std::f64::consts::TAU * 0.2 / ofdm.fft_len() as f64, 0.0);
let e = synchronize(&rx, &ofdm)?;
assert!((e.cfo - 0.2).abs() < 1e-6);
assert!(e.timing >= 100 && e.timing <= 100 + 4 * 16); // within the prefix§References
- T. M. Schmidl and D. C. Cox, “Robust frequency and timing synchronization for OFDM,” IEEE Trans. Commun., 45(12), 1613–1621, 1997.
- P. H. Moose, “A technique for orthogonal frequency division multiplexing frequency offset correction,” IEEE Trans. Commun., 42(10), 2908–2914, 1994.
- J.-J. van de Beek, M. Sandell and P. O. Börjesson, “ML estimation of time and frequency offset in OFDM systems,” IEEE Trans. Signal Process., 45(7), 1800–1805, 1997.
- J. Armstrong, “Analysis of new and existing methods of reducing intercarrier interference due to carrier frequency offset in OFDM,” IEEE Trans. Commun., 47(3), 365–369, 1999.
Structs§
- Estimate
- A synchronisation estimate.
Constants§
- MOOSE_
ICI_ BOUND - The constant of Moose’s bound of the interference, eq. (13): $E|I_{k}|^{2} \le 0.5947 |X|^{2}|H|^{2} \sin^{2}\pi\varepsilon$ for $|\varepsilon| \le 1/2$.
- PLATEAU_
FRACTION - The fraction of the peak of the metric above which
synchronizecounts the points of its plateau (Schmidl & Cox 1997 average the two times, on either side of the maximum, at 90 % of it).
Functions§
- cfo_
coefficient - The weight $c_{d}$ with which, under a frequency offset
eps(in subcarrier spacings), the symbol of the subcarrier $d$ positions away reaches a subcarrier after the DFT of $N$ =npoints (Armstrong 1999, eq. (8); Moose 1994, eq. (8)): - cfo_
snr_ bound - Moose’s lower bound of the SNR of a subcarrier after the DFT under a frequency offset
eps(in subcarrier spacings), for an SNRsnr_lin(linear, $E_{c}/N_{0}$; infinite for the interference alone), eq. (15): $\mathrm{SNR},(\sin\pi\varepsilon/\pi\varepsilon)^{2} / (1 + 0.5947, \mathrm{SNR} \sin^{2}\pi\varepsilon)$ (linear). - cp_ml
- The joint maximum-likelihood timing and frequency offset of van de Beek, Sandell &
Börjesson (1997) from the cyclic prefix, for an SNR
snr_lin(linear) per sample: over every start $\theta$ such that the prefix and its copy lie inr(a window of $2N + L$ samples that contains one whole symbol), the maximum of $|\gamma(\theta)| - \rho\Phi(\theta)$ (delayed_correlationandwindowed_energy); the timing is the first sample of the prefix. - ici_
power - The power of the interference that a frequency offset
eps(in subcarrier spacings) brings onto the active subcarrierifrom the other active subcarriers, relative to the power of one subcarrier: Moose’s eq. (10), the sum of $|c_{l-k}|^{2}$ (cfo_coefficient) over the other active subcarriers $l$. - moose
- The frequency offset (in subcarrier spacings, $|\varepsilon| < 1/2$) of a block
repeated at
startandstart + Ninr, Moose’s eq. (21) over the active subcarriers (Ofdm::to_active). - moose_
std - The standard deviation of Moose’s estimate for small errors, $1/(2\pi\sqrt{E_{s}/N_{0}})$, with $E_{s}/N_{0}$ (linear) the energy of one block over the noise density (eq. (26)).
- preamble
- The preamble of Schmidl & Cox (with its cyclic prefix): QPSK on the even active subcarriers (scaled by $\sqrt{2}$ to keep the unit power), nothing on the odd ones.
- repeated_
preamble - The preamble of Moose (with its cyclic prefix): one block of QPSK on every active subcarrier, sent twice in a row, $L(N_{\mathrm{cp}} + 2N)$ samples.
- schmidl_
cox - The timing metric $M(d)$ for every start $d$ (halves of
halfsamples), ondelayed_correlationandwindowed_energy. - synchronize
- Estimate the timing and the frequency offset of the preamble of
ofdminr.