---
title: "Optical Fourier Processor Interactive Lab | Sandbox Physics"
description: "How can a mask between two lenses keep only an image’s edges, blur it or erase a repeating pattern?"
canonical_url: "https://sandboxphysics.com/labs/optical-fourier-processor/"
language: "en"
page_type: "lab"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/labs/optical-fourier-processor/"
last_modified: "2026-10-27"
---

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 simulation: open this page in a web browser to change the parameters and run the model.

The lenses are ideal, with equal focal lengths and unlimited pupils; the input is a synthetic, finite coherent field, and the Fourier-plane stop is passive and programmed. The calculation uses a zero-padded 512 by 512 complex FFT and point samples, so the output is numerically periodic. It does not integrate over camera pixels or recover phase from intensity alone. The display is fixed logarithmic, and the scene uses unequal scales. Aberrations, incoherent light and noise are not included, and nothing is certified by experts.

Physics tutorial

## Audit the physics of Optical Fourier Processor

**Background** A lens sorts a coherent amplitude field by spatial frequency. In its back focal plane, position and frequency are related by $X_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 matters** How 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 $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

$$
\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

$$
\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

$$
\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

$$
\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

$$
\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

$$
\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 misconception** Fourier-transforming the input photograph reproduces the optical processing of any object.

**Better mental model** The 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.

Physical conclusion

A physical frequency mask edits the coherent amplitude, not a photograph. Read the inverted intensity, the throughput and the phase diagnostics separately.

Waves & optics · Starter path

## From one ray to interference measurement

Start with refraction, find where the ray picture stops working, then use interference to measure tiny distances.

[Start here → **Optical Boundary Explorer** Turn the incident angle and watch reflected and transmitted power trade off. Then switch to the critical-angle scene. Observe · 11 min](https://sandboxphysics.com/labs/optical-boundary-explorer/)

1. [1 Optical Boundary Explorer](https://sandboxphysics.com/labs/optical-boundary-explorer/)
2. [2 Rainbow Caustic Observatory](https://sandboxphysics.com/labs/rainbow-laboratory/)
3. [3 Camera Obscura](https://sandboxphysics.com/labs/camera-obscura/)
4. [4 Coherent Wave Composer](https://sandboxphysics.com/labs/coherent-wave-composer/)
5. [5 Young Double-Slit Bench](https://sandboxphysics.com/labs/young-double-slit-bench/)
6. [6 Michelson Precision Lab](https://sandboxphysics.com/labs/michelson-precision-lab/)

[View the full path →](https://sandboxphysics.com/topics/waves-and-optics/#starter-path)
