Definitioncore
Level crossing rate
Also called LCR, average fade duration.
The mean number of times per second that a fading envelope crosses a level going down. In Clarke's model it is sqrt(2 pi) f_D rho e^(-rho^2) at level rho relative to the RMS value.
The level crossing rate of a fading channel is the mean number of times per second that the envelope crosses a level in the downward direction. Together with the average fade duration , the mean time the envelope stays below after such a crossing, it describes how fades come in time: how often, and for how long. The two numbers are different quantities: is a rate and is a time, and their product is the fraction of time spent below . In Clarke's model both have closed forms that go back to Rice's analysis of random noise: at the level relative to the RMS envelope.
Definition
Crossings. Let be the envelope of a stationary fading process with mean power , and let . A downward crossing of is a time at which and goes from above to below it. The level crossing rate is
which for a stationary ergodic process equals the expected number of downward crossings per second. It is usual to give the level in normalized form, , so that (0 dB) is the RMS value and is dB below it. A stationary process crosses upward as often as downward, so also counts upward crossings.
Average fade duration. A fade below starts at a downward crossing and ends at the next upward crossing. Over a long time the envelope is below for a total of about seconds, split into about fades. So the average fade duration is
Rice's formula (a theorem). If is differentiable and and its derivative have a joint density , then
The idea: in a short interval , a crossing upward happens when lies in with slope , an event of probability . Rice derived the rate of zeros of a Gaussian process this way and used the same joint statistics of a process and its derivative for the envelope (Rice 1944 and 1945).
Rayleigh fading with a symmetric Doppler spectrum (a closed form under these assumptions). Let be a circular complex Gaussian process with mean power and a Doppler spectrum that is even about , with RMS width . Then
Proof. Each of and has variance and autocorrelation . Since the spectrum is even, , , and are uncorrelated at the same , so they are independent Gaussian variables. The derivatives have variance . Write and . From , . Given , this is a sum of independent Gaussians with total variance . So , independent of , and with the Rayleigh density . Rice's formula gives
With , the formula for follows.
Clarke's model. The Clarke spectrum has , so
These are the formulas of Jakes (1974) and of Goldsmith (Section 3.2.3), and they are closed forms under the assumptions of the model: isotropic scattering, no line of sight, a stationary process.
Properties. For Rayleigh fading with an even spectrum:
- Scaling. is proportional to and to . Doubling the speed doubles the rate of fades and halves their length.
- Most crossings at dB. is largest at . In Clarke's model the maximum rate is .
- Deep fades. For , and . Each dB lower level cuts the rate of fades by about and their length by the same factor, so the time spent below the level falls by .
- Product. , the outage probability at that level.
Examples and non-examples
Check values. In Clarke's model, at the level : and . Their product is . More values:
| level | ||||
|---|---|---|---|---|
| dB | ||||
| dB | ||||
| dB | ||||
| dB | ||||
| dB |
A car at 108 km/h. At m/s and MHz, Hz. The envelope falls below its RMS value times per second, for ms on average. It falls dB below times per second for ms, and dB below times per second for ms. At kbit/s, a dB fade spans about bits, so a code needs an interleaver deeper than that.
A walker. At km/h and GHz, Hz. Fades dB deep come times per second and last ms each. These are much longer than at vehicle speeds, which is why slow terminals suffer from long bursts of errors.
Estimating from a sample path. On a sampled envelope , count the with and divide by the length of the record; divide the time below by that count to get . The sampling interval must be well below , or short fades fall between samples.
LCR-AFD(ρ, f_D) ▷ Clarke's model, ρ = R / √Ω- 1
N ← √(2π) · f_D · ρ · e^(-ρ²) - 2
P ← 1 - e^(-ρ²) ▷ Pr[r < R] for a Rayleigh envelope - 3
return N, P / N COUNT-CROSSINGS(r[0..n-1], R, Δt) ▷ estimates from a sampled envelope- 4
c ← number of k in 1..n-1 with r[k-1] ≥ R > r[k] - 5
b ← number of k in 0..n-1 with r[k] < R - 6
return c / (n Δt), (b · Δt) / c
The implementation follows this outline. Its tests check the table above and the proof's general formula, and they count crossings on sample paths made by summing sinusoids with random angles and phases, a method close to the Zheng and Xiao simulator. The counts agree with the closed forms within a stated tolerance, not exactly, because such a sum is only close to Gaussian.
Non-example: block fading. A block fading model holds fixed over a block and redraws it at the next one. The envelope jumps at the block edges and is not differentiable, so Rice's formula does not apply. The number of crossings per second depends on the block length, not on any Doppler spectrum.
Non-example: the coherence time. The coherence time is a lag at which the correlation of falls to a set value. It does not depend on a level. does: in Clarke's model, fades below dB last , and the coherence time at correlation is .
Non-example: the rate of the power. The power crosses exactly when crosses , so it has the same crossing rate at the matching level. Quoting against a level in dB of power and a level in dB of amplitude gives the same table only because .
Related definitions
- Clarke model: the model behind the closed forms on this page.
- Rayleigh fading channel: the first-order distribution .
- Doppler spread: , which sets the scale of .
- Outage probability: the fraction of time below a level, equal to .
- Gilbert-Elliott channel: a two-state model of good and bad periods whose transition rates can be fitted to and .
- Jakes fading simulator: a generator whose crossing rate is a common test.
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.
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/level-crossing-rate/. The authors are listed in prov/Y8DDW4.jsonl.
"""Level crossing rate and average fade duration of a fading envelope.
rho = R / sqrt(Omega) is the level relative to the RMS envelope, f_d the maximum Doppler
frequency in Hz (Clarke's model) and sigma_nu the RMS Doppler spread in Hz (any even spectrum).
"""
import math
from typing import Sequence, Tuple
def lcr_afd_clarke(rho: float, f_d: float) -> Tuple[float, float]:
"""(N_R, t_R) in Clarke's model: crossings per second and mean fade length in seconds."""
if rho <= 0 or f_d <= 0:
raise ValueError("rho and f_d must be positive")
n = math.sqrt(2 * math.pi) * f_d * rho * math.exp(-rho * rho) # @line L1
p = -math.expm1(-rho * rho) # @line L2
return n, p / n # @line L3
def lcr_afd_rayleigh(rho: float, sigma_nu: float) -> Tuple[float, float]:
"""(N_R, t_R) for Rayleigh fading with an even Doppler spectrum of RMS width sigma_nu."""
if rho <= 0 or sigma_nu <= 0:
raise ValueError("rho and sigma_nu must be positive")
n = 2 * math.sqrt(math.pi) * sigma_nu * rho * math.exp(-rho * rho)
return n, -math.expm1(-rho * rho) / n
def count_crossings(r: Sequence[float], level: float, dt: float) -> Tuple[float, float]:
"""Estimates (N_R, t_R) from envelope samples r[k] = r(k dt)."""
n = len(r)
if n < 2 or dt <= 0:
raise ValueError("need at least two samples and dt > 0")
c = sum(1 for k in range(1, n) if r[k - 1] >= level > r[k]) # @line L4
b = sum(1 for x in r if x < level) # @line L5
if c == 0:
return 0.0, math.inf
return c / (n * dt), b * dt / c # @line L6
test_level_crossing_rate.py 91 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/level-crossing-rate/. The authors are listed in prov/Y8DDW4.jsonl.
import cmath
import math
import random
from level_crossing_rate import count_crossings, lcr_afd_clarke, lcr_afd_rayleigh
def test_check_values() -> None:
n, t = lcr_afd_clarke(1.0, 1.0)
assert abs(n - 0.92214) < 5e-6 and abs(t - 0.68550) < 5e-6
assert abs(n * t - (1 - math.exp(-1))) < 1e-15
table = [
(1 / math.sqrt(2), 1.07505, 0.36600),
(10 ** (-10 / 20), 0.71723, 0.13268),
(0.1, 0.24817, 0.04009),
(10 ** (-30 / 20), 0.07919, 0.01262),
]
for rho, nr, tr in table:
n, t = lcr_afd_clarke(rho, 1.0)
assert abs(n - nr) < 5e-6 and abs(t - tr) < 5e-6
def test_example_numbers() -> None:
fd = 30 * 900e6 / 299_792_458.0
n, t = lcr_afd_clarke(1.0, fd)
assert abs(n - 83.05) < 0.01 and abs(t * 1e3 - 7.611) < 1e-3
n, t = lcr_afd_clarke(0.1, fd)
assert abs(n - 22.35) < 0.01 and abs(t * 1e3 - 0.4452) < 1e-4
fd = (3 / 3.6) * 2.4e9 / 299_792_458.0
n, t = lcr_afd_clarke(10 ** (-0.5), fd)
assert abs(n - 4.785) < 1e-3 and abs(t * 1e3 - 19.89) < 0.01
def test_scaling_and_maximum() -> None:
for rho in (0.05, 0.3, 1.0, 1.7):
n1, t1 = lcr_afd_clarke(rho, 10.0)
n2, t2 = lcr_afd_clarke(rho, 20.0)
assert abs(n2 - 2 * n1) < 1e-12 and abs(t2 - t1 / 2) < 1e-15
# Clarke is the general formula with sigma_nu = f_D / sqrt(2).
ng, tg = lcr_afd_rayleigh(rho, 10.0 / math.sqrt(2))
assert abs(ng - n1) < 1e-12 and abs(tg - t1) < 1e-15
grid = [i / 10000 for i in range(1, 30000)]
best = max(grid, key=lambda r: lcr_afd_clarke(r, 1.0)[0])
assert abs(best - 1 / math.sqrt(2)) < 2e-4
assert abs(lcr_afd_clarke(1 / math.sqrt(2), 1.0)[0] - math.sqrt(math.pi) * math.exp(-0.5)) < 1e-15
def envelope_path(rng: random.Random, m: int, fd: float, dt: float, n: int) -> list:
"""|h(k dt)| for h = sum of m sinusoids with random angles and phases, power 1."""
amp = 1 / math.sqrt(m)
z = [amp * cmath.exp(1j * rng.uniform(0, 2 * math.pi)) for _ in range(m)]
w = [cmath.exp(2j * math.pi * fd * math.cos(rng.uniform(0, 2 * math.pi)) * dt) for _ in range(m)]
out = []
for _ in range(n):
out.append(abs(sum(z)))
z = [a * b for a, b in zip(z, w)]
return out
def test_counts_on_sample_paths() -> None:
# Tolerance 10%: a sum of 32 sinusoids is close to, not exactly, a Gaussian process.
rng = random.Random(11)
fd, dt, n, reps = 1.0, 0.01, 8000, 16
paths = [envelope_path(rng, 32, fd, dt, n) for _ in range(reps)]
for rho in (1.0, 10 ** (-10 / 20)):
crossings = below = 0
for r in paths:
nr, tr = count_crossings(r, rho, dt)
crossings += round(nr * n * dt)
below += sum(1 for x in r if x < rho)
est_n = crossings / (reps * n * dt)
est_t = below * dt / crossings
exact_n, exact_t = lcr_afd_clarke(rho, fd)
assert abs(est_n / exact_n - 1) < 0.10
assert abs(est_t / exact_t - 1) < 0.10
def test_count_small_cases() -> None:
r = [2.0, 0.5, 2.0, 0.5, 0.5, 2.0]
n, t = count_crossings(r, 1.0, 0.5)
assert n == 2 / 3 and t == 0.75
assert count_crossings([2.0, 2.0], 1.0, 1.0) == (0.0, math.inf)
for bad in ((0.0, 1.0), (1.0, 0.0)):
try:
lcr_afd_clarke(*bad)
except ValueError:
continue
raise AssertionError("expected ValueError")
References
- S. O. Rice, Mathematical analysis of random noise, Bell System Technical Journal 23(3), 1944, pp. 282 to 332 (Parts I and II, shot noise, power spectra and correlation functions)
- S. O. Rice, Mathematical analysis of random noise (concluded), Bell System Technical Journal 24(1), 1945, pp. 46 to 156 (Part III, statistical properties of random noise, with Section 3.3 on the expected number of zeros per second)
- William C. Jakes (editor), Microwave Mobile Communications, Wiley, 1974; reissued by IEEE Press, 1994, the chapter on multipath interference (the level crossing rate and the duration of fades of the Rayleigh envelope under uniform angles of arrival)
- Andrea Goldsmith, Wireless Communications, Cambridge University Press, 2005, Section 3.2.3 (level crossing rate and average fade duration, equation 3.44)
- Theodore S. Rappaport, Wireless Communications, Principles and Practice, second edition, Prentice Hall, 2002, Section 5.7.3 (level crossing and fading statistics)
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 | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Code (python) | I0 not checked yet |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag Y8DDW4 Edit this page History Report an error Markdown