Skip to main content
Sandbox Physics

Optics 062 · Diffraction, Fourier optics, and computational imaging

Optical Fourier Processor

How can a mask between two lenses keep only an image’s edges, blur it or erase a repeating pattern? The first lens spreads the image's spatial frequencies across the Fourier plane: coarse features near the center, fine detail farther out. A mask there removes the frequencies it covers. Block the center and only edges remain; block the outside and the image blurs; block the regular spots of a repeated texture and it disappears. The second lens rebuilds the image upside down.

Filter images on a coherent 4f bench with eight passive amplitude or phase filters and movable frequency masks. See the inverted image at the sensor, make phase objects visible and find patterns by matched correlation.

Interactive modelOptical Fourier Processor
Object-to-receiver distance / programmed filter radius 4f,aH4f,a_H0.500.50
Complete-field throughput / visible crop power T,PcropT,P_{\rm crop}50%50\%
Object sampling / frequency spacing Δx,Δν\Delta x,\Delta\nu0.00π0.00\pi
Model regimevalid model regime\text{valid model regime}

Physics tutorial

Audit the physics of Optical Fourier Processor

BackgroundA lens sorts a coherent amplitude field by spatial frequency. In its back focal plane, position and frequency are related by XF=λfνxX_F=\lambda f\nu_x. A mask placed there edits the spectrum of the field, which is not the same as Fourier-transforming a camera intensity image.

Why it mattersHow can a mask between two lenses keep only an image’s edges, blur it or erase a repeating pattern?

Start with the essentials

Focus question
How can a mask between two lenses keep only an image’s edges, blur it or erase a repeating pattern?
One-sentence intuition
Two positive lenses perform two forward transforms, so Uout(x,y)=F−1{HU~in}(−x,−y)U_{\rm out}(x,y)=\mathcal F^{-1}\{H\widetilde U_{\rm in}\}(-x,-y). The minus signs matter: the image on the receiving plane is inverted in both transverse directions.

Core mathematical model

Front and back focal planes

U~(νx,νy)=∬U(x,y)e−2πi(νxx+νyy) dx dyUF(X,Y)=e2ikfiλfU~(Xλf,Yλf)\begin{aligned}\widetilde U(\nu_x,\nu_y)&=\iint U(x,y)e^{-2\pi i(\nu_x x+\nu_y y)}\,\mathrm dx\,\mathrm dy\\U_F(X,Y)&=\frac{e^{2ikf}}{i\lambda f}\widetilde U\left(\frac X{\lambda f},\frac Y{\lambda f}\right)\end{aligned}

The object sits one focal length before the first ideal lens. The filter sits one focal length after it, which is also one focal length before the second lens. The receiver sits one focal length behind the second lens. A common carrier phase does not change the intensity.

Passive masks and phase

Hlow=P 1∣ν−νc∣≤rνHhigh=P−HlowHphase=Pexp⁡(iϕH1∣ν−νc∣≤rν)P=1∣ν∣≤14 mm−1\begin{aligned}H_{\rm low}&=P\,\mathbf1_{|\boldsymbol\nu-\boldsymbol\nu_c|\le r_\nu}\\H_{\rm high}&=P-H_{\rm low}\\H_{\rm phase}&=P\exp\left(i\phi_H\mathbf1_{|\boldsymbol\nu-\boldsymbol\nu_c|\le r_\nu}\right)\\P&=\mathbf1_{|\boldsymbol\nu|\le14\,\mathrm{mm}^{-1}}\end{aligned}

Band pass keeps radii between half the set radius and the full radius. Directional mode is a slit with that same half-width. Twin notch blocks both centres, one on each side of zero. The phase disk is programmed for the chosen wavelength, not inferred from an unspecified glass depth. The carrier is a stop in the Fourier plane, while the ideal lens pupils stay unlimited.

Power is separate from display brightness

T=∑∣U~H∣2∑∣U~∣2Iout=∣Uout∣2BI=min⁡(1,ln⁡(1+10eGI/Iinc)ln⁡5)\begin{aligned}T&=\frac{\sum|\widetilde U H|^2}{\sum|\widetilde U|^2}\\I_{\rm out}&=|U_{\rm out}|^2\\B_I&=\min\left(1,\frac{\ln(1+10^{e_G}I/I_{\rm inc})}{\ln5}\right)\end{aligned}

