Algorithm Search⌘K

Definitionintro

Gaussian Q-function

Also called Gaussian tail function.

The probability that a standard normal variable exceeds x, the function in which error rates in Gaussian noise are written.

The Gaussian Q-function gives the probability that a standard normal random variable is larger than xx. In additive Gaussian noise, the probability that the noise pushes a received sample past a decision boundary is a value of QQ, so the error rates of almost all modulation schemes are written with it. This page defines QQ, gives its standard forms and bounds, and shows how to compute it without loss of accuracy in floating point.

Definition

Let Z∼N(0,1)Z \sim \mathcal{N}(0, 1). The Q-function is

Q(x)=Pr⁡[Z>x]=12π∫x∞e−t2/2 dt.Q(x) = \Pr[Z > x] = \frac{1}{\sqrt{2\pi}} \int_x^\infty e^{-t^2/2}\, dt.

It is 1−Φ(x)1 - \Phi(x), where Φ\Phi is the standard normal distribution function. It is strictly decreasing, Q(0)=1/2Q(0) = 1/2, and Q(−x)=1−Q(x)Q(-x) = 1 - Q(x). In terms of the complementary error function,

Q(x)=12erfc⁡ ⁣(x/2),erfc⁡(u)=2 Q(2 u).Q(x) = \tfrac{1}{2} \operatorname{erfc}\!\big(x/\sqrt{2}\big), \qquad \operatorname{erfc}(u) = 2\,Q\big(\sqrt{2}\,u\big).

Some textbooks, Haykin's among them, write error rates with erfc. The two forms are the same function: for example 12erfc⁡(Eb/N0)=Q(2Eb/N0)\tfrac{1}{2}\operatorname{erfc}(\sqrt{E_b/N_0}) = Q(\sqrt{2E_b/N_0}).

The tail of a general Gaussian. If X∼N(μ,σ2)X \sim \mathcal{N}(\mu, \sigma^2), then Pr⁡[X>a]=Q((a−μ)/σ)\Pr[X > a] = Q((a - \mu)/\sigma). In the complex AWGN model with w∼CN(0,N0)w \sim \mathcal{CN}(0, N_0), the noise along any fixed real direction has the variance N0/2N_0/2. So the probability that it moves a point past the bisector to a point at the distance dd is

Q ⁣(d/2N0/2)=Q ⁣(d2N0).Q\!\left(\frac{d/2}{\sqrt{N_0/2}}\right) = Q\!\left(\frac{d}{\sqrt{2N_0}}\right).

Craig's form. Theorem (Craig 1991). For x≥0x \ge 0,

Q(x)=1π∫0π/2exp⁡ ⁣(−x22sin⁡2θ)dθ.Q(x) = \frac{1}{\pi} \int_0^{\pi/2} \exp\!\left(-\frac{x^2}{2\sin^2\theta}\right) d\theta.

Proof. Let (X,Y)(X, Y) be independent standard normals, so Q(x)=Pr⁡[X>x]Q(x) = \Pr[X > x]. In polar coordinates X=rcos⁡ϕX = r\cos\phi, Y=rsin⁡ϕY = r\sin\phi with x≥0x \ge 0, the event is ϕ∈(−π/2,π/2)\phi \in (-\pi/2, \pi/2) and r>x/cos⁡ϕr > x/\cos\phi. The joint density is e−r2/2/(2π)e^{-r^2/2}/(2\pi) times r dr dϕr\,dr\,d\phi, and ∫c∞e−r2/2 r dr=e−c2/2\int_{c}^\infty e^{-r^2/2}\, r\, dr = e^{-c^2/2}. So Q(x)=12π∫−π/2π/2exp⁡(−x2/(2cos⁡2ϕ)) dϕQ(x) = \frac{1}{2\pi}\int_{-\pi/2}^{\pi/2} \exp(-x^2/(2\cos^2\phi))\, d\phi. The integrand is even in ϕ\phi; substitute θ=π/2−ϕ\theta = \pi/2 - \phi on [0,π/2)[0, \pi/2). □\square

