Algorithm Search⌘K

Algorithmadvanced

Tone reservation

Also called peak-reduction tones.

Lowers the PAPR of OFDM by keeping a few subcarriers free of data and filling them with a signal that cancels the peaks. The data subcarriers stay unchanged and no side information is sent.

Time
O(L N log(L N) + K L N) worst
Space
O(L N) extra
Where
K = the number of iterations; L = the oversampling factor; N = the number of subcarriers
Properties
adds powercosts subcarriersdeterministicdistortionlessnot side information
Origin
Jose Tellado, 2000

Tone reservation lowers the peak-to-average power ratio (PAPR) of an OFDM symbol by keeping a small set RR of subcarriers free of data. The transmitter fills these reserved tones with values C[k]C[k] chosen so that the added time signal cancels the peaks. The data subcarriers are not touched, so the receiver demodulates them as usual, ignores the tones in RR, and needs no side information. Finding the best CC is a convex problem. The common fast method, due to Tellado, uses a kernel: a time signal pp whose spectrum lies on RR and which has one tall peak at time 0. Each step shifts the kernel to the current largest sample and subtracts just enough of it to bring that sample down to a target magnitude AA. The price is the ∣R∣|R| subcarriers that carry no data and the extra power on them. The page uses the unitary DFT pair F[k,n]=e−j2πkn/N/NF[k, n] = e^{-j 2\pi k n / N}/\sqrt N, jj is the imaginary unit, and the data have E∣X[k]∣2=1E|X[k]|^2 = 1.

In plain words

Some tones in the OFDM symbol are set aside and carry no data. The sender may put anything on them, because the receiver throws them away. The sender uses them to build a correction signal that pushes the tall peaks down. A good correction looks like one sharp spike with small ripples, so it can remove one peak without making new ones. The sender finds the tallest peak, puts the spike there with the right size and angle, and subtracts it. Then it looks for the next tallest peak and repeats a few times. The data tones never change, so the receiver does nothing new. The cost is the tones that carry no data and a little extra power.

The problem

The input is a block of NN data symbols X[0],…,X[N−1]X[0], \ldots, X[N-1] with X[k]=0X[k] = 0 on the reserved set RR, an oversampling factor LL, usually 4, a target peak magnitude AA and a number of iterations KK. The output is a vector CC that is zero off RR and the oversampled symbol y=x+cy = x + c of X+CX + C, where xx and cc are the symbols of XX and CC. The goal is a small max⁡t∣y[t]∣\max_t |y[t]|. The best CC minimizes max⁡t∣x[t]+c[t]∣\max_t |x[t] + c[t]|, which is a convex function of CC. The algorithm below gives a good CC quickly but does not always reach that minimum.

The algorithm

  1. TR(X[0..N-1], R, L, A, K) ▷ X[k] = 0 for k in R
  2. 1x ← √L · F_LNᴴ (X, with (L-1)N zeros in the middle)
  3. 2p ← (√N/|R|) · √L · F_LNᴴ (indicator of R, zeros in the middle) ▷ p[0] = 1
  4. 3c ← 0, a vector of LN samples
  5. 4repeat K times
  6. 5m ← argmax_t |x[t] + c[t]|; v ← x[m] + c[m]
  7. 6if |v| ≤ A then stop
  8. 7α ← v · (1 - A/|v|)
  9. 8c[t] ← c[t] - α · p[(t - m) mod LN] for every t
  10. 9return y = x + c and C = the N in-band values of F_LN c / √L

Line L1 is the oversampled OFDM symbol; the zeros go in the middle of the spectrum because the indices k≥N/2k \ge N/2 are the negative frequencies. Line L2 builds the kernel once per reserved set. It is the time signal of the indicator of RR, scaled so that p[0]=1p[0] = 1. Every other sample has ∣p[t]∣≤1|p[t]| \le 1, and a good set RR makes them much smaller. A circular shift of pp by mm samples multiplies each tone by a phase, so the shifted kernel still lives on RR. Line L5 finds the largest sample. Line L7 computes the excess over AA with the phase of that sample, and line L8 subtracts the shifted kernel times the excess, which sets the sample mm to magnitude AA exactly. The other samples change by at most ∣v∣−A|v| - A each, so a new peak can appear; line L5 looks for it on the next pass. Line L9 returns the symbol and the reserved-tone values. The receiver reads the data tones and discards RR.

