Rate–distortion theory and test channels
Trade block description rate against average distortion and distinguish an optimizing joint distribution from an implemented symbol-by-symbol codec.
On this page
The question for today
What you’ll understand
- State the finite-alphabet iid expected-distortion rate–distortion optimization.
- Use correct binary and Gaussian test-channel constructions.
- Distinguish average distortion, exact reconstruction and block-coding achievability.
Lossy compression asks which details can be changed within a specified distortion budget. A photograph error metric and a symbol mismatch count define different tasks, even on the same data. Rate–distortion theory fixes the source law and distortion measure, then finds the least asymptotic description rate. An optimizing test channel describes the joint statistics to target; it is not automatically a ready-to-run one-symbol encoder that transmits fractional bits. Block coding is what connects that statistical optimum to an operational code.
A distortion budget defines the reconstruction task
Start with an iid finite-alphabet source, a finite reconstruction alphabet and a bounded nonnegative distortion d(x,x-hat). A length-n code selects one of M reconstructions, and its rate is log₂M/n. The distortion criterion is the expected average of the n symbol distortions. The information formula minimizes I(X;X-hat) over stochastic conditional reconstruction laws whose expected distortion is at most D. A deterministic one-symbol map is only one restricted candidate in that minimization.
For distortion levels above the minimum attainable value, rates strictly above this function permit block codes with expected distortion at most D plus any fixed positive slack for sufficiently large lengths. Taking limits or closures gives the operational rate–distortion tradeoff, including boundaries. The finite-alphabet bounded-distortion theorem does not itself prove every continuous-source formula. Those require their own integrability and coding arguments, such as the separate Gaussian squared-error result used below.
A test channel specifies a useful joint law
For fair binary symbols and Hamming distortion up to one half, a binary symmetric test channel with mismatch probability D attains the lower bound one minus h₂(D). One way to write the same joint law is backward: choose a fair reconstruction bit and add an independent Bernoulli-D error to obtain X. Conditional uncertainty is then h₂(D). A covering argument constructs a long codebook whose selected reconstruction has approximately this joint behavior with the source.
The function R(D) is nonincreasing and convex: allowing more distortion cannot increase the required rate, and time sharing between block codes gives the convex tradeoff. A zero-rate reconstruction minimizes distortion among constant reproduction symbols. Zero rate therefore does not mean zero distortion. Conversely, an average distortion bound does not prevent some blocks or coordinates from having much larger errors; a worst-case or excess-distortion requirement needs an explicitly different operational statement.
Backward independence is not forward additive noise
In the Gaussian construction, the independent error is added to the reconstruction to produce the source. Reversing the arrow while keeping the same independence assumption changes the joint distribution. The forward optimal reconstruction has conditional mean (1−D/σ²)X and independent Gaussian residual variance D(1−D/σ²). Simply setting the reconstruction equal to X plus independent variance-D noise achieves the desired distortion but generally uses more mutual information than necessary.
These formulas compare population source distributions and asymptotic block-coding rates. A learned compressor may have quantization constraints, limited codebook size or a mismatched source law, so matching a Gaussian mean-square error alone does not certify operation at the rate–distortion optimum. A practical comparison should record actual description length, the distortion criterion and any excess-distortion probability, rather than treating a test-channel mutual information as a measured file size.
Work it through
Use the Gaussian channel in the correct direction
A zero-mean Gaussian source has variance nine and desired squared-error distortion one. Find its rate–distortion value and an attaining joint distribution. Compare the naive forward additive-noise construction.
The optimum rate is half log₂(9/1)=log₂3≈1.584963 bits per source symbol.
Take independent Gaussian reconstruction variance eight and error variance one, then define X as their sum. The source variance is nine, distortion is one and conditional entropy difference gives the required rate.
By contrast, reconstruction X plus independent variance-one noise has mutual information half log₂10≈1.660964 bits. It meets the same distortion but exceeds the optimum, because it is a different joint law.
The optimal backward construction and the naive forward construction share an error variance but not a mutual-information cost.
The living notebook
Explore the model
Interactive lab · probability
Inspect average Hamming distortion under a test law
Pause and reset, then set both controls to p = 0.25 and n = 20. Interpret successes as independent mismatches under a binary test law; predict mean mismatch count five, variance 3.75 and mean per-symbol distortion 0.25. For a fresh comparison, pause and reset, then set p = 0.5 and n = 20; predict count mean ten and variance five. The first distortion corresponds to fair-bit R(D)≈0.1887, while the second permits zero rate. This instrument displays mismatch counts, not a covering code, reconstruction strings or achieved compression lengths.
- Mean · np
- 5
- Variance · np(1−p)
- 2.5
- Total probability
- 1
These are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forA distortion distribution helps define the target joint law, while coding achievability is an additional theorem.
Pause & reason
Check your understanding
Your turn
Try it yourself
For iid fair bits with Hamming distortion D=1/4, calculate R(D). Explain what happens at D=1/2 and whether a zero-rate constant reconstruction promises that every source symbol is correct.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Use the binary entropy value h₂(1/4), and distinguish expected mismatch from exact reconstruction.
Compare with the solution
The value is 1−h₂(1/4)≈0.188722 bits per symbol. At distortion one half, always reconstructing zero gives mean mismatch one half without transmitting a source-dependent message, so the rate can be zero. It certainly does not reconstruct every symbol correctly: ones are mismatches. For D=1/4, the stochastic binary test law describes the optimal information tradeoff, while sufficiently long block codes approach that target with the operational slack and limiting convention stated above.
Keep the idea
Take it with you
- Specify the source, distortion measure and operational average before quoting R(D).
- A test channel is an optimizing joint distribution whose coding realization uses a block theorem.
- Backward and forward Gaussian independence have different information costs.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.