By Parseval’s theorem, the complete sampled field on the receiving plane gives the same transmission. The five-millimetre crop you see does not hold the total power. The input, filtered and comparison images share one fixed display mapping; the Fourier diagnostics use a separate fixed logarithmic mapping. All raw probes stay linear.

Phase turns into contrast without adding energy

Uweak≃1+iφH(0)=iUcontrast≃i+iφIcontrast≃1+2φ\begin{aligned}U_{\rm weak}&\simeq1+i\varphi\\H(0)&=i\\U_{\rm contrast}&\simeq i+i\varphi\\I_{\rm contrast}&\simeq1+2\varphi\end{aligned}

This weak-phase example assumes a uniform background and a disk that acts only on the zero order. The numerical model uses the actual finite illumination and finite disk, so halos and background leakage remain. The simulated image is computed in full, not replaced by this linear formula.

Passive matched correlation

Hmatch=PG~∗max⁡∣G~∣Ucorr(x,y)∝∬U(ξ,η)G∗(ξ+x,η+y) dξ dη\begin{aligned}H_{\rm match}&=P\frac{\widetilde G^*}{\max|\widetilde G|}\\U_{\rm corr}(x,y)&\propto\iint U(\xi,\eta)G^*(\xi+x,\eta+y)\,\mathrm d\xi\,\mathrm d\eta\end{aligned}

The programmed template is a smooth open-ring glyph. The correlation uses the same FFT data and a passive, normalized complex transmission. Two copies of the glyph produce peaks at inverted displacements. The disk gives a broad false response that can be brighter, because correlating with an unnormalized positive template does not make a classifier. The filter is an ideal complex mask, not a manufactured hologram or a certified recognition system.

Sampling and physical scale

Lnum=16 mm,N=512Δx=Lnum/NΔν=1/LnumaH=λfrν\begin{aligned}L_{\rm num}&=16\,\mathrm{mm},\quad N=512\\\Delta x&=L_{\rm num}/N\\\Delta\nu&=1/L_{\rm num}\\a_H&=\lambda f r_\nu\end{aligned}

The input illumination tapers to zero at the edge of a four-millimetre square. Zero padding reduces circular wraparound, but the discrete output is still periodic, and hard masks are sensitive to where the frequency grid points fall. Samples are point intensities, not camera pixels integrated over an area. Changing the wavelength or focal length reprograms the mask so the frequency coordinates stay fixed, which changes its physical size. The axial scale of the apparatus differs from the transverse detail scales.

Common difficulties

An intensity photograph does not contain the entire optical field

Typical misconceptionFourier-transforming the input photograph reproduces the optical processing of any object.

Better mental modelThe lens acts on the complex amplitude. A transparent phase object can have almost uniform input intensity, yet a phase disk reveals its structure. This simulation knows the programmed complex transmission; it does not recover lost phase from a photograph.

Run the experiment

  1. 01

    Scene 1: Blur versus edges

    On the resolution target, compare open carrier, low pass and high pass. The image is inverted, and high pass loses most of the power while it brings out the edges.

    What to observe: Low pass softens fine detail. Removing the center of the spectrum makes edges brighter relative to the background; no energy is gained.
  2. 02

    Scene 2: Erase the stripe pair

    In the stripe preset, click the paired spectrum peaks. Move or widen the twin notch; removing the stripes also throws away the object information that overlaps them.

    What to observe: A horizontal Fourier slit passes variations along the horizontal direction, so it keeps vertical stripes in the object. Rotating the slit rotates the selected frequency direction.
  3. 03

    Scene 3: Invisible phase becomes contrast

    Compare the phase cells under an open carrier and under a quarter-wave disk. Reverse the disk phase, then try matched correlation on the two glyphs.

    What to observe: Phase filtering keeps the power inside the carrier and only moves brightness around. Correlation peaks mark inverted displacements; they are not recovered object pixels.
FeedbackSomething broken, confusing, or missing on this page?Tell us
What kind of feedback?

Sent with this page’s address, its Lab ID, the site language and your device type. Please leave out personal details. Feedback is kept for up to 12 months.Privacy policy