Example

Take N=64N = 64 QPSK subcarriers, L=4L = 4 and ∣R∣=8|R| = 8 reserved tones, R={10,28,30,31,34,37,39,41}R = \{10, 28, 30, 31, 34, 37, 39, 41\}. This set was the best of 200 random sets of 8 tones, by the largest kernel sidelobe max⁡t≠0∣p[t]∣\max_{t \ne 0} |p[t]|, which is 0.80 for it. Eight equally spaced tones give 1.0 and eight adjacent tones give 0.97. The target is A2=10γ/10 σ2A^2 = 10^{\gamma/10}\, \sigma^2, with σ2=56/64\sigma^2 = 56/64 the mean power per sample of the data alone. The PAPR below is measured on yy, with the reserved-tone power in the mean. Over 200 random blocks (Python random.Random(2)):

target γ\gamma iterations KK mean PAPR 99 percent below extra power on RR
none 0 7.33 dB 9.62 dB 0 dB
4 dB 5 5.82 dB 7.62 dB 0.47 dB
4 dB 10 5.44 dB 7.37 dB 0.56 dB
4 dB 40 5.05 dB 6.35 dB 0.74 dB
5 dB 5 5.64 dB 7.22 dB 0.28 dB
5 dB 10 5.30 dB 6.95 dB 0.34 dB
5 dB 40 4.90 dB 5.80 dB 0.48 dB
6 dB 5 6.04 dB 7.09 dB 0.12 dB
6 dB 10 5.93 dB 6.81 dB 0.14 dB
6 dB 40 5.85 dB 6.00 dB 0.16 dB

With the 6 dB target the result stays near the target and costs little power. A lower target lowers the PAPR further but spends more power on RR, and with 4 dB the loop cannot reach the target in 40 passes. For a tiny case with N=8N = 8, L=2L = 2 and one reserved tone, where the convex optimum can be found by a direct search, setting AA to the optimal peak makes the loop reach that peak to within 0.1 percent in 200 passes.

Correctness

The claim is that the output yy is the oversampled symbol of X+CX + C with CC zero off RR, so the data tones are exactly XX, and that each pass that reaches line L8 sets its selected sample to magnitude AA. The invariant is that cc is always the symbol of a vector on RR. It holds after line L3, and line L8 keeps it because a shifted kernel is the symbol of a phase-rotated indicator of RR. The step is exact because p[0]=1p[0] = 1, so the sample mm becomes v−α=A v/∣v∣v - \alpha = A\, v/|v|. If the loop stops at line L6, every sample is at most AA. The correction adds the mean power ∥C∥2/N\lVert C \rVert^2/N and nothing else. The full proof is in proofs/correctness.md.

Proof: Tone reservation leaves the data subcarriers unchanged, puts the whole correction on the reserved set, and clips each selected peak exactly to the thresholdfull

Let NN be the number of subcarriers, LL the oversampling factor and R⊂{0,…,N−1}R \subset \{0, \ldots, N-1\} the reserved set, with X[k]=0X[k] = 0 for k∈Rk \in R. The subcarrier kk has the integer frequency fk=kf_k = k for k<N/2k < N/2 and fk=k−Nf_k = k - N for k≥N/2k \ge N/2. Write TT for the map of line L1 from NN subcarrier values to the oversampled symbol, T(Y)=L FLNHZ(Y)T(Y) = \sqrt L\, F_{LN}^H Z(Y), where Z(Y)Z(Y) puts (L−1)N(L - 1)N zeros in the middle of YY. Written out,

T(Y)[t]=1N∑k=0N−1Y[k] ej2πfkt/(LN),t=0,…,LN−1.T(Y)[t] = \frac{1}{\sqrt N} \sum_{k=0}^{N-1} Y[k]\, e^{j 2\pi f_k t / (LN)}, \qquad t = 0, \ldots, LN - 1.

Say that a vector Y∈CNY \in \mathbb{C}^N is on RR if Y[k]=0Y[k] = 0 for every k∉Rk \notin R. We work in exact arithmetic, and all indices of time samples are taken modulo LNLN.

