Algorithm Search⌘K

Algorithmcore

Selected mapping

Also called SLM.

Lowers the PAPR of OFDM by forming U phase-rotated copies of a symbol and sending the one with the lowest peak, plus its index. No distortion; costs U inverse FFTs.

Time
O(U L N log(L N)) worst
Space
O(L N) extra
Where
L = the oversampling factor; N = the number of subcarriers; U = the number of phase sequences
Properties
deterministicdistortionlessnever worse than plain ofdmside information
Origin
R. W. Bäuml, Robert F. H. Fischer, Johannes B. Huber, 1996

Selected mapping (SLM) lowers the peak-to-average power ratio (PAPR) of an OFDM symbol without distorting it. The transmitter and the receiver share UU phase sequences P1,…,PUP_1, \ldots, P_U of length NN whose entries have magnitude 1. For each data block XX the transmitter forms the UU candidates X⊙PuX \odot P_u, computes the PAPR of each one with an inverse FFT, and sends the candidate with the lowest PAPR together with its index, log⁡2U\log_2 U bits of side information. The receiver multiplies each subcarrier by Pu[k]‾\overline{P_u[k]} and gets XX back exactly. Bäuml, Fischer and Huber proposed it in 1996. It differs from partial transmit sequences, which rotate whole blocks of subcarriers and need only one inverse FFT per block, and from clipping and filtering, which needs no side information but adds distortion. 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, and jj is the imaginary unit.

In plain words

The same data can be sent in several ways that the receiver can undo. For example, the sender can turn some symbols by a quarter turn, if the receiver knows which ones. Each way gives a different signal in time, and their peaks differ, because the peaks come from chance alignments of the tones. So the sender tries a fixed list of patterns, looks at the highest peak of each signal, and sends the best one. It also tells the receiver which pattern it chose. The receiver turns the symbols back. Nothing is lost or distorted. The cost is the extra work at the sender, one transform per pattern, and a few bits to name the pattern. If those bits arrive wrong, the whole symbol is lost.

The problem

The input is a block of NN data symbols X[0],…,X[N−1]X[0], \ldots, X[N-1], for example QPSK with E∣X[k]∣2=1E|X[k]|^2 = 1, an oversampling factor LL, usually 4, and a table of UU phase sequences known to both ends. The output is an index u∗u^\ast and the oversampled OFDM symbol of X⊙Pu∗X \odot P_{u^\ast}, such that

  1. its PAPR is the smallest among the UU candidates, and
  2. the receiver can recover XX exactly from the subcarrier values and u∗u^\ast.

The first sequence is all ones, so plain OFDM is one of the candidates.

The algorithm

  1. SLM(X[0..N-1], P[1..U][0..N-1], L)
  2. 1for u ← 1 to U
  3. 2X_u[k] ← X[k] · P_u[k] for every k ▷ |P_u[k]| = 1, P_1 is all ones
  4. 3x_u ← √L · F_LNᴴ (X_u with (L-1)N zeros in the middle)
  5. 4r_u ← max_m |x_u[m]|² / mean_m |x_u[m]|²
  6. 5if u = 1 or r_u < r_{u*} then u* ← u
  7. 6return u*, x_{u*} ▷ send x_{u*} and the index u* (log₂ U bits)

Line L2 rotates each subcarrier. A common table uses entries from {1,−1,j,−j}\{1, -1, j, -j\}, so that the product is a sign change or a swap of the real and imaginary parts and needs no multiplication. Line L3 is the inverse FFT of size LNLN that builds the candidate oversampled by LL; the zeros go in the middle of the spectrum because the indices k≥N/2k \ge N/2 are the negative frequencies. Line L4 measures the PAPR, and line L5 keeps the first candidate with the smallest value. Line L6 sends it. The receiver demodulates as usual, equalizes, and computes X[k]=Y[k] Pu∗[k]‾X[k] = Y[k]\, \overline{P_{u^\ast}[k]}.

Example

