33.1 Wavefront coding⧉
A photographer stopping down a lens to get the foreground and the background sharp knows the bargain by heart: a smaller aperture buys depth of field, and pays for it in light. Two stops down is two stops darker, which means a longer exposure (and motion blur) or accepting a noisier result from fewer photons; raising ISO does not replace the lost light. For a microscope or a machine-vision lens or a phone camera with a tiny sensor, the bargain can be unaffordable: you simply cannot stop down far enough to hold the whole scene in focus without starving the sensor. Wavefront coding is a way out that sounds, at first, backwards: make the lens blur more, on purpose, and fix it in software. Done right, one shot comes back sharp from near to far, with the aperture wide open.
This chapter is a clean example of the part's central move. The optics encode, and the computation decodes. It engineers the linear operator $A$ (Chapter 6.7, Image formation as a linear system) to improve conditioning over a specified depth and frequency range (Chapter 7.1, Imaging as Bayesian inference with probabilistic priors).
33.1.1 Why you cannot just deblur defocus⧉
The obvious idea is to skip the clever optics entirely: take an ordinary photo with its shallow depth of field, then deconvolve the out-of-focus regions back to sharpness. Defocus is a blur; blur is (locally) a convolution; deconvolution inverts a convolution. Why not just do it? Two problems sink the naive version, and understanding them is what motivates everything that follows.
Problem 1: the blur is not shift-invariant: it depends on depth. A defocused point images to a disc, the circle of confusion, whose diameter grows with how far the object sits from the focus plane. A scene with near and far objects therefore carries many blur sizes at once: the kernel is different at every pixel, set by that pixel's depth. Deconvolution wants one known kernel applied everywhere; defocus gives it a different unknown kernel everywhere. (There are also nasty occlusion effects at the boundary between a sharp foreground and a blurred background, where the blurred light bleeds across the edge.) Worse, to pick the right deconvolution kernel per pixel you would need a depth estimate or a joint depth-and-image reconstruction. That is itself a hard problem. Defocus is simply not the clean shift-invariant convolution that deconvolution is built to undo.
Problem 2: the blur kills information. Even where the blur is a known convolution, defocus is a particularly destructive one. A defocus blur is roughly a flat disc, and the Fourier transform of a disc has zeros: whole rings of spatial frequencies where the blur's response is exactly nothing. A frequency the blur multiplied by zero is gone; no deconvolution can divide it back, because dividing by zero recovers nothing but amplified noise. The out-of-focus disc does not merely scramble the high frequencies, it erases some of them. So even in the best case, deblurring ordinary defocus means fighting a kernel whose frequency response dips to zero, exactly where the information you want lived.
Ordinary defocus resists deblurring for two reasons. (1) Its blur kernel varies with depth, with a different unknown circle of confusion at every pixel, so it is not the single shift-invariant convolution deconvolution needs (and recovering the per-pixel depth is itself hard). (2) Its blur destroys information: a defocus disc has zeros in its frequency response, killing whole bands of spatial frequency that no deconvolution can restore. Wavefront coding attacks both by re-engineering the optics so the blur becomes depth-invariant and zero-free.
33.1.2 The fix: re-engineer the blur⧉
Here is the leap. Instead of accepting the lens's blur and struggling to invert it, wavefront coding changes the optical system so that its blur has the two properties deconvolution craves:
- the point-spread function changes little over the designed depth range (approximately depth-invariant), so a single known kernel describes the whole image, dissolving Problem 1; and
- the response avoids deep zeros over a useful band, improving inversion compared with strongly defocused ordinary optics. It still attenuates detail and requires a noise-aware decoder.
A blur with both properties is a code to be decoded rather than a flaw to tolerate. The catch, of course, is that the raw captured image now looks blurred everywhere, even on the in-focus subject. That is the point: the optics deliberately spreads every point of light into the same fixed, invertible smear, turning the intermediate capture into the part introduction's "code that is not yet a picture." One deconvolution by that one known smear then sharpens the entire scene (near, far, and in-between) in a single pass.
How do you build optics whose blur ignores depth? You stop the rays from converging. An ordinary lens bends every ray from a scene point to meet at one image point, which is precisely why the blur depends on depth, since the meeting point moves as the object moves. Wavefront coding puts a phase plate in the pupil that, in effect, makes the rays not converge to a point at any depth, so they form the same spread-out blob regardless of where the object was. Geometrically it does something close to a deliberate, well-chosen aberration. Its ray diagram looks like a controlled cousin of spherical aberration, where rays never cross at a single focus.
33.1.3 The cubic phase plate⧉
The encoder is a thin, transparent plate placed at the aperture whose thickness, and therefore the phase delay it adds to the wavefront passing through it, follows a cubic profile. In Dowski and Cathey's original 1995 design it is, in the separable form they assume, $\phi(x,y) = \alpha\,(x^3 + y^3)$: flat in the middle of the pupil, rising ever more steeply toward the rim, with opposite sign on opposite sides. The constant $\alpha$ sets how strong the coding is (large $\alpha$ values, about $\alpha \approx 90$ in their normalized units, mean a more depth-invariant but more blurred PSF). The plate is a phase element: it delays the light per pupil position rather than blocking it, so an ideal phase-only element does not absorb light as an amplitude mask does; real transmission, scattering, and finite-sensor losses remain; it only reshapes the wavefront, which is where the name wavefront coding comes from.
Why a cubic profile in particular, and not some other shape? This is the chapter's one piece of real optics. The tool the designers reach for is the ambiguity function, a way of laying out a lens's frequency response (its optical transfer function, the MTF with phase) for all defocus values at once, on a single 2-D plot: one axis is spatial frequency, the other is a radial line whose angle corresponds to the amount of misfocus. Read this way, an extended-depth-of-field system is one whose plot is the same along every misfocus line: its frequency response does not change as you defocus. The design question becomes: what pupil phase makes the ambiguity function flat across the misfocus direction? Using the stationary-phase approximation (an approximation for rapidly oscillating integrals, whose main contributions come near stationary points of the phase), Dowski and Cathey show that a cubic phase is the simplest one whose ambiguity function spreads its energy uniformly with misfocus. Its response along different defocus lines is nearly identical. That is the formal statement of "depth-invariant," and the cubic falls out as the natural mask shape. We will not push the math further: the cubic is a practical answer to making the blur less sensitive to depth over a designed range, and the heavier derivation lives in their appendix.
33.1.4 The depth-invariant PSF and a single deconvolution⧉
The payoff is best seen in the point-spread function, the image of a single point of light, which (as we saw with convolution) is the blur kernel. For an ordinary lens the PSF is a tight spot in focus that balloons into a wide disc as the object moves out of focus: it varies wildly with depth. For the cubic-coded lens the PSF is a blurred, asymmetric little streak, and it stays similar across a finite range of defocus. That invariance is the point. Because the coded PSF is fixed and known, one deconvolution by that single kernel applies to the entire image, and because the coded blur kept its high frequencies (its MTF has no zeros and stays well above the ordinary lens's misfocused MTF), reconstruction can be better conditioned than ordinary defocus inversion, though weakened frequencies still incur noise amplification.
So the pipeline is exactly the encode→decode pair of the part introduction. The optics encode: the cubic plate spreads every scene point into the same fixed, information-preserving smear, producing an intermediate image that is uniformly blurred and not yet a usable picture. The computation decodes: a single, depth-independent deconvolution by the known PSF restores contrast within the supported depth and frequency range. The result is an image with a depth of field many times deeper than the bare lens, captured in one shot, wide open, with no focusing and no scanning.
Both figures above draw a model of the answer. The simulation below computes it (Figure 33.1.4): it traces rays through a thin lens and a cubic plate, computes the diffraction PSF of the same pupil, blurs a scene whose parts sit at different depths, and deconvolves the capture with one kernel. At the default settings the plain PSF changes about five times as much over the depth range as the coded one. The plain MTF drops to zero at frequencies that move with defocus, while the coded MTF sits lower and never reaches zero. One Wiener deconvolution then sharpens the near and far planes of the coded capture, which no single kernel does for the plain one. The cost shows too: at the focal plane the plain lens wins by several decibels, and edges far from focus carry faint ghosts because the coded PSF still drifts a little with depth. Deconvolving each depth of the plain capture with its own PSF, which requires the depth map, does not rescue it either, since the detail at its zeros is gone.

33.1.5 What it costs⧉
Wavefront coding is not free, and the accounting matters. The deconvolution that decodes the image also amplifies noise: restoring the high frequencies the coded blur attenuated means boosting whatever noise sits at those frequencies, so the final image carries a noise penalty (Dowski and Cathey estimate the coded system needs a few extra bits of dynamic range to pay for the inverse filter). The coded PSF is also only approximately depth-invariant (over a large but finite misfocus range), so very near or very far objects eventually drift outside the band where the single kernel works. And the asymmetric streak of the cubic PSF can leave faint artifacts in the deconvolved result, especially at high-contrast edges, since no real inverse filter is perfect. The trade is the usual one for coded imaging: you accept a controlled, invertible degradation and a noise premium in exchange for an imaging capability, here a single-shot extended depth of field, that no passive lens of the same speed could deliver.
33.1.6 Where it sits⧉
Wavefront coding is one member of a family, and naming its siblings places it. It is a phase code: the cubic plate delays light without blocking it, so its ideal modulation preserves optical power, which is an advantage for wavefront shaping. Its closest cousin is the coded aperture of the next chapters, which instead puts a patterned amplitude mask in the pupil, blocking light in a chosen pattern so that depth is encoded into the defocus blur in a way that can be read back out and inverted (Levin et al. 2007). These particular designs serve different goals. Phase masks can also encode depth, and amplitude masks can serve reconstruction goals other than depth estimation; amplitude versus phase does not determine the task. Both are the same idea: shape the pupil so the blur becomes a decodable code. They apply that idea to the two things you can do to a wavefront, its amplitude or its phase.
There is also a clean temporal analog. Just as the cubic plate makes the defocus blur the same at every depth, motion-invariant photography sweeps the camera during the exposure so that the motion blur becomes approximately invariant over a designed range of velocities along the sweep direction, again with an approximately velocity-invariant PSF that one deconvolution removes (Levin et al. 2008 (motion-invariant)). Wavefront coding codes the spatial blur of focus; motion-invariant capture codes the temporal blur of motion; in both, a deliberate, engineered, invariant blur is the encoder and one deconvolution is the decoder.
That deconvolution (how you invert a known blur, and what to do when the kernel is not known) is the subject of Chapter 16.4, Blind deblurring. Here we needed only the promise wavefront coding relies on: a blur that is fixed, depth-invariant, and free of zeros is a blur you can take back out. Engineer such a blur into the optics, and depth of field stops being something you buy with light and becomes something you compute.