Lemma 1 (the kernel). The kernel of line L2 is p=(N/∣R∣) T(1R)p = (\sqrt N / |R|)\, T(1_R), where 1R1_R is the indicator of RR. It satisfies

p[t]=1∣R∣∑k∈Rej2πfkt/(LN),p[0]=1,∣p[t]∣≤1 for every t.p[t] = \frac{1}{|R|} \sum_{k \in R} e^{j 2\pi f_k t/(LN)}, \qquad p[0] = 1, \qquad |p[t]| \le 1 \text{ for every } t.

Proof. Put Y=1RY = 1_R in the formula for TT and multiply by N/∣R∣\sqrt N / |R|. At t=0t = 0 every term is 1, so p[0]=∣R∣/∣R∣=1p[0] = |R|/|R| = 1. For every tt the sum has ∣R∣|R| terms of magnitude 1, so the triangle inequality gives ∣p[t]∣≤1|p[t]| \le 1. □\square

Lemma 2 (a shift stays on RR). For every integer mm, the shifted kernel sm[t]=p[t−m]s_m[t] = p[t - m] is T(Dm)T(D_m) with

Dm[k]=N∣R∣ e−j2πfkm/(LN) for k∈R,Dm[k]=0 for k∉R.D_m[k] = \frac{\sqrt N}{|R|}\, e^{-j 2\pi f_k m/(LN)} \text{ for } k \in R, \qquad D_m[k] = 0 \text{ for } k \notin R.

So DmD_m is on RR.

Proof. Each fkf_k is an integer, so ej2πfk(t−m)/(LN)e^{j 2\pi f_k (t - m)/(LN)} does not change when t−mt - m changes by a multiple of LNLN. The circular shift is therefore well defined, and

p[t−m]=1∣R∣∑k∈Re−j2πfkm/(LN) ej2πfkt/(LN)=1N∑kDm[k] ej2πfkt/(LN)=T(Dm)[t].p[t - m] = \frac{1}{|R|} \sum_{k \in R} e^{-j 2\pi f_k m/(LN)}\, e^{j 2\pi f_k t/(LN)} = \frac{1}{\sqrt N} \sum_{k} D_m[k]\, e^{j 2\pi f_k t/(LN)} = T(D_m)[t].

A delay in time is a modulation in frequency, and a modulation changes only the phase of each subcarrier. □\square

Lemma 3 (invariant). At the start of every pass through line L4, there is a vector CC on RR with c=T(C)c = T(C).

Proof. By induction on the number of passes. Line L3 sets c=0=T(0)c = 0 = T(0), and 00 is on RR. Suppose c=T(C)c = T(C) with CC on RR, and the pass reaches line L8 with the index mm and the factor α\alpha. Line L8 replaces cc by c−αsmc - \alpha s_m. By Lemma 2 and the linearity of TT, this equals T(C−αDm)T(C - \alpha D_m), and C−αDmC - \alpha D_m is on RR because both CC and DmD_m are on RR. □\square

Lemma 4 (one step). Suppose a pass reaches line L7, so the largest sample v=x[m]+c[m]v = x[m] + c[m] has ∣v∣>a|v| > a. After line L8, the sample mm of x+cx + c equals a v/∣v∣a\, v/|v|: it has magnitude exactly aa and the phase of vv.

Proof. Line L7 sets α=v(1−a/∣v∣)\alpha = v(1 - a/|v|). Line L8 changes the sample mm by −α p[0]=−α-\alpha\, p[0] = -\alpha by Lemma 1. So the new sample is v−v(1−a/∣v∣)=a v/∣v∣v - v(1 - a/|v|) = a\, v/|v|. □\square

The other samples change by −α p[t−m]-\alpha\, p[t - m], and ∣α p[t−m]∣≤∣v∣−a|\alpha\, p[t - m]| \le |v| - a by Lemma 1. A sample can therefore grow, so the peak need not fall at every step. This is why line L5 searches for the largest sample again on each pass.

Theorem. Let yy and C^\hat C be the outputs of line L9. Then:

  1. y=T(X+C)y = T(X + C) for a vector CC on RR, and C^=C\hat C = C;
  2. the data subcarriers are unchanged: the in-band values of yy equal X[k]X[k] for every k∉Rk \notin R;
  3. if the loop ends at line L6, then ∣y[t]∣≤a|y[t]| \le a for every tt; otherwise the loop ends after the given number of passes, and each pass clipped its selected sample exactly to aa;
  4. the energy of yy is L (∥X∥2+∥C∥2)L\,(\lVert X \rVert^2 + \lVert C \rVert^2), so the correction adds the mean power ∥C∥2/N\lVert C \rVert^2 / N and nothing else.