Take N=64N = 64 QPSK subcarriers and L=4L = 4. For one block (Python random.Random(1)) and a table of U=4U = 4 sequences, the first all ones and three random ones from {±1,±j}\{\pm 1, \pm j\}, the four candidates have the PAPRs 6.94 dB, 7.47 dB, 6.66 dB and 6.39 dB. SLM sends the fourth candidate, 0.55 dB below plain OFDM, and the index 4 in 2 bits.

Over 500 random blocks (random.Random(3), a fixed table of 16 sequences, and for each UU the first UU of them):

UU mean PAPR 99 percent of blocks below Pr⁡(PAPR>7 dB)\Pr(\mathrm{PAPR} > 7\ \mathrm{dB}) Pr⁡(PAPR>8 dB)\Pr(\mathrm{PAPR} > 8\ \mathrm{dB}) 0.638U0.638^U
1 7.50 dB 9.92 dB 0.638 0.250 0.638
2 6.92 dB 8.50 dB 0.402 0.048 0.407
4 6.52 dB 7.72 dB 0.164 0.004 0.166
8 6.23 dB 7.13 dB 0.020 none in 500 0.028
16 5.98 dB 6.76 dB none in 500 none in 500 0.0008

The last column is the rule pUp^U, with p=0.638p = 0.638 the measured probability for one candidate at 7 dB. It fits the measured column at 7 dB well here. Going from 1 to 16 candidates moves the 99 percent point down by 3.2 dB; each doubling of UU gains less than the one before.

Correctness

The claim has three parts. The loop keeps, as its invariant, the first index with the smallest PAPR seen so far, so line L6 returns the best candidate in the table. Because P1P_1 is all ones, the output PAPR is never above that of plain OFDM. Because ∣Pu[k]∣=1|P_u[k]| = 1, the receiver's product Y[k] Pu∗[k]‾Y[k]\, \overline{P_{u^\ast}[k]} returns X[k]X[k] exactly. For QPSK data and phases in {±1,±j}\{\pm 1, \pm j\}, each candidate on its own has exactly the PAPR distribution of plain OFDM, since a quarter turn maps the QPSK set onto itself. The CCDF pUp^U of the minimum would follow if the candidates were independent; they are not, so pUp^U is a rule, not a theorem. The full proof is in proofs/correctness.md.

Proof: Selected mapping sends the candidate with the lowest PAPR, never does worse than plain OFDM, and the receiver recovers the data exactlyfull

Let X∈CNX \in \mathbb{C}^N be the data, P1,…,PU∈CNP_1, \ldots, P_U \in \mathbb{C}^N the phase sequences with ∣Pu[k]∣=1|P_u[k]| = 1 for all uu and kk, and P1=(1,…,1)P_1 = (1, \ldots, 1). Write Xu=X⊙PuX_u = X \odot P_u for the elementwise product of line L2, xux_u for its oversampled symbol of line L3 and rur_u for its PAPR of line L4. We work in exact arithmetic.

Lemma 1 (loop invariant). After the iteration of line L1 for index uu, the stored index u∗u^\ast satisfies ru∗=min⁡v≤urvr_{u^\ast} = \min_{v \le u} r_v, and u∗u^\ast is the smallest index that reaches this minimum.

Proof. By induction on uu. For u=1u = 1 the test of line L5 stores index 1. If the claim holds after u−1u - 1, line L5 replaces u∗u^\ast by uu exactly when ru<ru∗r_u < r_{u^\ast}, that is, when rur_u is smaller than all earlier values. If rur_u equals the minimum, the earlier, smaller index stays. □\square

Theorem 1 (the choice). Line L6 returns an index u∗u^\ast with ru∗=min⁡1≤u≤Urur_{u^\ast} = \min_{1 \le u \le U} r_u and the symbol xu∗x_{u^\ast}. In particular ru∗≤r1r_{u^\ast} \le r_1, the PAPR of plain OFDM of XX, and adding sequences to the table never raises the PAPR of the output.

Proof. Lemma 1 at u=Uu = U. Since P1P_1 is all ones, x1x_1 is the plain OFDM symbol. A table that contains the first UU sequences of a larger table takes the minimum over fewer values, which cannot be smaller. □\square

