Algorithm Search⌘K

Definitionintro

Delay spread

Also called rms delay spread, multipath delay spread.

The spread in arrival time of the paths of a channel: the RMS width of the power delay profile, sigma_tau = sqrt(sum P_l tau_l^2 - (sum P_l tau_l)^2) for tap powers P_l that sum to 1.

The delay spread of a multipath channel measures how long the copies of one transmitted impulse keep arriving. The standard measure is the root mean square (RMS) delay spread στ\sigma_\tau, the standard deviation of the arrival time when each path is weighted by its power. It is the single number that decides whether a link sees intersymbol interference, how long a cyclic prefix must be, and over what band the channel gain stays nearly constant: the coherence bandwidth is of the order of 1/στ1/\sigma_\tau. The time-domain counterpart of this page in the Doppler domain is the Doppler spread.

Definition

The power delay profile. Let the channel have LL paths, or taps of a tapped delay line model, at the delays τ0≤τ1≤⋯≤τL−1\tau_0 \le \tau_1 \le \cdots \le \tau_{L-1} in seconds, with the mean powers Pl=E∣hl∣2≥0P_l = \mathbb{E}|h_l|^2 \ge 0. The list of pairs (τl,Pl)(\tau_l, P_l) is the power delay profile (PDP). It is a property of the statistics of the channel, not of one realization: in the WSSUS model it is the mean power at each delay. Delays are measured from the first arrival, so τ0=0\tau_0 = 0 unless the page says otherwise, and the powers are normalized so that ∑lPl=1\sum_l P_l = 1. For a profile that is not normalized, divide every sum below by ∑lPl\sum_l P_l.

Mean delay and RMS delay spread. With these weights,

τˉ=∑lPlτl,στ=∑lPl(τl−τˉ)2=∑lPlτl2−τˉ2.\bar\tau = \sum_{l} P_l \tau_l, \qquad \sigma_\tau = \sqrt{\sum_l P_l (\tau_l - \bar\tau)^2} = \sqrt{\sum_l P_l \tau_l^2 - \bar\tau^2}.

τˉ\bar\tau is the mean excess delay and στ\sigma_\tau is the RMS delay spread. The two forms of στ\sigma_\tau are equal because ∑lPl(τl−τˉ)2=∑lPlτl2−2τˉ∑lPlτl+τˉ2∑lPl\sum_l P_l(\tau_l - \bar\tau)^2 = \sum_l P_l \tau_l^2 - 2\bar\tau \sum_l P_l \tau_l + \bar\tau^2 \sum_l P_l and ∑lPl=1\sum_l P_l = 1. For a continuous profile P(τ)≥0P(\tau) \ge 0 with ∫P=1\int P = 1, replace the sums by integrals over τ\tau.

Maximum excess delay. For a threshold of XX dB, the maximum excess delay is τX−τ0\tau_X - \tau_0, where τX\tau_X is the largest delay whose power is within XX dB of the strongest path (Rappaport, Section 5.4.1). It depends on XX, and one weak late path can make it large while στ\sigma_\tau hardly moves. Tse and Viswanath write TdT_d for the largest difference of path delays, which is the maximum excess delay with no threshold.