Proof. By Lemma 3, at line L9 the correction is c=T(C)c = T(C) with CC on RR, and x=T(X)x = T(X) by line L1, so y=x+c=T(X+C)y = x + c = T(X + C) by linearity. The map that keeps the NN in-band values of FLN yF_{LN}\, y and divides by L\sqrt L is a left inverse of TT, because FLNF_{LN} is unitary and ZZ only places values. Applied to cc it returns CC, which is item 1. For k∉Rk \notin R, C[k]=0C[k] = 0, so the in-band value of yy at kk is X[k]X[k], which is item 2. Line L6 ends the loop only when the largest magnitude is at most aa, and the other exit is the end of the counted loop; Lemma 4 gives the rest of item 3. For item 4, ∥T(Y)∥2=L ∥Z(Y)∥2=L ∥Y∥2\lVert T(Y) \rVert^2 = L\, \lVert Z(Y) \rVert^2 = L\, \lVert Y \rVert^2 because FLNHF_{LN}^H is unitary. XX and CC have disjoint supports, so ∥X+C∥2=∥X∥2+∥C∥2\lVert X + C \rVert^2 = \lVert X \rVert^2 + \lVert C \rVert^2. □\square

The receiver. After the cyclic prefix is removed and the channel HH is equalized, the receiver sees X[k]+C[k]X[k] + C[k] plus noise on each subcarrier kk. On the data subcarriers this is X[k]X[k] plus noise, exactly as without tone reservation, so the receiver ignores RR and needs no side information.

What is not claimed. The best correction solves the problem of minimizing max⁡t∣x[t]+T(C)[t]∣\max_t |x[t] + T(C)[t]| over the vectors CC on RR. It is a convex problem, because each ∣x[t]+T(C)[t]∣|x[t] + T(C)[t]| is a convex function of CC and a maximum of convex functions is convex. It can be written as a second-order cone program. The greedy loop of lines L4 to L8 gives a valid correction for any number of passes, by the theorem, but it does not in general reach the minimum of that problem.

Complexity

Lines L1 and L2 cost two inverse FFTs of size LNLN, O(LNlog⁡(LN))O(LN \log(LN)), and the kernel can be stored once for a fixed RR. Each pass of lines L5 to L8 costs O(LN)O(LN) for the search and the update. One block therefore costs O(LNlog⁡(LN)+KLN)O(LN\log(LN) + KLN) operations in the real-RAM model, with O(LN)O(LN) memory. Ten passes for N=64N = 64 and L=4L = 4 are about 2560 complex multiply-adds plus the searches, similar to the inverse FFT itself.

Properties

  • Distortionless. The data subcarriers reach the receiver unchanged. There is no clipping noise in the band of the data.
  • No side information. The receiver discards the reserved tones and needs no change.
  • Costs subcarriers. The ∣R∣|R| tones carry no data, here 8 of 64, a rate loss of 12.5 percent.
  • Adds power. The correction carries power on RR, between 0.1 and 0.8 dB in the example.
  • Depends on the set. The kernel sidelobes, and with them the result, depend on which tones are reserved.
  • Not optimal. The loop gives a valid correction for any KK but does not in general reach the convex optimum.

Variants and improvements

  • Exact optimization. Minimizing max⁡t∣x[t]+c[t]∣\max_t |x[t] + c[t]| over CC on RR is a second-order cone program. For the real-valued baseband signals of DMT in DSL it is a linear program, which is how Tellado first posed it. The solvers are slower than the kernel loop but give the optimum.
  • Clip and project. Clip x+cx + c at AA, take the FFT of the clipping noise, keep only its values on RR and subtract their time signal. This is a projected gradient step, like clipping and filtering with the band of the correction limited to RR.
  • Several peaks per pass. Cancel all samples above AA in one pass with one shifted kernel each. This needs fewer passes at the same cost per pass.
  • Tone injection. Also from Tellado: instead of reserving tones, move some data points to equivalent points of a larger constellation, which the receiver maps back with a modulo operation. It costs no subcarriers but adds power.
  • Standards. The DVB-T2 broadcasting standard includes tone reservation as an option, with fixed reserved sets.