Theorem 2 (exact recovery). If the receiver gets the subcarrier values Y[k]=Xu∗[k]Y[k] = X_{u^\ast}[k] (an ideal channel, or after a perfect one-tap equalizer) and the index u∗u^\ast, then Y[k] Pu∗[k]‾=X[k]Y[k]\, \overline{P_{u^\ast}[k]} = X[k] for every kk.

Proof. Y[k] Pu∗[k]‾=X[k] Pu∗[k] Pu∗[k]‾=X[k] ∣Pu∗[k]∣2=X[k]Y[k]\, \overline{P_{u^\ast}[k]} = X[k]\, P_{u^\ast}[k]\, \overline{P_{u^\ast}[k]} = X[k]\, |P_{u^\ast}[k]|^2 = X[k]. □\square

Recovering the subcarrier values from the transmitted samples is the OFDM demodulator: the oversampled symbol xu=LFLNHZux_u = \sqrt L F_{LN}^H Z_u has the values XuX_u in its NN in-band bins, and the forward FFT returns them.

Lemma 3 (each candidate is distributed as plain OFDM). If the X[k]X[k] are i.i.d. and uniform on the QPSK points {(±1±j)/2}\{(\pm 1 \pm j)/\sqrt 2\}, and every Pu[k]P_u[k] is in {1,−1,j,−j}\{1, -1, j, -j\}, then for each fixed uu the vector XuX_u has the same distribution as XX, so rur_u has the same distribution as r1r_1.

Proof. Multiplication by jj maps the QPSK set onto itself and is a bijection. So for a fixed uu, each Xu[k]=X[k]Pu[k]X_u[k] = X[k] P_u[k] is uniform on the QPSK set, and the components stay independent because each one depends only on its own X[k]X[k]. □\square

A rule, not a theorem. Let p(γ)=Pr⁡(r1>γ)p(\gamma) = \Pr(r_1 > \gamma). Lemma 3 gives Pr⁡(ru>γ)=p(γ)\Pr(r_u > \gamma) = p(\gamma) for each uu, and Theorem 1 gives

Pr⁡(ru∗>γ)=Pr⁡(r1>γ,…,rU>γ)≤p(γ).\Pr(r_{u^\ast} > \gamma) = \Pr(r_1 > \gamma, \ldots, r_U > \gamma) \le p(\gamma).

If the UU ratios were independent, the probability would be p(γ)Up(\gamma)^U. They are not independent, since all candidates come from the same XX; the value p(γ)Up(\gamma)^U is the usual design rule, and a simulation is needed to check it for a given table.

Complexity

Each candidate costs one inverse FFT of size LNLN and O(LN)O(LN) work for the PAPR, so one block costs O(ULNlog⁡(LN))O(U L N \log(LN)) operations in the real-RAM model, UU times the cost of measuring the PAPR of plain OFDM. The memory is O(LN)O(LN) beyond the table, if only the best candidate so far is kept. The side information is ⌈log⁡2U⌉\lceil \log_2 U \rceil bits per OFDM symbol: 4 bits for U=16U = 16 against 128 data bits for 64 QPSK subcarriers.

Properties

  • Distortionless. The data reach the receiver unchanged; there is no in-band error and no spectral regrowth.
  • Never worse than OFDM. With P1P_1 all ones, the PAPR of the output is at most that of plain OFDM for every block.
  • Monotone in UU. A larger table that contains a smaller one never gives a higher PAPR.
  • Side information. The index must reach the receiver without error. An error in it corrupts every subcarrier of the symbol.
  • Statistical, not guaranteed. SLM lowers the probability of a high peak. It does not bound the peak: in the worst case all candidates can have a high PAPR.
  • Any constellation. The method does not depend on the constellation, as long as the receiver can undo the rotation.

