---
title: "PSF–OTF–MTF Imaging Lab Interactive Lab | Sandbox Physics"
description: "Can a lens swap the bright and dark parts of stripes, and can pixels invent a stripe period that isn’t there? Both happen."
canonical_url: "https://sandboxphysics.com/labs/psf-otf-mtf-imaging-lab/"
language: "en"
page_type: "lab"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/labs/psf-otf-mtf-imaging-lab/"
last_modified: "2026-10-27"
---

Optics 064 · Diffraction, Fourier optics, and computational imaging

# PSF–OTF–MTF Imaging Lab

**Can a lens swap the bright and dark parts of stripes, and can pixels invent a stripe period that isn’t there?** Both happen. With defocus, the optical transfer function turns negative over some range of stripe frequencies, and stripes there come out with bright and dark swapped. The MTF keeps only the size of that function, so it hides the flip. Pixels spaced too far apart for the stripes alias them into a false, longer period.

Follow light from the pupil to the image and see contrast reversal and false periods caused by sampling. The PSF, the signed OTF, the MTF and the sensor pixels all come from the same calculation.

> Interactive simulation: open this page in a web browser to change the parameters and run the model.

Imaging is scalar, paraxial, monochromatic and periodic. The targets and pupil phase are synthetic and programmed; they do not represent a measured lens. Pixels average over discrete boxes, the display gain is fixed, and apparatus parts use unequal scales. OTF normalization is kept separate from aperture throughput. Partial coherence, vector focusing, noise and reconstruction are not included, and nothing is certified by experts.

Physics tutorial

## Audit the physics of PSF–OTF–MTF Imaging Lab

**Background** In incoherent imaging, each object point produces an intensity pattern set by the complex pupil: $\mathrm{PSF}=\frac{|\mathcal F^{-1}P|^2}{\int|\mathcal F^{-1}P|^2\,d^2r}$. The pattern is normalized to unit integral, and the light lost at an obstruction is counted separately. A phase error moves energy around within the pattern; it does not dim every frequency by the same amount.

**Why it matters** Can a lens swap the bright and dark parts of stripes, and can pixels invent a stripe period that isn’t there?

Start with the essentials

- **Focus question**: Can a lens swap the bright and dark parts of stripes, and can pixels invent a stripe period that isn’t there?
- **One-sentence intuition**: Both transfer functions come from the same point response: $\mathrm{OTF}=\mathcal F\{\mathrm{PSF}\},\qquad\mathrm{MTF}=|\mathrm{OTF}|$. This pupil is symmetric under inversion through its center, so the OTF is real. Defocus can make it negative, which means bright and dark swap; the MTF is its magnitude and throws that sign away.

### Core mathematical model

#### The complex pupil with defocus and astigmatism

$$
\begin{aligned}P&=\mathbf1_{\epsilon\le\rho\le1}e^{2\pi i w}\\w&=D\!\left(\rho^2-\frac{1+\epsilon^2}{2}\right)\\&\quad+A(u^2-v^2)\end{aligned}
$$

The dimensionless pupil coordinates are frequency divided by the coherent cutoff. Defocus is given in waves from the pupil edge to its centre; astigmatism has opposite signs along the two perpendicular axes. The average phase (piston) over the ideal annulus is removed. The controls set phase at the selected wavelength, not a fixed thickness of glass.

#### Incoherent and coherent imaging

$$
\begin{aligned}I_{\rm inc}&=\eta\,\mathrm{PSF}*I_{\rm ideal}\\I_{\rm coh}&=\left|\mathcal F^{-1}\{P\mathcal F[\sqrt{I_{\rm ideal}}]\}\right|^2\end{aligned}
$$

Both models image the same target, inverted. Incoherent object points add without cross terms; coherent points interfere. The open fraction of the pupil area sets the incoherent throughput, while coherent energy depends on the actual amplitude spectrum. The display applies a fixed linear gain and clipping only after the raw calculation.

#### Cutoffs, phase sign and sensor sampling

$$
\begin{aligned}\nu_c^{\rm coh}&=\mathrm{NA}/\lambda\\\nu_c^{\rm inc}&=2\mathrm{NA}/\lambda\\\nu_N&=1/(2a_{\rm pixel})\\\Delta z&=-2\lambda D/\mathrm{NA}^2\end{aligned}
$$

Frequencies are in cycles per micrometre, in image coordinates at nominal unit magnification. A positive defocus phase means the sensor sits closer to the second lens. The relay uses the paraxial focal-plane approximation, so moving the sensor ignores the tiny change in magnification. Frequencies above Nyquist can fold back to lower ones; what the optics pass is not automatically what the pixels record.

#### Normalized shape versus transmitted energy

$$
\begin{aligned}\mathrm{OTF}(0)&=1\\\eta&=N_P/N_{\rm clear}\\S_0&=|\sum P|^2/N_P^2\\B&=\min(1,G I/I_0)\end{aligned}
$$

The on-axis Strehl ratio, computed on the finite grid, compares the same aperture with and without the phase error. It is not a general ratio of maximum peaks, nor the exponential small-error approximation. The PSF map has its own labelled logarithmic scale, relative to the peak of the same aperture without aberration. The raw centre cut and the transfer curves never include display gain.

### Common difficulties

#### A nonzero MTF does not guarantee a faithful image

**Typical misconception** The Strehl ratio just scales the whole MTF down, and any stripe I can see is resolved correctly.

**Better mental model** The normalized OTF is one at zero frequency even when the on-axis peak of the point response drops. Contrast can reverse, and pixels can alias a pattern into a false period. Look at the signed curve, and compare the cuts through the raw input, the optical image and the detector record. In coherent mode the pupil filters the amplitude first and the result is squared afterwards, so an incoherent OTF cannot predict how intensity is transferred.

### Run the experiment

1. 01

   #### Scene 1: In focus: faithful contrast

   Compare the in-focus and reversal scenes. Then click the signed-transfer chart to tune the sinusoidal target, which always has a whole number of cycles. Home restores the default cycle count.

   **What to observe:** A narrowband source can still be spatially incoherent. Light of a single color does not make different object points coherent with each other.

2. 02

   #### Scene 2: Defocus: bright becomes dark

   Switch to the real-aperture view and change the NA and the central obstruction. Then combine defocus with astigmatism and compare the horizontal and vertical signed curves.

   **What to observe:** The pupil is sampled on a finite grid, so the PSF and the image repeat periodically. The images are forward simulations of synthetic targets made for this Lab, not measured images or reconstructions.

3. 03

   #### Scene 3: Pixels: false stripe period

   Choose the aliasing scene and make the pixels larger. Compare the sampled record with the optical image before sampling, then switch to coherent amplitude imaging.

   **What to observe:** A central obstruction lowers incoherent throughput. Under coherent on-axis illumination it also blocks the zero-frequency field, so a uniform target can go dark.

Physical conclusion

Follow one pupil through the point response, the signed transfer function and the sampled pixels. Contrast alone cannot tell you whether the image is true.

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)
