Algorithmadvanced
Common phase error correction
Also called CPE correction.
Estimates from pilot subcarriers the rotation that phase noise gives to all subcarriers of an OFDM symbol, and removes it before the one-tap equalizer.
- Solves
- Carrier recovery
- Time
- O(N + P) worst
- Space
- O(N) extra
- Where
- N = the number of subcarriers; P = the number of pilot subcarriers
- Model
- Real RAM
- Properties
- data aideddeterministicexact for constant phasenot removes ici
- Evidence
- Proof sketchCode in 1 languages
- Origin
- Patrick Robertson, Stefan Kaiser, 1995
Common phase error correction removes the part of oscillator phase noise that an OFDM receiver can remove cheaply. Phase noise multiplies time sample by . After the DFT, every subcarrier is scaled by the same complex factor , the mean of over the symbol, and receives some inter-carrier interference from the others. The angle of is the common phase error (CPE). It changes from symbol to symbol, so the channel estimate of an earlier symbol does not include it. The receiver knows the pilot values and the channel , so it adds up over the pilots, takes the angle of the sum, and rotates every subcarrier back by it before the one-tap equalizer. A constant phase is removed exactly; for slowly varying phase noise most of the error is removed, and the interference part, of power , stays. The page uses for the imaginary unit and the unitary DFT pair of the OFDM page.
In plain words
The local oscillator of a receiver does not hold a perfectly steady phase; it wanders a little all the time. Over one OFDM symbol, most of that wander acts as one twist of the whole symbol: every subcarrier is turned by the same angle. The rest smears a little energy between subcarriers. The twist alone would make many decisions wrong, but it is easy to fix. A few subcarriers carry known pilots, so the receiver checks how far they have turned, averages that over the pilots, and turns the whole symbol back. The smear cannot be fixed this way, but it is small when the oscillator is good.
The problem
The input is one received OFDM symbol after the DFT, , the channel on every subcarrier (known from an earlier estimate), and the pilot subcarriers with their known values . The model is with , an unknown phase noise and white noise . Output the equalized values , with an estimate of .
The algorithm
CPE-CORRECT(Y, H, pilots, X_p)- 1
C ← Σ_{p in pilots} Y[p] conj(H[p] X_p) - 2
φ̂ ← angle(C) - 3
Z[k] ← Y[k] e^(-j φ̂) / H[k] for k = 0, .., N-1 - 4
return Z
Line L1 correlates the received pilots with what they would be without phase noise. Each term is plus interference and noise, so all terms point in the direction of , weighted by the pilot power. Line L2 takes the angle. Line L3 rotates every subcarrier back and divides by the channel. The pilots in line L1 are the same kind as those used for comb pilot channel estimation; 802.11a, for example, sends four pilot subcarriers in every symbol for this kind of phase tracking.
Example
Take , pilots on subcarriers 2, 6, 10, 14, the channel taps , random 4-QAM values (seed 4), no noise, and Wiener phase noise that starts at rad with steps of variance per sample. Over the symbol, moves between and rad, and , with and the angle rad.
| pilot | angle (rad) | ||
|---|---|---|---|
| 2 | 1.407 | 0.734 | |
| 6 | 1.407 | 0.706 | |
| 10 | 0.473 | 0.622 | |
| 14 | 0.473 | 0.745 |
Line L1 gives , and line L2 gives rad, rad from the angle of ; the difference is the interference on the pilots. Before the correction, the equalized data values are to away from the sent points, which is close to the decision boundary for 4-QAM at a rotation of about degrees: subcarrier 0, sent as , gives . After line L3 the errors are to , and subcarrier 0 gives .
At with 8 pilots, a step variance of , a random start phase and , the tests count the wrong 4-QAM decisions on 5600 data subcarriers (100 symbols, seed 3): 4091 without correction, 1 with CPE correction, and 0 with the true angle of .
Correctness
Claim. (a) Each subcarrier after the DFT is plus inter-carrier interference and noise, with the same for all . (b) For a constant phase and no noise, line L2 returns and line L3 returns the sent values exactly. (c) For a fixed phase noise and independent zero-mean unit-modulus subcarrier values, , so the estimate points at the angle of on average. (d) For Wiener phase noise with step variance , , and the interference power that the correction cannot remove is for a channel with . Parts (a) to (d) are theorems; the size of the spread of around the angle of is measured, not proved.
Key invariant. The factor multiplies every subcarrier, so after line L3 every subcarrier carries the same residual factor , which is real and positive when .
Part (a) follows by putting the expansion of the channel output in subcarriers into the DFT. Part (d) uses that is Gaussian with variance , and Parseval, . The full proof is below.
Proof: Phase noise scales every subcarrier by the same factor I_0, the pilot correlation points in its direction on average, and a constant phase is removed exactlyfull
Notation. subcarriers, the imaginary unit, the unitary DFT pair with , and . The cyclic prefix covers the channel, so inside the DFT window the channel output is the circular convolution of the taps with the symbol . The oscillator adds the phase to sample , and the noise is white , so the window holds . Let
The pilots are the subcarriers with known values , and the receiver knows . Lines L1 and L2 compute and .
Lemma 1 (the received subcarriers). , with indices modulo and white .
Proof. By the convolution theorem for the unitary pair, . Then
and the inner sum is . A unitary map keeps white Gaussian noise white with the same variance.
The factor is the same for every subcarrier. Its angle is the common phase error, and its size is at most 1 by the triangle inequality. The sum over is inter-carrier interference.
Lemma 2 (Parseval for the factors). .
Proof. is applied to the vector , whose squared norm is . A unitary map keeps the norm, so the squared norm of is .
So with and independent unit-energy data, the interference on a subcarrier has the power , which a common rotation cannot remove.
Theorem 1 (a constant phase is removed exactly). If for all , , there is no noise, and for some pilot, then , and line L3 returns on every subcarrier with .
Proof. and for . By Lemma 1, , so with a positive sum, and . Line L3 computes .
Theorem 2 (the pilot sum points at I_0 on average). Fix . Let all subcarrier values, the pilot values included, be independent with zero mean, and let . Then
so .
Proof. By Lemma 1, . The first term is . In the second, for by independence and zero mean. In the third, has zero mean and is independent of the data.
Theorem 2 says that the estimate is aimed at the right angle; the spread around it comes from the interference and the noise on the pilots, and it shrinks as the number of pilots grows, because adds the pilots coherently and the disturbances incoherently. This is a heuristic statement about the spread; the tests measure its effect on symbol errors.
Theorem 3 (the power left in I_0 for Wiener phase noise). Let be independent , the Wiener model of an oscillator. Then
Proof. , and is a sum of independent steps, so it is , whose characteristic function at 1 is . For the expansion, and , so the sum is .
For and , the closed form is close to , so about 2 percent of the power becomes interference that line L3 cannot remove, and the rest is the common rotation that it does remove.
Complexity
Line L1 costs for pilots, line L2 is , and line L3 costs , so the time is per symbol after the DFT, with extra space for the output in the real RAM. This is negligible next to the FFT.
Properties
- Exact for a constant phase. A phase offset that is the same over the symbol, such as a residual carrier phase, is removed exactly without noise.
- Removes the common part only. The interference power stays. For and a step variance of , it is about percent of the power, a signal to interference ratio of about 17 dB.
- Weighted average. Line L1 weights each pilot by , so pilots in deep fades count little, as they should.
- Residual frequency offset. A small residual frequency offset gives a phase that grows from symbol to symbol; CPE correction removes it symbol by symbol, apart from its small interference part.
- Needs the channel. Line L1 uses ; if the channel estimate itself was made from pilots in the same symbol, the CPE is already inside it, and the correction does nothing more.
Variants and improvements
- Tracking across symbols. The CPE of successive symbols is correlated, so a phase-locked loop or a Kalman filter over the estimates of line L2 reduces their noise.
- Decision-directed. After a first decision, all data subcarriers can join the sum of line L1 as if they were pilots, which reduces the noise of the estimate at a high SNR.
- ICI suppression. Estimating a few of the factors near and equalizing with a short filter across subcarriers removes part of the interference, at a higher cost.
- Pilot design. 5G NR adds phase tracking reference signals for high carrier frequencies, where phase noise is stronger.
- Joint with the channel. When the channel is estimated in the same symbol, the CPE is part of the estimate, and only the symbols between pilot symbols need the correction.
When to use it
Use CPE correction in every OFDM receiver whose channel estimate comes from earlier symbols, such as a preamble, and whose oscillator has noticeable phase noise, as in Wi-Fi, DVB-T and millimeter wave systems. It costs a few pilots and a few operations per symbol. When the phase noise bandwidth is a large fraction of the subcarrier spacing, CPE correction is not enough and interference suppression, or a larger subcarrier spacing, is needed.
Pitfalls
- Conjugating the received value. Line L1 must use . With the angle has the wrong sign, and line L3 doubles the error instead of removing it.
- Averaging the angles. Line L2 must take the angle of the complex sum from line L1. Taking the angle of each pilot term and averaging gives weak pilots too much weight and fails near .
- Rotating the wrong way. Line L3 must multiply by , not .
- Ignoring the interference. CPE correction cannot remove the interference part, so a design must not expect error-free symbols from a poor oscillator; the remaining sets a floor on the SINR.
- Few pilots in deep fades. If all pilots of a symbol fall in fades, the sum of line L1 is small and its angle is noisy. Spreading the pilots across the band avoids this.
Implementations
Each implementation follows the pseudocode above. A comment @line links a line of code to a line of the pseudocode. Point at a line of the pseudocode to see the matching code. The build runs the native tests of each language.
# SPDX-License-Identifier: MIT
# Shared helper of the communications pages of https://algorithm.tamnd.com/. The authors are listed in prov/.
"""Complex baseband tools for the communications pages.
Vectors are lists of complex numbers. Matrices are lists of rows. The
functions here are plain building blocks: small linear algebra, convolution,
the DFT as a direct sum, the Gaussian Q function, dB conversion, complex
Gaussian noise and the Wilson score interval. No page algorithm (equalizer,
estimator, synchronizer, detector, precoder, demapper or power allocation)
lives in this file.
Conventions (prompts of the communications area):
- dft is X[k] = sum_n x[n] e^(-j 2 pi k n / N) with no factor; idft has 1/N.
- udft and uidft are the unitary pair, with 1/sqrt(N) on both sides.
- qfunc(x) = 0.5 erfc(x / sqrt(2)); it never computes 1 - Phi(x).
- cn(rng, var) draws CN(0, var): real and imaginary parts are independent
with variance var / 2 each, so E|w|^2 = var.
"""
import cmath
import math
import random
# ---------------------------------------------------------------- vectors and matrices
def zeros(rows: int, cols: int | None = None) -> list:
"""A zero vector of length rows, or a rows by cols zero matrix."""
if cols is None:
return [0j] * rows
return [[0j] * cols for _ in range(rows)]
def eye(n: int) -> list[list[complex]]:
"""The n by n identity matrix."""
return [[1 + 0j if i == k else 0j for k in range(n)] for i in range(n)]
def add(a: list, b: list) -> list:
"""Elementwise a + b for two vectors or two matrices of the same shape."""
if len(a) != len(b):
raise ValueError("shapes differ")
if a and isinstance(a[0], list):
return [add(r, s) for r, s in zip(a, b)]
return [x + y for x, y in zip(a, b)]
def sub(a: list, b: list) -> list:
"""Elementwise a - b for two vectors or two matrices of the same shape."""
if len(a) != len(b):
raise ValueError("shapes differ")
if a and isinstance(a[0], list):
return [sub(r, s) for r, s in zip(a, b)]
return [x - y for x, y in zip(a, b)]
def scale(c: complex, a: list) -> list:
"""The scalar c times a vector or a matrix."""
if a and isinstance(a[0], list):
return [scale(c, r) for r in a]
return [c * x for x in a]
def matmul(a: list[list[complex]], b: list[list[complex]]) -> list[list[complex]]:
"""The matrix product a b."""
if not a or not b or len(a[0]) != len(b):
raise ValueError("inner dimensions differ")
cols = list(zip(*b))
return [[sum(x * y for x, y in zip(row, col)) for col in cols] for row in a]
def matvec(a: list[list[complex]], x: list[complex]) -> list[complex]:
"""The matrix times vector product a x."""
if a and len(a[0]) != len(x):
raise ValueError("inner dimensions differ")
return [sum(p * q for p, q in zip(row, x)) for row in a]
def herm(a: list) -> list:
"""The conjugate transpose of a matrix. A vector gives its conjugate."""
if a and isinstance(a[0], list):
return [[complex(a[i][k]).conjugate() for i in range(len(a))] for k in range(len(a[0]))]
return [complex(x).conjugate() for x in a]
def dot(x: list[complex], y: list[complex]) -> complex:
"""The inner product x^H y = sum of conj(x_i) y_i."""
if len(x) != len(y):
raise ValueError("lengths differ")
return sum(complex(p).conjugate() * q for p, q in zip(x, y))
def norm2(x: list) -> float:
"""The squared Euclidean norm sum |x_i|^2 (squared Frobenius norm for a matrix)."""
if x and isinstance(x[0], list):
return sum(norm2(r) for r in x)
return sum(abs(v) ** 2 for v in x)
# ---------------------------------------------------------------- linear systems
def _lu(a: list[list[complex]]) -> tuple[list[list[complex]], list[int], int]:
"""LU factorization with partial pivoting. Returns (lu, perm, sign)."""
n = len(a)
if any(len(r) != n for r in a):
raise ValueError("matrix is not square")
m = [[complex(v) for v in r] for r in a]
perm = list(range(n))
sign = 1
for k in range(n):
p = max(range(k, n), key=lambda i: abs(m[i][k]))
if abs(m[p][k]) == 0.0:
raise ValueError("matrix is singular")
if p != k:
m[k], m[p] = m[p], m[k]
perm[k], perm[p] = perm[p], perm[k]
sign = -sign
for i in range(k + 1, n):
f = m[i][k] / m[k][k]
m[i][k] = f
if f != 0:
rk, ri = m[k], m[i]
for c in range(k + 1, n):
ri[c] -= f * rk[c]
return m, perm, sign
def _lu_solve(lu: list[list[complex]], perm: list[int], b: list[complex]) -> list[complex]:
n = len(lu)
y = [complex(b[perm[i]]) for i in range(n)]
for i in range(n):
for c in range(i):
y[i] -= lu[i][c] * y[c]
for i in range(n - 1, -1, -1):
for c in range(i + 1, n):
y[i] -= lu[i][c] * y[c]
y[i] /= lu[i][i]
return y
def solve(a: list[list[complex]], b: list) -> list:
"""Solve a x = b by Gaussian elimination with partial pivoting.
b is a vector, or a matrix whose columns are right-hand sides.
Raises ValueError if a is singular.
"""
lu, perm, _ = _lu(a)
if b and isinstance(b[0], list):
cols = [list(c) for c in zip(*b)]
xs = [_lu_solve(lu, perm, c) for c in cols]
return [list(r) for r in zip(*xs)]
if len(b) != len(a):
raise ValueError("lengths differ")
return _lu_solve(lu, perm, b)
def inv(a: list[list[complex]]) -> list[list[complex]]:
"""The inverse of a square matrix."""
return solve(a, eye(len(a)))
def det(a: list[list[complex]]) -> complex:
"""The determinant of a square matrix (0 for a singular matrix)."""
try:
lu, _, sign = _lu(a)
except ValueError as e:
if "singular" in str(e):
return 0j
raise
d = complex(sign)
for i in range(len(lu)):
d *= lu[i][i]
return d
def cholesky(a: list[list[complex]]) -> list[list[complex]]:
"""The lower triangular L with a = L L^H, for a Hermitian positive definite a.
Raises ValueError if a is not positive definite (to rounding).
"""
n = len(a)
low = zeros(n, n)
for i in range(n):
for k in range(i + 1):
s = complex(a[i][k]) - sum(low[i][c] * low[k][c].conjugate() for c in range(k))
if i == k:
if s.real <= 0.0:
raise ValueError("matrix is not positive definite")
low[i][i] = complex(math.sqrt(s.real))
else:
low[i][k] = s / low[k][k].real
return low
# ---------------------------------------------------------------- convolution and the DFT
def conv(a: list[complex], b: list[complex]) -> list[complex]:
"""Linear convolution, of length len(a) + len(b) - 1."""
if not a or not b:
return []
out = [0j] * (len(a) + len(b) - 1)
for i, x in enumerate(a):
for k, y in enumerate(b):
out[i + k] += x * y
return out
def cconv(a: list[complex], b: list[complex], n: int | None = None) -> list[complex]:
"""Circular convolution of length n (default: the longer length).
Both inputs are padded with zeros to length n, or must not be longer than n.
"""
if n is None:
n = max(len(a), len(b))
if len(a) > n or len(b) > n:
raise ValueError("input longer than n")
out = [0j] * n
for i, x in enumerate(a):
for k, y in enumerate(b):
out[(i + k) % n] += x * y
return out
def _twiddles(n: int, sign: int) -> list[complex]:
return [cmath.exp(sign * 2j * math.pi * t / n) for t in range(n)]
def dft(x: list[complex]) -> list[complex]:
"""X[k] = sum over n of x[n] e^(-j 2 pi k n / N), as a direct O(N^2) sum."""
n = len(x)
w = _twiddles(n, -1)
return [sum(x[t] * w[(k * t) % n] for t in range(n)) for k in range(n)]
def idft(xf: list[complex]) -> list[complex]:
"""x[n] = (1/N) sum over k of X[k] e^(j 2 pi k n / N), the inverse of dft."""
n = len(xf)
w = _twiddles(n, 1)
return [sum(xf[k] * w[(k * t) % n] for k in range(n)) / n for t in range(n)]
def udft(x: list[complex]) -> list[complex]:
"""The unitary DFT: dft(x) / sqrt(N)."""
s = 1.0 / math.sqrt(len(x)) if x else 1.0
return [v * s for v in dft(x)]
def uidft(xf: list[complex]) -> list[complex]:
"""The unitary inverse DFT: sqrt(N) idft(X), the inverse of udft."""
s = math.sqrt(len(xf)) if xf else 1.0
return [v * s for v in idft(xf)]
# ---------------------------------------------------------------- Q function and dB
def qfunc(x: float) -> float:
"""Q(x) = P(Z > x) for a standard normal Z, computed as 0.5 erfc(x / sqrt(2))."""
return 0.5 * math.erfc(x / math.sqrt(2.0))
def qinv(p: float) -> float:
"""The x with Q(x) = p, for 0 < p < 1, by bisection on Q (which decreases)."""
if not 0.0 < p < 1.0:
raise ValueError("p must be in (0, 1)")
lo, hi = -40.0, 40.0
for _ in range(200):
mid = 0.5 * (lo + hi)
if qfunc(mid) > p:
lo = mid
else:
hi = mid
if hi - lo <= 1e-15 * max(1.0, abs(mid)):
break
return 0.5 * (lo + hi)
def db(x: float) -> float:
"""10 log10(x), for a ratio of powers or energies."""
return 10.0 * math.log10(x)
def undb(d: float) -> float:
"""10^(d / 10), the inverse of db."""
return 10.0 ** (d / 10.0)
# ---------------------------------------------------------------- noise and statistics
def cn(rng: random.Random, var: float) -> complex:
"""One sample of CN(0, var): independent real and imaginary parts of variance var / 2."""
s = math.sqrt(var / 2.0)
return complex(rng.gauss(0.0, s), rng.gauss(0.0, s))
def awgn(rng: random.Random, x: list[complex], n0: float) -> list[complex]:
"""x plus independent CN(0, n0) noise on each sample."""
return [v + cn(rng, n0) for v in x]
def wilson(k: int, n: int, z: float = 3.29) -> tuple[float, float]:
"""The Wilson score interval for k successes in n trials (z = 3.29 is about 0.999 two-sided)."""
if n <= 0 or not 0 <= k <= n:
raise ValueError("need 0 <= k <= n and n > 0")
p = k / n
z2 = z * z
den = 1.0 + z2 / n
mid = (p + z2 / (2 * n)) / den
half = z * math.sqrt(p * (1 - p) / n + z2 / (4 * n * n)) / den
return max(0.0, mid - half), min(1.0, mid + half)
common_phase_error_correction.py 37 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/common-phase-error-correction/. The authors are listed in prov/3R84JE.jsonl.
"""Common phase error (CPE) correction in OFDM with pilot subcarriers.
Phase noise phi[n] multiplies time sample n by e^(j phi[n]). After the DFT,
with the unitary pair of the OFDM page,
Y[k] = I_0 H[k] X[k] + (sum over m != k of I_(k - m) H[m] X[m]) + W[k]
I_q = (1/N) sum over n of e^(j phi[n]) e^(-j 2 pi q n / N)
I_0 is the same for every subcarrier: the common phase error. The other
terms are inter-carrier interference. The receiver knows H and the pilot
values X_p, and estimates the angle of I_0 from the pilots:
C = sum over pilots p of Y[p] conj(H[p] X_p), phi_hat = angle(C)
then rotates every subcarrier back by phi_hat before the one-tap equalizer.
"""
import cmath
def estimate_phase(y: list[complex], h: list[complex], pilots: list[int], pilot_values: list[complex]) -> float:
"""phi_hat = angle of sum over pilots of Y[p] conj(H[p] X_p)."""
if len(pilots) != len(pilot_values) or not pilots:
raise ValueError("need one value per pilot and at least one pilot")
c = sum(y[p] * (h[p] * x).conjugate() for p, x in zip(pilots, pilot_values)) # @line L1
return cmath.phase(c) # @line L2
def correct(y: list[complex], h: list[complex], pilots: list[int], pilot_values: list[complex]) -> list[complex]:
"""The equalized subcarrier values Y[k] e^(-j phi_hat) / H[k] for all k."""
phi = estimate_phase(y, h, pilots, pilot_values)
rot = cmath.exp(-1j * phi)
z = [v * rot / hk for v, hk in zip(y, h)] # @line L3
return z # @line L4
test_common_phase_error_correction.py 104 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/common-phase-error-correction/. The authors are listed in prov/3R84JE.jsonl.
import cmath
import math
import random
import cbb
from common_phase_error_correction import correct, estimate_phase
S = 1 / math.sqrt(2)
N = 64
TAPS = [0.9, 0.3j, -0.2]
PILOTS = list(range(4, N, 8))
def qpsk(rng: random.Random, n: int) -> list[complex]:
return [complex(rng.choice((S, -S)), rng.choice((S, -S))) for _ in range(n)]
def slice_qpsk(z: complex) -> complex:
return complex(S if z.real >= 0 else -S, S if z.imag >= 0 else -S)
def wiener_phase(rng: random.Random, n: int, var: float, start: float) -> list[float]:
"""phi[0] = start, then independent steps of variance var (var = 2 pi beta T_s for linewidth beta)."""
out = [start]
for _ in range(n - 1):
out.append(out[-1] + rng.gauss(0.0, math.sqrt(var)))
return out
def receive(rng: random.Random, x: list[complex], phi: list[float], n0: float) -> list[complex]:
"""Subcarrier values through the channel (prefix assumed long enough), phase noise and AWGN."""
t = cbb.cconv(cbb.uidft(x), TAPS, len(x))
r = [v * cmath.exp(1j * p) for v, p in zip(t, phi)]
return cbb.udft(cbb.awgn(rng, r, n0) if n0 > 0 else r)
def test_a_constant_phase_is_removed_exactly() -> None:
rng = random.Random(1)
h = cbb.dft(TAPS + [0j] * (N - len(TAPS)))
for theta in (0.3, -2.0, 3.1):
x = qpsk(rng, N)
y = receive(rng, x, [theta] * N, 0.0)
assert abs(estimate_phase(y, h, PILOTS, [x[p] for p in PILOTS]) - theta) < 1e-9
z = correct(y, h, PILOTS, [x[p] for p in PILOTS])
assert max(abs(a - b) for a, b in zip(z, x)) < 1e-9
def test_the_pilot_sum_is_unbiased_for_i0() -> None:
# Fixed phase noise, random data: E[C] = I_0 sum |H[p] X_p|^2, because the ICI terms have zero mean.
rng = random.Random(2)
h = cbb.dft(TAPS + [0j] * (N - len(TAPS)))
phi = wiener_phase(rng, N, 0.01, 0.7)
i0 = sum(cmath.exp(1j * p) for p in phi) / N
acc = 0j
trials = 200
for _ in range(trials):
x = qpsk(rng, N)
y = receive(rng, x, phi, 0.0)
c = sum(y[p] * (h[p] * x[p]).conjugate() for p in PILOTS)
acc += c / sum(abs(h[p] * x[p]) ** 2 for p in PILOTS)
assert abs(acc / trials - i0) < 0.01
def test_symbol_errors_with_and_without_correction() -> None:
# Measurement: N = 64, 8 pilots, per-sample phase step variance 0.002, a random start phase,
# N0 = 0.02, 100 symbols, seed 3. Without correction about 3 in 4 data symbols are wrong;
# with CPE correction about as few errors as with the true angle of I_0.
rng = random.Random(3)
h = cbb.dft(TAPS + [0j] * (N - len(TAPS)))
data = [k for k in range(N) if k not in PILOTS]
e_none = e_cpe = e_true = 0
trials = 100
for _ in range(trials):
phi = wiener_phase(rng, N, 0.002, rng.uniform(-math.pi, math.pi))
x = qpsk(rng, N)
y = receive(rng, x, phi, 0.02)
i0 = sum(cmath.exp(1j * p) for p in phi) / N
z = correct(y, h, PILOTS, [x[p] for p in PILOTS])
rot = cmath.exp(-1j * cmath.phase(i0))
e_cpe += sum(slice_qpsk(z[k]) != x[k] for k in data)
e_true += sum(slice_qpsk(y[k] * rot / h[k]) != x[k] for k in data)
e_none += sum(slice_qpsk(y[k] / h[k]) != x[k] for k in data)
total = trials * len(data)
assert e_none > 0.5 * total
assert e_cpe < 0.01 * total
assert e_cpe <= e_true + 10
def test_power_left_in_i0() -> None:
# Closed form for Wiener phase noise: E|I_0|^2 = (1/N^2) sum over n, m of e^(-var |n - m| / 2),
# about 1 - var N / 6 for small var N. The rest, 1 - |I_0|^2, is ICI that CPE correction cannot remove.
rng = random.Random(4)
var = 0.002
exact = sum(math.exp(-var * abs(a - b) / 2) for a in range(N) for b in range(N)) / N ** 2
assert abs(exact - (1 - var * N / 6)) < 2e-3
acc = 0.0
trials = 1000
for _ in range(trials):
phi = wiener_phase(rng, N, var, 0.0)
acc += abs(sum(cmath.exp(1j * p) for p in phi) / N) ** 2
assert abs(acc / trials - exact) < 2e-3
History
Patrick Robertson and Stefan Kaiser at the German Aerospace Center analyzed phase noise in OFDM in 1995 and showed that it splits into a common phase error, shared by all subcarriers, and inter-carrier interference. The same year, Pollet, Van Bladel and Moeneclaey gave the SNR degradation caused by Wiener phase noise. Ana Garcia Armada explained both effects for broadcasting in 2001. Pilot-based phase tracking is part of IEEE 802.11a and its successors, and phase tracking reference signals were added to 5G NR for millimeter wave bands.
References
- P. Robertson and S. Kaiser, Analysis of the effects of phase-noise in orthogonal frequency division multiplex (OFDM) systems, IEEE International Conference on Communications (ICC), 1995, pages 1652 to 1657 (the split of phase noise into a common phase error and inter-carrier interference)
- A. Garcia Armada, Understanding the effects of phase noise in orthogonal frequency division multiplexing (OFDM), IEEE Transactions on Broadcasting 47(2), 2001, pages 153 to 159 (the common phase error and the inter-carrier interference from phase noise)
- T. Pollet, M. Van Bladel and M. Moeneclaey, BER sensitivity of OFDM systems to carrier frequency offset and Wiener phase noise, IEEE Transactions on Communications 43(2/3/4), 1995, pages 191 to 193 (the SNR degradation caused by Wiener phase noise)
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H1 sketch |
|
| Lean | L0 no Lean part |
|
| Code (python) | I0 not checked yet |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag 3R84JE Edit this page History Report an error Markdown