Variants and improvements

  • Structured tables. Rows of a Hadamard matrix (entries ±1\pm 1, see the Walsh-Hadamard transform) or other fixed sets are used instead of random sequences. A sequence that is a constant multiple of another, such as jPvj P_v, gives the same PAPR and wastes a candidate.
  • Blind SLM. The receiver finds the index without side information, for example by a maximum likelihood search over the UU candidates, using the fact that only one of them gives valid constellation points.
  • Embedded side information. The index is carried by the phase sequences themselves, for example on pilot or reserved subcarriers.
  • Fewer transforms. Some versions split the inverse FFT into stages and apply the phase sequences in the middle, so that the candidates share part of the work.
  • Other criteria. The selection can minimize a quantity other than the PAPR, such as the energy above a clipping level, which tracks the distortion of the amplifier more closely.
  • Sub-block rotation. Partial transmit sequences restrict the phases to be constant on blocks of subcarriers, which reduces the number of inverse FFTs and the side information for a given number of candidates.

When to use it

Use SLM when the link can carry a few bits of protected side information per symbol, the transmitter can afford UU inverse FFTs, and no in-band distortion is acceptable, for example with dense QAM. A table of 4 to 16 sequences gives most of the practical gain. For a mobile uplink with a tight power budget, a waveform with a low PAPR by design, such as SC-FDMA, is the usual choice instead.

Pitfalls

  • Selecting at the Nyquist rate. Line L3 with L=1L = 1 ranks the candidates by their samples only, and the selected candidate can still have a high peak between samples. Use L≥4L \ge 4 in line L3.
  • Leaving out plain OFDM. A table whose first sequence is not all ones loses the guarantee that SLM is never worse than plain OFDM. Keep P1=(1,…,1)P_1 = (1, \ldots, 1) in the table used by line L2.
  • Phases that are not of magnitude 1. Line L2 with ∣Pu[k]∣≠1|P_u[k]| \ne 1 changes the energy per subcarrier, and the division at the receiver amplifies the noise. Use unit-magnitude entries.
  • Pilots inside the rotation. If line L2 also rotates the pilot subcarriers, the receiver must know u∗u^\ast before it can estimate the channel. Set Pu[k]=1P_u[k] = 1 on the pilots, or make the index readable before channel estimation.
  • Unprotected index. Sending u∗u^\ast uncoded makes the symbol error rate at least the error rate of the index. Protect the index with strong coding or repetition.

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.

selected_mapping.pyI0RawGitHub
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/selected-mapping/. The authors are listed in prov/GWPD9C.jsonl.

"""Selected mapping (SLM) for the PAPR of OFDM (Bauml, Fischer and Huber 1996).

The transmitter and the receiver share U phase sequences P_1, ..., P_U of
length N with entries of magnitude 1; P_1 is all ones, so plain OFDM is one of
the candidates. The transmitter multiplies the data X by each P_u, builds each
candidate symbol oversampled by L, and sends the one with the lowest PAPR and
its index. The receiver divides by the chosen sequence, which is exact because
|P_u[k]| = 1. The FFT is a radix-2 FFT, so N and L must be powers of two.
"""

import cmath
import math
import random
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 phase_table(u: int, n: int, seed: int) -> list[list[complex]]:
    """U phase sequences with entries in {1, -1, j, -j}; the first is all ones."""
    rng = random.Random(seed)
    table = [[1 + 0j] * n]
    for _ in range(u - 1):
        table.append([rng.choice((1 + 0j, -1 + 0j, 1j, -1j)) for _ in range(n)])
    return table


def selected_mapping(X: Sequence[complex], table: Sequence[Sequence[complex]], L: int = 4) -> tuple[int, list[complex], list[float]]:
    """Return the chosen index u (0-based), its oversampled symbol and the PAPR of every candidate."""
    best, best_x, ratios = -1, None, []
    for u, p in enumerate(table):  # @line L1
        xu = [a * b for a, b in zip(X, p)]  # @line L2
        x = to_time(xu, L)  # @line L3
        r = papr(x)  # @line L4
        ratios.append(r)
        if best < 0 or r < ratios[best]:  # @line L5
            best, best_x = u, x
    return best, best_x, ratios  # @line L6