Properties. For every normalized profile:

  1. Shift invariance. Adding the same constant to every delay changes τˉ\bar\tau by that constant and leaves στ\sigma_\tau unchanged, because στ\sigma_\tau uses only τl−τˉ\tau_l - \bar\tau.
  2. Scaling. Multiplying every delay by a>0a > 0 multiplies τˉ\bar\tau and στ\sigma_\tau by aa. The link-level models of 3GPP TR 38.901 use this: their delays are normalized to στ=1\sigma_\tau = 1 and scaled to the wanted spread.
  3. Range. 0≤στ≤(τL−1−τ0)/20 \le \sigma_\tau \le (\tau_{L-1} - \tau_0)/2. The lower bound holds with equality only when all the power sits at one delay. The upper bound holds because a variable in an interval of length DD has variance at most D2/4D^2/4, with equality for two equal taps at the ends.
  4. Link to frequency. Let R(Δf)=∑lPle−j2πΔfτlR(\Delta f) = \sum_l P_l e^{-j 2\pi \Delta f \tau_l} be the normalized correlation of the channel gain at two frequencies Δf\Delta f apart. A Taylor expansion of e−j2πΔf(τl−τˉ)e^{-j 2\pi \Delta f (\tau_l - \bar\tau)} gives
    ej2πΔfτˉR(Δf)=1−2π2στ2Δf2+O(Δf3),e^{j 2\pi \Delta f \bar\tau} R(\Delta f) = 1 - 2\pi^2 \sigma_\tau^2 \Delta f^2 + O(\Delta f^3),
    since the first-order term ∑lPl(τl−τˉ)\sum_l P_l (\tau_l - \bar\tau) is zero. So στ\sigma_\tau sets how fast the gains at nearby frequencies decorrelate. Fleury (1996) proved the bound ∣R(Δf)∣≥cos⁡(2πστΔf)|R(\Delta f)| \ge \cos(2\pi \sigma_\tau \Delta f) for 2πστΔf≤π/22\pi \sigma_\tau \Delta f \le \pi/2; the proof and its use are on the coherence bandwidth page.

Flat or selective. A symbol of duration TsT_s sees little intersymbol interference when στ\sigma_\tau is small compared with TsT_s. Rappaport (Section 5.5) uses Ts≥10στT_s \ge 10\sigma_\tau as the condition for flat fading. That is a rule of thumb, not a theorem: the real effect depends on the shape of the profile, the pulse and the receiver.

Computing the delay spread

The function below uses the centered form of στ\sigma_\tau. The form ∑Plτl2−τˉ2\sum P_l \tau_l^2 - \bar\tau^2 is equal in exact arithmetic but loses digits in floating point when all delays share a large offset, for example absolute delays of 3.33.3 microseconds that differ by a few nanoseconds.

  1. RMS-DELAY-SPREAD(τ[0..L-1], P[0..L-1]) ▷ delays and mean powers, any positive scale
  2. 1S ← Σ_l P[l]
  3. 2μ ← (Σ_l P[l] · τ[l]) / S ▷ mean excess delay
  4. 3v ← (Σ_l P[l] · (τ[l] - μ)²) / S ▷ centered second moment
  5. 4return μ, √v
  6. MAX-EXCESS-DELAY(τ[0..L-1], P[0..L-1], X) ▷ X is the threshold in dB
  7. 5t ← max_l P[l] · 10^(-X/10)
  8. 6return max{τ[l] : P[l] ≥ t} - min_l τ[l]

The cost is O(L)O(L) operations in the real-RAM model. The implementation also gives the frequency correlation ∣R(Δf)∣|R(\Delta f)|. Its tests check the examples on this page in exact rational arithmetic, the 3GPP values below, the shift and scale properties, and Fleury's bound on random profiles.

Examples and non-examples

Two equal paths. Taps of power 1/21/2 at 00 and 11 microsecond give τˉ=0.5\bar\tau = 0.5 microseconds and στ=0.5−0.25=0.5\sigma_\tau = \sqrt{0.5 - 0.25} = 0.5 microseconds, the largest value that a span of 1 microsecond allows.

Four paths. Powers (1/2,1/4,1/8,1/8)(1/2, 1/4, 1/8, 1/8), that is 00, −3.01-3.01, −6.02-6.02 and −6.02-6.02 dB, at delays (0,1,2,4)(0, 1, 2, 4) microseconds:

τˉ=14+14+12=1,∑lPlτl2=14+12+2=2.75,στ=2.75−1=1.75=1.3229 microseconds.\bar\tau = \tfrac14 + \tfrac14 + \tfrac12 = 1, \qquad \sum_l P_l \tau_l^2 = \tfrac14 + \tfrac12 + 2 = 2.75, \qquad \sigma_\tau = \sqrt{2.75 - 1} = \sqrt{1.75} = 1.3229 \text{ microseconds}.

The maximum excess delay is 44 microseconds for X=10X = 10 dB, since every tap is within 6.026.02 dB of the strongest, and 11 microsecond for X=5X = 5 dB.