When to use it

Use tone reservation when the receiver must not change and no side information can be sent, and the system can spare a few percent of its subcarriers, for example tones that are already unused or are reserved by the standard. It suits DSL and broadcasting. If no tones can be spared, use active constellation extension, which also needs no receiver change. If some side information is acceptable, selected mapping and partial transmit sequences cost no subcarriers and no extra power.

Pitfalls

  • A periodic reserved set. Choosing R={0,8,16,…}R = \{0, 8, 16, \ldots\} in line L2 gives a kernel that repeats 8 times, with sidelobes of magnitude 1, so line L8 creates peaks as tall as the one it removes. Choose RR in line L2 by a search for small sidelobes.
  • Data on the reserved tones. If X[k]≠0X[k] \ne 0 for some k∈Rk \in R in line L1, the correction changes those data. Set X[k]=0X[k] = 0 on RR before line L1; the code raises an error otherwise.
  • An unscaled kernel. Line L7 assumes p[0]=1p[0] = 1. Without the factor N/∣R∣\sqrt N/|R| in line L2 the step overshoots or falls short. Keep the scale in line L2.
  • Nyquist-rate samples. Line L1 with L=1L = 1 cancels the sampled peaks only, and the analog peaks between them remain. Use L≥4L \ge 4 in lines L1 and L2.
  • A target that cannot be reached. A value of AA in line L6 far below what RR can achieve makes the loop run all KK passes and spend more power on RR for little gain, as the 4 dB rows show. Set AA in line L6 near a target that the reserved set can reach.

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.

tone_reservation.pyI0RawGitHub
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/tone-reservation/. The authors are listed in prov/N335YA.jsonl.

"""Tone reservation (Tellado) with the peak-cancelling kernel.

A set R of subcarriers carries no data. The transmitter adds a signal c whose
spectrum lies only on R, so the data subcarriers are untouched and the receiver
simply ignores R. The kernel p is the oversampled time signal of the indicator
of R, scaled so that p[0] = 1. A circular shift of p by m samples still has its
spectrum on R. Each iteration finds the largest sample of x + c and subtracts
the shifted kernel times the excess over the threshold A, which sets that
sample to magnitude A exactly. The FFT is a radix-2 FFT, so N and L must be
powers of two.
"""

import cmath
import math
from typing import Sequence


def fft(a: Sequence[complex], inverse: bool = False) -> list[complex]:
    """Radix-2 FFT with no scale factor: sum_n a[n] e^(-+ j 2 pi k n / n_len)."""
    n = len(a)
    if n == 0 or n & (n - 1):
        raise ValueError("the length must be a power of two")
    out = [complex(v) for v in a]
    j = 0
    for i in range(1, n):
        bit = n >> 1
        while j & bit:
            j ^= bit
            bit >>= 1
        j |= bit
        if i < j:
            out[i], out[j] = out[j], out[i]
    sign = 1 if inverse else -1
    size = 2
    while size <= n:
        half = size // 2
        tw = [cmath.exp(sign * 2j * math.pi * k / size) for k in range(half)]
        for s in range(0, n, size):
            for k in range(half):
                u = out[s + k]
                v = out[s + k + half] * tw[k]
                out[s + k] = u + v
                out[s + k + half] = u - v
        size *= 2
    return out


