Mathematics.

source coding

Rate-Distortion Theory

Information Theory60 minDifficulty8 out of 10

Overview

Rate-distortion theory, developed by Shannon in 1959, provides the theoretical framework for lossy data compression. It answers the question: given that we allow a maximum average distortion D, what is the minimum bit rate R(D) required to encode a source? The rate-distortion function R(D) is a fundamental limit — no lossy compression scheme can operate below this curve. The trade-off is that allowing more distortion (larger D) permits lower bit rates. Applications include JPEG image compression, MP3 audio, video codecs, and neural network compression.

Intuition

Imagine you want to store a high-resolution photograph at low file size. You accept that the decoded image will not be a perfect reconstruction — some fine detail will be lost. Rate-distortion theory says: there is a minimum number of bits per pixel needed to keep the average distortion (e.g., mean squared error) below a target D. The curve R(D) traces this minimum over all possible D values. Allowing more blur (larger D) requires fewer bits (lower R). The curve drops sharply at first — a few extra bits buys a lot of quality — and flattens as D approaches 0 (lossless limit).

Formal Definition

Definition

Given source X with distribution p(x) and distortion measure d(x,x̂), the rate-distortion function R(D) is:

R(D)=minp(x^x):  E[d(X,X^)]DI(X;X^)R(D) = \min_{p(\hat{x}|x):\; \mathbb{E}[d(X,\hat{X})] \leq D} I(X;\hat{X})
Rate-distortion function
E[d(X,X^)]=x,x^p(x)p(x^x)d(x,x^)\mathbb{E}[d(X,\hat{X})] = \sum_{x,\hat{x}} p(x)p(\hat{x}|x)\,d(x,\hat{x})
Average distortion
R(D)=12logσ2D,0Dσ2R(D) = \frac{1}{2}\log\frac{\sigma^2}{D}, \quad 0 \leq D \leq \sigma^2
Gaussian source, squared-error distortion (in nats, div by ln 2 for bits)
R(D)=H(p)Hb(D),0DpR(D) = H(p) - H_b(D), \quad 0 \leq D \leq p
Binary source, Hamming distortion

Notation

NotationMeaning
R(D)R(D)Rate-distortion function: minimum rate for distortion D
d(x,x^)d(x,\hat{x})Distortion measure between original x and reconstruction x̂
DDMaximum allowable average distortion

Theorems

Theorem 1: Rate-Distortion Theorem
ForanyrateR>R(D),thereexistsasequenceof(2nR,n)lossycodeswithaveragedistortionapproachingDasn.Conversely,anysequenceofcodeswithrateR<R(D)hasaveragedistortionboundedbelowawayfromD.For any rate R > R(D), there exists a sequence of (2^{nR}, n) lossy codes with average distortion approaching D as n \to \infty. Conversely, any sequence of codes with rate R < R(D) has average distortion bounded below away from D.
Theorem 2: Gaussian Rate-Distortion
ForaGaussiansourceXN(0,σ2)withsquarederrordistortiond(x,x^)=(xx^)2,theratedistortionfunctionisR(D)=12log2σ2D bits, for 0Dσ2.For a Gaussian source X \sim \mathcal{N}(0, \sigma^2) with squared-error distortion d(x,\hat{x}) = (x-\hat{x})^2, the rate-distortion function is R(D) = \frac{1}{2}\log_2\frac{\sigma^2}{D} \text{ bits, for } 0 \leq D \leq \sigma^2.
Theorem 3: Properties of R(D)
ThefunctionR(D)isnonincreasingandconvexinD.R(0)=H(X)(losslessrate).R(D)=0forDDmaxwhereDmaxisthedistortionachievablebyignoringXentirely.The function R(D) is non-increasing and convex in D. R(0) = H(X) (lossless rate). R(D) = 0 for D \geq D_{\max} where D_{\max} is the distortion achievable by ignoring X entirely.

Worked Examples

  1. 1

    Apply the Gaussian rate-distortion formula.

    R(D)=12log2σ2DR(D) = \frac{1}{2}\log_2\frac{\sigma^2}{D}
  2. 2

    Substitute σ² = 4, D = 1.

    R(1)=12log241=12log24=12×2=1 bit/sampleR(1) = \frac{1}{2}\log_2\frac{4}{1} = \frac{1}{2}\log_2 4 = \frac{1}{2} \times 2 = 1 \text{ bit/sample}

✓ Answer

R(1) = 1 bit per sample. To achieve MSE ≤ 1 on a Gaussian source with variance 4, a minimum of 1 bit per sample is required.

Practice Problems

Mediumapplication

A binary source X ~ Bernoulli(0.3) uses Hamming distortion d(x,x̂) = 1_{x≠x̂}. What is R(D) for D = 0.1?

Mediumfree response

Explain why R(D) is a convex, non-increasing function of D, and what happens at D = 0 and D = Dmax.

Common Mistakes

Common Mistake

Thinking R(D) can be achieved by any simple quantization scheme.

R(D) is a theoretical lower bound. Practical schemes (like JPEG) approach but generally do not achieve R(D), especially for finite block lengths.

Common Mistake

Confusing rate-distortion theory (source coding with distortion) with channel capacity (channel coding).

Rate-distortion: how few bits to describe a source, with allowed distortion. Channel capacity: how many bits per channel use can be sent reliably. The two are related via the source-channel separation theorem.

Quiz

The rate-distortion function R(D) gives:
For a Gaussian source with variance σ², the rate-distortion function at distortion D is:
What is R(0) for any source X?

Historical Background

Shannon introduced rate-distortion theory in his 1959 paper 'Coding Theorems for a Discrete Source with a Fidelity Criterion.' While his 1948 paper established lossless compression limits, the 1959 work extended the theory to the more practically relevant case where some distortion is acceptable. The rate-distortion function for Gaussian sources with squared-error distortion — the simplest and most important case — leads to a water-filling interpretation that reappears throughout information theory and signal processing.

  1. 1959

    Shannon publishes the rate-distortion theorem for sources with fidelity criterion.

    Claude Shannon

  2. 1960s

    Rate-distortion theory extended to vector Gaussian sources; water-filling solution discovered.

    Berger

  3. 1971

    Toby Berger publishes the first book on rate-distortion theory.

    Toby Berger

  4. 1970s-present

    Rate-distortion principles underpin practical codecs: JPEG, MPEG, MP3.

Summary

  • The rate-distortion function R(D) = min_{E[d(X,X̂)]≤D} I(X;X̂) gives the minimum bit rate for lossy compression with average distortion ≤ D.
  • R(D) is convex and non-increasing: more distortion tolerated means fewer bits needed; at D=0, R(0) = H(X).
  • For Gaussian sources with squared-error distortion: R(D) = (1/2) log₂(σ²/D) bits — halving distortion costs (1/2) extra bit.
  • The rate-distortion theorem guarantees this bound is achievable (as block length n → ∞) and not improvable.

References

  1. PaperShannon, C.E. (1959). Coding Theorems for a Discrete Source with a Fidelity Criterion. IRE National Convention Record, 4, 142-163.
  2. BookCover, T. and Thomas, J. (2006). Elements of Information Theory, 2nd ed. Wiley. Ch. 10.