An exponential profile. P(τ)=e−τ/τ0/τ0P(\tau) = e^{-\tau/\tau_0}/\tau_0 for τ≥0\tau \ge 0 has τˉ=∫0∞τP(τ) dτ=τ0\bar\tau = \int_0^\infty \tau P(\tau)\, d\tau = \tau_0 and the second moment ∫0∞τ2P(τ) dτ=2τ02\int_0^\infty \tau^2 P(\tau)\, d\tau = 2\tau_0^2, so στ=2τ02−τ02=τ0\sigma_\tau = \sqrt{2\tau_0^2 - \tau_0^2} = \tau_0. This shape is common in indoor models, for example inside each cluster of the Saleh-Valenzuela model.

Standard profiles. The LTE test profiles of 3GPP TS 36.104, Annex B.2, are tapped delay lines. EPA has taps at 0,30,70,90,110,190,4100, 30, 70, 90, 110, 190, 410 ns with powers 0,−1,−2,−3,−8,−17.2,−20.80, -1, -2, -3, -8, -17.2, -20.8 dB. Converting the powers to linear values, normalizing them and applying the definition gives τˉ=44.2\bar\tau = 44.2 ns and στ=43.1\sigma_\tau = 43.1 ns. The same steps give 356.6356.6 ns for EVA and 990.9990.9 ns for ETU. The standard lists 4343, 357357 and 991991 ns.

Symbol length. With στ=991\sigma_\tau = 991 ns, a single-carrier link at 11 Msymbol/s (Ts=1T_s = 1 microsecond) has Ts≈στT_s \approx \sigma_\tau and needs an equalizer. LTE instead uses OFDM with a symbol of about 66.766.7 microseconds and a normal cyclic prefix of about 4.74.7 microseconds. The prefix is almost five times στ\sigma_\tau but a little shorter than the last ETU delay of 55 microseconds; that tap is 77 dB below the strongest and leaks a small amount of interference.

Non-example: power from one realization. The squared magnitudes ∣hl∣2|h_l|^2 of one draw of the taps are not the PDP. The RMS width of one draw is a random variable, and its mean is not στ\sigma_\tau in general. The PDP needs an average over many realizations, or over a local area in measurements.

Non-example: averaging in dB. The weights must be linear powers. Weighting the EPA delays by the dB values, or by the amplitudes Pl\sqrt{P_l}, gives a different number that has no meaning as a delay spread.

Non-example: the largest delay. For ETU the largest delay is 55 microseconds and στ\sigma_\tau is 0.9910.991 microseconds. The maximum excess delay and the RMS delay spread answer different questions: the first sizes a cyclic prefix that must catch every path, the second sets the coherence bandwidth.

  • Coherence bandwidth: the frequency separation over which the gains stay correlated, bounded below in terms of στ\sigma_\tau.
  • Tapped delay line channel model: the model whose tap delays and powers form the PDP.
  • WSSUS channel model: the statistical frame in which the PDP is the mean power per delay, and the transform of the frequency correlation.
  • Doppler spread: the same kind of width, taken over the Doppler spectrum instead of the delays.
  • Intersymbol interference and cyclic prefix: the effects of a delay spread on a single-carrier and on a multicarrier link.
  • Rake receiver: a receiver that resolves the paths and combines them, which turns the delay spread into diversity.

Code

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.

delay_spread.pyI0RawGitHub
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/delay-spread/. The authors are listed in prov/T38XE2.jsonl.

"""Mean excess delay, RMS delay spread and maximum excess delay of a power delay profile.

A profile is a list of delays tau[l] and mean powers P[l] >= 0 in linear units (not dB).
The powers need not sum to 1; every moment is divided by their sum.
With int or Fraction inputs, delay_moments returns exact Fractions.
"""

import cmath
import math
from fractions import Fraction
from typing import Sequence, Tuple, Union

Number = Union[int, float, Fraction]


def _check(delays: Sequence[Number], powers: Sequence[Number]) -> None:
    if len(delays) != len(powers) or not delays:
        raise ValueError("delays and powers must be non-empty and of the same length")
    if any(p < 0 for p in powers) or sum(powers) <= 0:
        raise ValueError("powers must be non-negative with a positive sum")