def to_time(X: Sequence[complex], L: int) -> list[complex]:
    """sqrt(L) F^H Z: the OFDM symbol of X oversampled by L, zeros in the middle of the spectrum."""
    n = len(X)
    z = [0j] * (L * n)
    z[: n // 2] = [complex(v) for v in X[: n // 2]]
    z[L * n - n + n // 2:] = [complex(v) for v in X[n // 2:]]
    s = 1.0 / math.sqrt(n)
    return [v * s for v in fft(z, inverse=True)]


def to_bins(x: Sequence[complex], L: int) -> list[complex]:
    """The N in-band subcarrier values of an oversampled symbol: the inverse of to_time."""
    n = len(x) // L
    c = fft(x)
    s = 1.0 / (L * math.sqrt(n))
    return [v * s for v in c[: n // 2] + c[L * n - n // 2:]]


def papr(x: Sequence[complex]) -> float:
    """max |x[m]|^2 over the time average of |x[m]|^2."""
    p = [abs(v) ** 2 for v in x]
    return max(p) / (sum(p) / len(p))


def kernel(n: int, reserved: Sequence[int], L: int) -> list[complex]:
    """The oversampled time signal of the indicator of the reserved set, with p[0] = 1."""
    ind = [0j] * n
    for k in reserved:
        ind[k] = 1 + 0j
    s = math.sqrt(n) / len(reserved)
    return [v * s for v in to_time(ind, L)]


def tone_reservation(X: Sequence[complex], reserved: Sequence[int], L: int, a: float, iterations: int) -> tuple[list[complex], list[complex]]:
    """Return the oversampled symbol x + c and the N subcarrier values of c (zero off the reserved set).

    X must be zero on the reserved subcarriers. a is the target peak magnitude.
    """
    if any(X[k] != 0 for k in reserved):
        raise ValueError("the reserved subcarriers must carry no data")
    x = to_time(X, L)  # @line L1
    p = kernel(len(X), reserved, L)  # @line L2
    size = len(x)
    c = [0j] * size  # @line L3
    for _ in range(iterations):  # @line L4
        m = max(range(size), key=lambda t: abs(x[t] + c[t]))  # @line L5
        v = x[m] + c[m]
        if abs(v) <= a:  # @line L6
            break
        alpha = v * (1.0 - a / abs(v))  # @line L7
        for t in range(size):  # @line L8
            c[t] -= alpha * p[(t - m) % size]
    return [u + w for u, w in zip(x, c)], to_bins(c, L)  # @line L9
test_tone_reservation.py 144 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/tone-reservation/. The authors are listed in prov/N335YA.jsonl.

import cmath
import math
import random

import pytest

from tone_reservation import fft, kernel, papr, to_bins, to_time, tone_reservation

QPSK = [complex(a, b) / math.sqrt(2) for a in (1, -1) for b in (1, -1)]
R8 = [10, 28, 30, 31, 34, 37, 39, 41]


def direct_time(X, L):
    n = len(X)
    freqs = list(range(n // 2)) + list(range(-(n // 2), 0))
    size = L * n
    return [sum(X[k] * cmath.exp(2j * math.pi * freqs[k] * t / size) for k in range(n)) * math.sqrt(L) / math.sqrt(size) for t in range(size)]


def block(rng, n, reserved):
    X = [rng.choice(QPSK) for _ in range(n)]
    for k in reserved:
        X[k] = 0j
    return X


def opt_one_tone(x, q1):
    """min over complex C of max_t |x[t] + C q1[t]|, a convex problem, by nested ternary search."""

    def f(a, b):
        c = complex(a, b)
        return max(abs(u + c * w) for u, w in zip(x, q1))

    def g(a):
        lo, hi = -3.0, 3.0
        for _ in range(70):
            m1, m2 = lo + (hi - lo) / 3, hi - (hi - lo) / 3
            if f(a, m1) < f(a, m2):
                hi = m2
            else:
                lo = m1
        return f(a, (lo + hi) / 2)

    lo, hi = -3.0, 3.0
    for _ in range(70):
        m1, m2 = lo + (hi - lo) / 3, hi - (hi - lo) / 3
        if g(m1) < g(m2):
            hi = m2
        else:
            lo = m1
    return g((lo + hi) / 2)


def test_transforms():
    rng = random.Random(11)
    X = [complex(rng.gauss(0, 1), rng.gauss(0, 1)) for _ in range(16)]
    x = to_time(X, 4)
    ref = direct_time(X, 4)
    assert max(abs(u - v) for u, v in zip(x, ref)) < 1e-9
    assert max(abs(u - v) for u, v in zip(to_bins(x, 4), X)) < 1e-9
    a = [complex(rng.gauss(0, 1), rng.gauss(0, 1)) for _ in range(32)]
    back = [v / 32 for v in fft(fft(a), inverse=True)]
    assert max(abs(u - v) for u, v in zip(a, back)) < 1e-9


def test_kernel():
    p = kernel(64, R8, 4)
    assert abs(p[0] - 1) < 1e-12
    assert max(abs(v) for v in p) <= 1 + 1e-12
    P = to_bins(p, 4)
    assert max(abs(P[k]) for k in range(64) if k not in R8) < 1e-9
    # a circular shift of the kernel is a modulation: its spectrum stays on R
    m = 37
    shifted = [p[(t - m) % 256] for t in range(256)]
    S = to_bins(shifted, 4)
    assert max(abs(S[k]) for k in range(64) if k not in R8) < 1e-9


def test_data_untouched_and_spectrum_on_reserved_set():
    rng = random.Random(3)
    for _ in range(5):
        X = block(rng, 64, R8)
        a = math.sqrt(10 ** 0.5 * 56 / 64)
        y, C = tone_reservation(X, R8, 4, a, 20)
        Y = to_bins(y, 4)
        assert max(abs(Y[k] - X[k]) for k in range(64) if k not in R8) < 1e-9
        assert max(abs(C[k]) for k in range(64) if k not in R8) < 1e-9
        assert max(abs(Y[k] - C[k]) for k in R8) < 1e-9


def test_one_step_clips_the_peak_exactly():
    rng = random.Random(5)
    X = block(rng, 64, R8)
    x = to_time(X, 4)
    m = max(range(256), key=lambda t: abs(x[t]))
    a = 0.8 * abs(x[m])
    y, _ = tone_reservation(X, R8, 4, a, 1)
    assert abs(abs(y[m]) - a) < 1e-9
    assert abs(cmath.phase(y[m] / x[m])) < 1e-9


def test_stops_below_target():
    rng = random.Random(6)
    X = block(rng, 64, R8)
    x = to_time(X, 4)
    a = max(abs(v) for v in x) + 0.01
    y, C = tone_reservation(X, R8, 4, a, 50)
    assert y == x
    assert max(abs(v) for v in C) < 1e-12


def test_reaches_convex_optimum_with_one_tone():
    rng = random.Random(1)
    for _ in range(3):
        X = block(rng, 8, [3])
        x = to_time(X, 2)
        q1 = to_time([1 if k == 3 else 0 for k in range(8)], 2)
        opt = opt_one_tone(x, q1)
        y, _ = tone_reservation(X, [3], 2, opt, 200)
        peak = max(abs(v) for v in y)
        assert peak >= opt - 1e-6
        assert peak <= opt * (1 + 2e-3)


def test_papr_drops():
    rng = random.Random(2)
    before, after = [], []
    for _ in range(60):
        X = block(rng, 64, R8)
        a = math.sqrt(10 ** 0.5 * 56 / 64)
        y, _ = tone_reservation(X, R8, 4, a, 10)
        before.append(papr(to_time(X, 4)))
        after.append(papr(y))
    gain = 10 * math.log10(sum(before) / len(before)) - 10 * math.log10(sum(after) / len(after))
    assert gain > 1.5


def test_rejects_data_on_reserved_tones():
    X = [1 + 0j] * 16
    with pytest.raises(ValueError):
        tone_reservation(X, [2, 5], 4, 1.0, 5)

History

Tellado developed tone reservation in his work on peak reduction for multicarrier transmission at Stanford, first for DSL, where the signals are real and the problem is a linear program. His book of 2000 collects tone reservation, the kernel algorithm and tone injection, with applications to DSL and wireless. The overview of Han and Lee (2005) places it among the distortionless methods that need no side information. It later became an option in the DVB-T2 broadcasting standard.

References

  1. Jose Tellado, Multicarrier Modulation with Low PAR: Applications to DSL and Wireless, Kluwer Academic Publishers, 2000, chapter PAR Reduction by Tone Reservation (the reserved tones, the optimization over them and the gradient algorithm with the peak-cancelling kernel)
  2. Seung Hee Han and Jae Hong Lee, An overview of peak-to-average power ratio reduction techniques for multicarrier transmission, IEEE Wireless Communications 12(2), 2005, pages 56 to 65, the section on tone reservation and tone injection

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.

LadderLevelWhat the next level needs
Human proofH1 sketch
  • a full proof of time.worst
  • a full proof of space.extra
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
Code (python)I0 not checked yet
  • the tests did not run in this build
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW2 basic
  • at least three sources
  • a scene preset for the example