The limits of the integral are finite and the argument xx is not a limit, which makes the form useful for averaging over fading, where xx is random. The same method gives Q(x)2=1π∫0π/4exp⁡(−x2/(2sin⁡2θ)) dθQ(x)^2 = \frac{1}{\pi}\int_0^{\pi/4} \exp(-x^2/(2\sin^2\theta))\, d\theta for x≥0x \ge 0, and the exact symbol error rate of MM-PSK (see phase-shift keying).

Bounds. For x>0x > 0:

  1. Chernoff bound: Q(x)≤12e−x2/2Q(x) \le \tfrac{1}{2} e^{-x^2/2}. It follows from Craig's form, since sin⁡2θ≤1\sin^2\theta \le 1 makes each value of the integrand at most e−x2/2e^{-x^2/2}. The general Chernoff bound gives e−x2/2e^{-x^2/2} without the factor 1/21/2.
  2. Upper bound: Q(x)<φ(x)/xQ(x) < \varphi(x)/x, where φ(x)=e−x2/2/2π\varphi(x) = e^{-x^2/2}/\sqrt{2\pi}. Proof: on t>xt > x, 1<t/x1 < t/x, so Q(x)<∫x∞(t/x)φ(t) dt=φ(x)/xQ(x) < \int_x^\infty (t/x)\varphi(t)\, dt = \varphi(x)/x. □\square
  3. Lower bound: Q(x)>x1+x2φ(x)Q(x) > \frac{x}{1 + x^2}\varphi(x).

The bounds 2 and 3 have the ratio 1+1/x21 + 1/x^2, so both are close for large xx, and Q(x)∼φ(x)/xQ(x) \sim \varphi(x)/x as x→∞x \to \infty.

Inverse. Q−1(p)Q^{-1}(p) is the xx with Q(x)=pQ(x) = p. It gives the SNR that a target error rate needs. Since QQ is strictly decreasing and continuous, bisection finds it.

Floating-point computation. The values of QQ that matter in communications are small: a bit error rate of 10−910^{-9} is Q(6.0)Q(6.0). Computing Q(x)Q(x) as 1−Φ(x)1 - \Phi(x) subtracts two nearly equal numbers. In the floating-point model with unit roundoff u=2−53u = 2^{-53}, Φ(x)\Phi(x) is stored with an absolute error of about uu, so the relative error of the difference is about u/Q(x)u/Q(x), which grows without bound as xx grows. Computing 12erfc⁡(x/2)\tfrac{1}{2}\operatorname{erfc}(x/\sqrt{2}) instead keeps a small relative error over the whole range, because the library erfc is computed directly for large arguments. The table is a measurement in IEEE double precision, with Φ(x)=12(1+erf⁡(x/2))\Phi(x) = \tfrac{1}{2}(1 + \operatorname{erf}(x/\sqrt{2})) and Python's math.erf and math.erfc.

xx Q(x)Q(x) by erfc relative error of 1−Φ(x)1 - \Phi(x)
3 1.3499×10−31.3499 \times 10^{-3} 5.8×10−155.8 \times 10^{-15}
5 2.8665×10−72.8665 \times 10^{-7} −2.3×10−10-2.3 \times 10^{-10}
6 9.8659×10−109.8659 \times 10^{-10} 5.6×10−85.6 \times 10^{-8}
7 1.2798×10−121.2798 \times 10^{-12} 4.1×10−54.1 \times 10^{-5}
8 6.2210×10−166.2210 \times 10^{-16} 7.1×10−27.1 \times 10^{-2}
9 1.1286×10−191.1286 \times 10^{-19} the result is 0

Examples and non-examples

Values. Q(1)=0.158655Q(1) = 0.158655, Q(2)=0.022750Q(2) = 0.022750, Q(3)=0.0013499Q(3) = 0.0013499, Q(4)=3.1671×10−5Q(4) = 3.1671 \times 10^{-5}, Q(5)=2.8665×10−7Q(5) = 2.8665 \times 10^{-7}. For the inverse, Q−1(10−3)=3.0902Q^{-1}(10^{-3}) = 3.0902, Q−1(10−5)=4.2649Q^{-1}(10^{-5}) = 4.2649 and Q−1(10−6)=4.7534Q^{-1}(10^{-6}) = 4.7534.

