Spatial Filtering and the 4f System
Take a photograph of a television screen and the printed halftone dots or the raster lines ruin it. Now imagine a machine that could reach into the picture, grab the offending periodic pattern, and pluck it out — leaving the scene untouched. That machine exists, it is made of two lenses, and it works because a lens lays an image's Fourier spectrum out on a physical plane you can touch. The 4f processor is the cleanest realisation of an idea that runs through all of imaging: filtering in frequency is convolution in space, and glass can do it at the speed of light. The layout is four focal lengths of empty space punctuated by two identical lenses. The object sits at the front focal plane of lens 1; one focal length on, lens 1 forms the object's exact Fourier transform in the shared central plane; one focal length past that, lens 2 transforms again and builds the image at the back focal plane. Because the central plane holds the honest spectrum — each spatial frequency of the object focused to its own spot — you can insert a mask there and edit frequencies by hand. Block the centre and you kill the uniform background (dark field); pass only the centre and you smooth away fine detail (low-pass); retard the centre by a quarter wave and invisible transparent objects spring into contrast (Zernike). Whatever transmission mask you place there, the output is the object convolved with , the inverse transform of the mask. That convolution is the whole physics. A 4f system with a Fourier-plane filter is an exact linear shift-invariant system whose impulse response you choose, and everything it does — smoothing, sharpening, pattern-matching, phase contrast — is one convolution. Even with an empty filter plane the finite lens apertures band-limit the spectrum, so the output is the object convolved with an Airy spot: the diffraction limit is convolution too. Abbe saw this in a microscope in 1873; Goodman made it the grammar of coherent optics; today it is the mental model behind every pupil, every point-spread function, and every optical correlator.
- The 4f processor is object → f → lens 1 → f → Fourier plane → f → lens 2 → f → image: two Fourier transforms with a filter plane between them.
- Lens 1 forms the object's exact spatial spectrum in the central plane, mapping spatial frequency to position by .
- A mask in that plane multiplies the spectrum, so the output is the input convolved with — an optical linear shift-invariant filter you design.
- Empty filter plane → an inverted, unit-magnification image; low-pass pinhole → smoothing/beam clean-up; central stop → edge enhancement/dark field; phase dot → Zernike phase contrast.
- A pinhole of radius passes spatial frequencies up to ; finite lens apertures band-limit even the empty system to the Abbe/Rayleigh resolution.
- Key idea: a Fourier-plane mask multiplies the spectrum, and by the convolution theorem the 4f output is the object convolved with the mask's impulse response — frequency-domain multiplication realised as real-space convolution, in glass.
A lens maps spatial frequency to position in its focal plane, so the 4f system exposes the object's spectrum on a physical plane. A mask there multiplies the spectrum; by the convolution theorem the output is the object convolved with — an optical implementation of any linear shift-invariant filter you can draw.
Where this lives today
The 4f architecture is everywhere light is processed coherently. The "spatial filter" on every laser table — objective, pinhole, collimating lens — is a 4f front end that scrubs a beam to a clean Gaussian. Phase-contrast and dark-field microscopes are 4f systems with a fixed Fourier-plane mask, letting biologists watch unstained living cells. Optical correlators and joint-transform correlators use a Fourier-plane matched filter for real-time pattern recognition. Modern spatial light modulators put a programmable, electrically-addressed mask in the Fourier plane, turning the 4f system into a reconfigurable optical computer used for adaptive optics, pulse shaping (a 4f grating-lens stretcher shapes femtosecond pulses frequency by frequency), optical tweezer arrays, and holographic display. The same block diagram, drawn abstractly, is the model for every imaging system's pupil — which is why the point-spread function and the optical transfer function, the O11 imaging-systems article revisits, are defined right there in the Fourier plane.
The physical picture
Think of the object as a stack of sinusoidal gratings, one per spatial frequency. Each grating diffracts the illuminating plane wave into beams tilted by , and lens 1 focuses every tilt to its own spot in the central plane. So the object is taken apart into its Fourier components and laid out along a ruler. Cover a spot and that grating vanishes from the reconstructed image; dim a band and you attenuate a range of frequencies. Abbe's insight was exactly this: an image is the interference of the diffraction orders that survive the system, so controlling the orders controls the picture. Lens 2 puts the picture back together by transforming a second time. Two forward transforms compose not to the identity but to a parity flip — — which is why the empty 4f system delivers an image that is inverted and exactly unit magnification. Nothing is magnified because both lenses share the same focal length; the system is a relay with a spectrum plane in the middle.
The central point of the Fourier plane, on axis at , is the DC term — the spatial average, the uniform background. Block it and only the varying parts of the image survive: dark field. Retard it by a quarter wave and it beats against the scattered light to turn a phase shift into a brightness change: Zernike phase contrast, the trick that made living cells visible without staining.
The core equations
Lens 1 performs the exact Fourier transform of the front-focal-plane object (the property owned by the Fourier-transform-of-a-lens article); the central plane holds that spectrum, with position tied to spatial frequency.
where: — object field in the front focal plane; — field in the central (Fourier) plane; the kernel identifies focal-plane position with spatial frequency. That identification is the ruler along the filter plane:
where: — object spatial frequencies (cycles per length); — position in the filter plane; — the scale factor. A mask of complex transmittance placed there multiplies the spectrum point by point.
where: — the transfer function you install by hand; — the filtered spectrum leaving the mask. Lens 2 transforms once more, and by the convolution theorem the output is a convolution — the equation that names this article.
where: — the impulse response (point-spread function), the inverse transform of the mask; — 2-D convolution; the is the parity flip of two forward transforms. Read it as the sentence "multiply the spectrum, convolve the image": the mask you draw is the system's impulse response, up to a Fourier transform. A real system band-limits itself: the finite clear radius of the lenses passes only frequencies up to a cutoff, which fixes the finest feature the processor can render.
where: — clear radius of the limiting aperture (a lens or a deliberate pinhole); — highest transmitted spatial frequency; — finest resolvable spacing. For a low-pass pinhole of radius the impulse response is an Airy spot, so the output is the object convolved with that spot.
The goal is to prove that the whole two-lens machine, with an arbitrary mask in the middle, produces an output equal to the input convolved with (up to inversion) — that is, to show a 4f system is an exact linear shift-invariant filter whose impulse response you set by drawing a mask. The strategy chains the single-lens Fourier property twice with a point-by-point multiply between, then invokes the convolution theorem. The one subtlety is that both lenses transform in the same direction, which is why the image comes out inverted rather than erect.
Step 1. Lens 1 maps the object to its spectrum in the filter plane, . Why the exact transform and not a Fresnel blur: the object sits in lens 1's front focal plane, so the residual quadratic phase vanishes — the front-focal-plane condition inherited from the Fourier-transform-of-a-lens result.
Step 2. The mask multiplies the spectrum, . Why this is a frequency-domain filter: each spatial frequency is at its own place, so multiplying by at position scales exactly that frequency — the definition of a linear filter's transfer function.
Step 3. Lens 2 Fourier-transforms the product. The transform of a product is a convolution: , with . Why convolution is unavoidable: this is the convolution theorem itself, realised physically — the mask's impulse response smears every point of the object identically, which is precisely shift-invariance.
Step 4. Because lens 2 performs a forward transform (not an inverse), the two forward transforms compose to the parity operator, giving the argument : . Why the image is inverted and unit-magnification: , and equal focal lengths mean no scale change — the 4f relay flips the picture but does not resize it.
Step 5. Set : then , the convolution is trivial, and — a perfect inverted image. Any non-trivial is a genuine spatial filter. Verified in verify_spatial-filtering-4f-system.py: a discrete two-transform cascade with a chosen mask reproduces to machine precision, returns the (parity-flipped) object, and a low-pass matches direct convolution with the Airy .
Go deeper · Derivation B · 1 minAbbe's condition — the smallest grating a finite aperture can image
The goal is to derive the resolution limit of the processor from first principles: the smallest period an object can have and still be reconstructed, given a limiting aperture of radius . The strategy follows Abbe's 1873 argument — an image is the interference of the diffraction orders that pass the system, so at least the zeroth and one first order must survive. Requiring the first order to clear the aperture yields the cutoff frequency and the classic resolution.
Step 1. A grating of period diffracts into orders at ; lens 1 focuses order to in the filter plane. Why the orders set everything: a grating's spectrum is a comb of spots at , and if a spot is blocked, that Fourier component is gone from the image.
Step 2. To reconstruct any periodic structure you need at least the DC (0th) and one 1st order to interfere; a single order alone gives a featureless blur. Why two orders is the minimum: one plane wave carries no fringe; two interfering beams are the least that makes a periodic intensity.
Step 3. The first order clears a limiting radius only if , i.e. . Writing gives for on-axis illumination, tightening to with oblique illumination that lets the order in on the far side. Why oblique illumination doubles resolution: tilting the input shifts the whole spectrum so that a higher first order sneaks under the aperture edge — the basis of condenser NA in microscopes. *Verified in verify_spatial-filtering-4f-system.py: the cutoff and are recomputed and matched to the Airy/Rayleigh limit.*
Limiting cases
| Case | Result | Meaning |
|---|---|---|
| Empty filter plane, | Perfect inverted image, unit magnification; two forward transforms make a parity flip. | |
| Low-pass pinhole, radius | Only frequencies below pass; output smoothed, laser beam cleaned of spatial noise. | |
| High-pass / dark field, central stop | DC and low frequencies blocked; uniform regions go dark, edges are enhanced. | |
| Quarter-wave phase dot on DC | Zernike phase contrast — a pure phase object becomes an intensity image. | |
| Finite lens aperture (even ) | The empty system still convolves the object with an Airy spot — the diffraction limit is a convolution. |
Worked examples
1 · A laser beam clean-up pinhole (confidence builder)
A spatial filter uses a lens of and a pinhole of radius in the Fourier plane, with a He–Ne laser, . What spatial frequencies survive, and how fine can the output vary?
Step 1. The pinhole passes frequencies up to . The denominator is the area . Why an area: position over gives inverse length, the units of spatial frequency.
Step 2. Evaluate: . Everything finer than this is blocked. Why the beam comes out clean: dust and scratches on upstream optics scatter light to high spatial frequencies, which land outside the pinhole and are rejected.
Step 3. The finest surviving intensity variation is roughly . Structure smaller than this is smoothed away — exactly the desired scrubbing of a Gaussian beam.
2 · Abbe resolution of the processor (exam level)
The same lens has a clear radius . What is the finest grating period it can image on axis, and what is its numerical aperture?
Step 1. Numerical aperture . Why : the marginal ray from the axis makes angle with the axis, and .
Step 2. On-axis Abbe limit ; with oblique illumination this halves to . Why this ties to Example 1's pinhole: a deliberate mm pinhole ( lp/mm, m) is a far tighter band-limit than the lens's own aperture — the pinhole, not the glass, sets the resolution when it is in place.
Physics of the portrait
The star of this system is not a person but an operation: convolution, the integral that slides one function across another and accumulates their overlap. It is what a linear shift-invariant system does — blur a point into a spot, and every point of the image gets the same spot, summed. The Fourier world's deepest reflex is that this sliding-and-summing in space becomes plain multiplication in frequency, and vice versa: the convolution theorem. The 4f processor is that theorem cast in glass. Multiply the spectrum by a mask in the middle plane, and the picture at the output has been convolved with the mask's impulse response. Sharpening, smoothing, edge-finding, pattern-matching — every one is a choice of convolution kernel, drawn as a transparency and dropped into a beam.
Origins · 1 minconvolution and how this was discovered
Convolution is the arithmetic of every linear, shift-invariant system, optical or otherwise. When a system responds to a point input with an impulse response (in optics, a point-spread function), its response to a general input is the convolution : each input point contributes a shifted, scaled copy of , and the copies add. The idea is old — d'Alembert and Fourier's contemporaries manipulated such integrals — but its optical meaning crystallised with Fourier optics: the convolution theorem, , says that convolving in space is multiplying in frequency. The 4f system is the physical embodiment: because a lens exposes the spectrum , a Fourier-plane mask multiplies it, and the second lens transforms the product back into the convolution . Blur, sharpen, correlate, or match a template — the machine does one thing, convolution, and only the kernel changes. Understanding that a point-spread function convolves the scene is the single idea that unifies this article with resolution, the Airy pattern, and the optical transfer function.
Going further
References. Saleh & Teich, Fundamentals of Photonics, 3rd ed., Ch. 4 (Fourier Optics); Hecht, Optics, 5th ed., Ch. 11 (Fourier methods; spatial filtering) and Ch. 13; J. W. Goodman, Introduction to Fourier Optics, 3rd ed., Ch. 5–8; Born & Wolf, Principles of Optics, Ch. 8.
Provenance. The Fourier-transform property of each lens and the 4f cascade follow Goodman Ch. 5–8 and Saleh & Teich Ch. 4; verify_spatial-filtering-4f-system.py re-derives the two-transform cascade with a mask and confirms the convolution result , the parity-flip image, and the low-pass Airy convolution. The frequency scaling and the numeric anchor lp/mm ( mm) are recomputed; the base's worked example ( lp/mm at mm) is reproduced as a consistency check. The Abbe limit follows Hecht Ch. 13 and matches the Airy-pattern / Rayleigh-resolution siblings. Phase-contrast and its intensity are standard Zernike theory. No non-standard constants introduced.
Builds on: Fourier Transform Property of a Lens · Fraunhofer Diffraction Regime · Fresnel-Kirchhoff Diffraction Integral Leads to: Optical Transfer Function · Abbe Theory of Image Formation · Rayleigh Resolution Criterion · Fourier Optics and Spatial Filtering
Why is the image inverted even when there is no filter?
Each lens performs a forward Fourier transform, and two forward transforms compose to the parity operation, , not the identity. So an empty 4f system delivers : the picture is turned through 180°. Because both lenses share the same focal length the magnification is exactly one, so it is an inverted, same-size relay. If you want an erect image you cascade a second 4f (four transforms compose back to the identity) or accept the flip, as most correlators do.
What is the difference between the mask H and the impulse response h?
They are a Fourier-transform pair, , and they describe the same filter in two languages. is the transfer function — how much each spatial frequency is passed or phase-shifted, and it is literally the transmission of the mask you place in the Fourier plane. is the impulse response — the blob a single object point turns into, and the output image is the object convolved with it. A tiny pinhole (narrow ) gives a broad Airy (heavy blur); a wide-open aperture (broad ) gives a sharp (little blur). Designing a filter is choosing one and knowing the other follows.
Does the object have to be exactly at the front focal plane?
For intensity imaging, no — the output image forms wherever the geometry conjugates object to image, and a power detector never sees the difference. For phase-sensitive filtering, yes. The clean, chirp-free spectrum in the central plane — the one a phase mask like the Zernike dot needs — exists only when the object sits one focal length in front of lens 1. Place it elsewhere and a residual quadratic phase multiplies the spectrum (the Fourier-transform-of-a-lens article proves this), silently spoiling any complex-amplitude operation. Alignment of that first focal length is the single most important tolerance in a phase-contrast setup.
How does phase contrast make an invisible object visible?
A transparent specimen shifts the phase of light without absorbing it, so for a weak phase object. The "1" focuses to the DC spot; the "" spreads across the Fourier plane as the scattered spectrum. Zernike's trick is a quarter-wave dot that multiplies only the DC term by , turning into . Now both parts are in phase, and — the phase appears directly as a brightness change. Dark field instead blocks the DC entirely, leaving only : high contrast, but nonlinear in .
Can the 4f system do arbitrary image processing, like a computer?
Within limits, yes — it is an optical convolution engine, and any linear shift-invariant operation (blur, sharpen, edge-detect, band-pass, correlate) is one convolution, hence one Fourier-plane mask. Its strength is speed and parallelism: the transform is instantaneous over the whole 2-D field. Its limits are that it does linear operations only (no thresholding or logic without extra nonlinear elements), it works in complex amplitude under coherent light, and the mask is fixed unless you use a spatial light modulator. Programmable-mask 4f systems are used today for adaptive optics and femtosecond pulse shaping, where the "image" is a spectrum.
Why does a pinhole clean up a laser beam instead of just dimming it?
Because the noise on a beam lives at high spatial frequencies while the useful Gaussian core lives at low ones. Dust, scratches, and interference fringes on upstream optics scatter light into large angles, which lens 1 focuses to spots far from the axis in the Fourier plane. A pinhole sized to the central Gaussian focus passes the smooth core and rejects those outlying high-frequency spots. You do lose a little power (the pinhole clips the Gaussian's own wings), but you remove the structure, and a second lens recollimates a clean beam. Choosing the pinhole a touch larger than the focal spot trades a little residual noise for less power loss.