def slm_receive(Y: Sequence[complex], table: Sequence[Sequence[complex]], u: int) -> list[complex]:
    """Undo the phase sequence u on the equalized subcarrier values Y."""
    return [y * p.conjugate() for y, p in zip(Y, table[u])]
test_selected_mapping.py 77 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/selected-mapping/. The authors are listed in prov/GWPD9C.jsonl.

import cmath
import math
import random

from selected_mapping import fft, papr, phase_table, selected_mapping, slm_receive, to_bins, to_time

QPSK = [complex(a, b) / math.sqrt(2) for a in (1, -1) for b in (1, -1)]


def block(rng, n=64):
    return [rng.choice(QPSK) for _ in range(n)]


def direct_time(X, L):
    """The oversampled OFDM symbol from its definition."""
    n = len(X)
    freqs = list(range(n // 2)) + list(range(-(n // 2), 0))
    return [sum(X[i] * cmath.exp(2j * math.pi * f * m / (L * n)) for i, f in enumerate(freqs)) / math.sqrt(n) for m in range(L * n)]


def test_fft_and_oversampled_symbol():
    rng = random.Random(1)
    X = block(rng, 16)
    assert max(abs(a - b) for a, b in zip(to_time(X, 2), direct_time(X, 2))) < 1e-9
    assert max(abs(a - 16 * b) for a, b in zip(fft(fft(X), inverse=True), X)) < 1e-9


def test_table_shape():
    t = phase_table(8, 32, 9)
    assert len(t) == 8 and all(len(r) == 32 for r in t)
    assert all(v == 1 for v in t[0])
    assert all(v in (1, -1, 1j, -1j) for r in t for v in r)


def test_choice_matches_brute_force():
    rng = random.Random(2)
    table = phase_table(6, 16, 3)
    for _ in range(20):
        X = block(rng, 16)
        u, x, ratios = selected_mapping(X, table, 4)
        brute = [papr(direct_time([a * b for a, b in zip(X, p)], 4)) for p in table]
        assert max(abs(a - b) for a, b in zip(ratios, brute)) < 1e-9
        assert u == min(range(6), key=lambda i: (brute[i], i))
        assert abs(papr(x) - min(brute)) < 1e-9


def test_one_candidate_is_plain_ofdm():
    rng = random.Random(4)
    X = block(rng)
    u, x, _ = selected_mapping(X, phase_table(1, 64, 0), 4)
    assert u == 0
    assert max(abs(a - b) for a, b in zip(x, to_time(X, 4))) < 1e-12


def test_round_trip_recovers_the_data():
    rng = random.Random(5)
    table = phase_table(8, 64, 7)
    for _ in range(10):
        X = block(rng)
        u, x, _ = selected_mapping(X, table, 4)
        assert max(abs(a - b) for a, b in zip(slm_receive(to_bins(x, 4), table, u), X)) < 1e-9


def test_more_candidates_never_hurt():
    rng = random.Random(6)
    table = phase_table(8, 64, 11)
    gains = []
    for _ in range(40):
        X = block(rng)
        _, _, r = selected_mapping(X, table, 4)
        best = [min(r[:u]) for u in range(1, 9)]
        assert all(best[i + 1] <= best[i] for i in range(7))
        gains.append(10 * math.log10(r[0] / best[-1]))
    assert sum(gains) / len(gains) > 1.0

History

Bäuml, Fischer and Huber introduced selected mapping in 1996. In 1997 Müller and Huber published the related method of partial transmit sequences. The idea, choosing among several representations of the same data, does not depend on the constellation or on the number of subcarriers. The overview of Han and Lee (2005) compares it with the other PAPR methods by the reduction it gives, its side information and its cost.

References

  1. R. W. Bäuml, R. F. H. Fischer and J. B. Huber, Reducing the peak-to-average power ratio of multicarrier modulation by selected mapping, Electronics Letters 32(22), 1996, pages 2056 to 2057, the set of phase sequences, the choice of the candidate with the lowest PAPR and the side information
  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 selected mapping, and the comparison of the methods by distortion, side information and cost

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