The bounds at x=3x = 3. The Chernoff bound gives 0.00555450.0055545, four times too large. The upper bound φ(3)/3\varphi(3)/3 gives 0.00147730.0014773 and the lower bound 310φ(3)\tfrac{3}{10}\varphi(3) gives 0.00132960.0013296; the true value 0.00134990.0013499 lies between them.

BPSK. With the points ±Eb\pm\sqrt{E_b}, d=2Ebd = 2\sqrt{E_b}, and the bit error rate is Q(2Eb/N0)Q(\sqrt{2E_b/N_0}). At Eb/N0=0E_b/N_0 = 0 dB this is Q(2)=0.078650Q(\sqrt 2) = 0.078650, at 4 dB it is 0.0125010.012501, and at 8 dB it is 1.9091×10−41.9091 \times 10^{-4}. The bit error rate 10−510^{-5} needs 2Eb/N0=Q−1(10−5)=4.2649\sqrt{2E_b/N_0} = Q^{-1}(10^{-5}) = 4.2649, so Eb/N0=9.0946E_b/N_0 = 9.0946, which is 9.588 dB.

Craig's integral in practice. At x=3x = 3, the midpoint rule with NN equal steps on [0,π/2][0, \pi/2] has a relative error of −1.1×10−3-1.1 \times 10^{-3} for N=4N = 4, 3.1×10−63.1 \times 10^{-6} for N=8N = 8, −1.9×10−10-1.9 \times 10^{-10} for N=16N = 16, and about 10−1510^{-15} for N=32N = 32. The integrand is smooth and all its derivatives vanish at θ=0\theta = 0, so the rule converges very fast.

Non-example: the tail of a Rayleigh or chi-square variable. The probability that the envelope of complex Gaussian noise exceeds a threshold is e−r2/N0e^{-r^2/N_0}, not a value of QQ. Error rates of noncoherent detectors are written with such exponentials, and error rates on a fading channel are averages of QQ over the fading, not values of QQ.

  • Normal distribution function. Φ(x)=1−Q(x)\Phi(x) = 1 - Q(x), and QQ is the upper tail of the standard normal distribution. The central limit theorem is one reason Gaussian tails appear so often.
  • Error function. erf⁡(u)=1−erfc⁡(u)\operatorname{erf}(u) = 1 - \operatorname{erfc}(u) and erfc⁡(u)=2Q(2u)\operatorname{erfc}(u) = 2Q(\sqrt{2}u).
  • Pairwise error probability. Q(d/2N0)Q(d/\sqrt{2N_0}) for two points at the distance dd; the union bound adds such terms to bound the symbol error rate.
  • Error rates. The symbol error rate and the bit error rate of PAM, PSK and QAM in AWGN are sums and products of values of QQ.
  • Simulation of small tails. Plain Monte Carlo needs about 100/Q(x)100/Q(x) samples to see 100 errors; importance sampling estimates small tail probabilities with far fewer samples.

References

  1. John G. Proakis and Masoud Salehi, Digital Communications, fifth edition, McGraw-Hill, 2008, Section 2.3, Some Useful Random Variables (the Gaussian random variable and the Q-function), and Section 2.4, Bounds on Tail Probabilities
  2. John W. Craig, A new, simple and exact result for calculating the probability of error for two-dimensional signal constellations, MILCOM 91 Conference Record, 1991, pp. 571-575 (the integral of Q over a finite range of angles)
  3. Marvin K. Simon and Mohamed-Slim Alouini, Digital Communication over Fading Channels, second edition, Wiley, 2005, Chapter 4, Alternative Representations of Classical Functions, Section 4.1, Gaussian Q-Function

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)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/8K2YAC/text.yaml