def delay_moments(delays: Sequence[Number], powers: Sequence[Number]) -> Tuple[Number, Number]:
    """The mean excess delay and the variance sigma_tau^2 of the profile."""
    _check(delays, powers)
    s = sum(powers)  # @line L1
    if all(isinstance(x, (int, Fraction)) for x in list(delays) + list(powers)):
        s = Fraction(s)
    mu = sum(p * t for p, t in zip(powers, delays)) / s  # @line L2
    var = sum(p * (t - mu) ** 2 for p, t in zip(powers, delays)) / s  # @line L3
    return mu, var


def rms_delay_spread(delays: Sequence[Number], powers: Sequence[Number]) -> Tuple[float, float]:
    """The mean excess delay and the RMS delay spread sigma_tau."""
    mu, var = delay_moments(delays, powers)
    return float(mu), math.sqrt(var)  # @line L4


def max_excess_delay(delays: Sequence[Number], powers: Sequence[Number], x_db: float) -> Number:
    """The largest delay with power within x_db dB of the strongest tap, minus the first delay."""
    _check(delays, powers)
    t = max(powers) * 10 ** (-x_db / 10)  # @line L5
    return max(d for d, p in zip(delays, powers) if p >= t) - min(delays)  # @line L6


def frequency_correlation(delays: Sequence[float], powers: Sequence[float], df: float) -> complex:
    """R(df) = sum_l P_l exp(-j 2 pi df tau_l) / sum_l P_l, the normalized frequency correlation."""
    _check(delays, powers)
    s = float(sum(powers))
    return sum(p * cmath.exp(-2j * math.pi * df * t) for p, t in zip(powers, delays)) / s


def db_to_linear(powers_db: Sequence[float]) -> list:
    """Convert powers in dB to linear values."""
    return [10 ** (x / 10) for x in powers_db]
test_delay_spread.py 108 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/delay-spread/. The authors are listed in prov/T38XE2.jsonl.

import math
import random
from fractions import Fraction

from delay_spread import (
    db_to_linear,
    delay_moments,
    frequency_correlation,
    max_excess_delay,
    rms_delay_spread,
)

# 3GPP TS 36.104, Annex B.2: delays in ns, powers in dB.
EPA = ([0, 30, 70, 90, 110, 190, 410], [0, -1, -2, -3, -8, -17.2, -20.8])
EVA = ([0, 30, 150, 310, 370, 710, 1090, 1730, 2510], [0, -1.5, -1.4, -3.6, -0.6, -9.1, -7, -12, -16.9])
ETU = ([0, 50, 120, 200, 230, 500, 1600, 2300, 5000], [-1, -1, -1, 0, 0, 0, -3, -5, -7])


def test_four_tap_exact() -> None:
    p = [Fraction(1, 2), Fraction(1, 4), Fraction(1, 8), Fraction(1, 8)]
    d = [0, 1, 2, 4]
    mu, var = delay_moments(d, p)
    assert mu == 1 and var == Fraction(7, 4)
    assert abs(rms_delay_spread(d, p)[1] - 1.3228756555) < 1e-9
    pf = [float(x) for x in p]
    assert max_excess_delay(d, pf, 10) == 4
    assert max_excess_delay(d, pf, 5) == 1


def test_two_equal_taps() -> None:
    mu, var = delay_moments([0, 1], [1, 1])
    assert mu == Fraction(1, 2) and var == Fraction(1, 4)
    # |R| = |cos(pi df)| equals Fleury's bound cos(2 pi sigma df) with sigma = 1/2.
    for k in range(1, 50):
        df = k / 100
        assert abs(abs(frequency_correlation([0, 1], [1, 1], df)) - math.cos(math.pi * df)) < 1e-12


def test_exponential_profile() -> None:
    # A fine sampling of exp(-t) on [0, 40] gives mean and spread close to 1.
    h = 0.001
    d = [(i + 0.5) * h for i in range(40000)]
    p = [math.exp(-t) for t in d]
    mu, s = rms_delay_spread(d, p)
    assert abs(mu - 1) < 1e-4 and abs(s - 1) < 1e-4


def test_3gpp_profiles() -> None:
    for (d, pdb), mean, rms in ((EPA, 44.20, 43), (EVA, 253.92, 357), (ETU, 561.24, 991)):
        mu, s = rms_delay_spread(d, db_to_linear(pdb))
        assert abs(mu - mean) < 0.01
        assert round(s) == rms


def test_dB_weights_are_wrong() -> None:
    d, pdb = EPA
    wrong = rms_delay_spread(d, [-x + 21 for x in pdb])[1]
    assert abs(wrong - 43) > 10


def test_shift_and_scale() -> None:
    rng = random.Random(3)
    for _ in range(200):
        n = rng.randint(1, 8)
        d = [Fraction(rng.randint(0, 1000)) for _ in range(n)]
        p = [Fraction(rng.randint(1, 100)) for _ in range(n)]
        mu, var = delay_moments(d, p)
        c, a = Fraction(rng.randint(-500, 500)), Fraction(rng.randint(1, 9), rng.randint(1, 9))
        mu2, var2 = delay_moments([x + c for x in d], p)
        assert mu2 == mu + c and var2 == var
        mu3, var3 = delay_moments([a * x for x in d], p)
        assert mu3 == a * mu and var3 == a * a * var
        # Range: the variance is at most a quarter of the squared span.
        assert 0 <= var <= (max(d) - min(d)) ** 2 / 4


def test_fleury_bound_and_taylor() -> None:
    rng = random.Random(1)
    for _ in range(2000):
        n = rng.randint(2, 6)
        p = [rng.random() ** 3 + 1e-9 for _ in range(n)]
        d = [rng.random() * 10 for _ in range(n)]
        _, s = rms_delay_spread(d, p)
        for k in range(1, 26):
            df = 0.01 * k / s
            r = abs(frequency_correlation(d, p, df))
            assert r >= math.cos(2 * math.pi * s * df) - 1e-12
            assert r >= 1 - 2 * math.pi ** 2 * s * s * df * df - 1e-12
        # Taylor: 1 - Re(exp(j 2 pi df mu) R(df)) is close to 2 pi^2 sigma^2 df^2 for small df.
        mu, _ = rms_delay_spread(d, p)
        span = max(abs(t - mu) for t in d)
        if s < 0.1 * span:
            continue
        df = 2e-3 / span
        r = frequency_correlation(d, p, df) * complex(math.cos(2 * math.pi * df * mu), math.sin(2 * math.pi * df * mu))
        assert abs((1 - r.real) / (2 * math.pi ** 2 * s * s * df * df) - 1) < 1e-3


def test_bad_input() -> None:
    for d, p in (([], []), ([0, 1], [1]), ([0, 1], [0, 0]), ([0, 1], [1, -1])):
        try:
            delay_moments(d, p)
        except ValueError:
            continue
        raise AssertionError("expected ValueError")

References

  1. Theodore S. Rappaport, Wireless Communications, Principles and Practice, second edition, Prentice Hall, 2002, Section 5.4.1 (time dispersion parameters, the mean excess delay, the RMS delay spread and the maximum excess delay) and Section 5.5 (flat and frequency-selective fading)
  2. Andrea Goldsmith, Wireless Communications, Cambridge University Press, 2005, Section 3.3.1 (the power delay profile, its mean and RMS delay spread)
  3. David Tse and Pramod Viswanath, Fundamentals of Wireless Communication, Cambridge University Press, 2005, Section 2.3 (the delay spread T_d as the largest difference of path delays, and its relation to the coherence bandwidth) and Table 2.1
  4. 3GPP TS 36.104, Base Station radio transmission and reception (E-UTRA), Release 9 (ETSI TS 136 104 V9.11.0), Annex B.2 (multipath fading propagation conditions, the EPA, EVA and ETU delay profiles with RMS delay spreads of 43, 357 and 991 ns)
  5. Bernard H. Fleury, An uncertainty relation for WSS processes and its application to WSSUS systems, IEEE Transactions on Communications 44(12), 1632 to 1634, 1996, whole paper (the lower bound arccos(c)/(2 pi sigma_tau) on the coherence bandwidth at correlation level c)

Where this leads

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 proofH0 no proof
  • add a proof in proofs/ (06.5)
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)
WritingW4 complete
  • a review of the text: no review record reviews/T38XE2/text.yaml