DOF and Diffraction: Image Side

This investigation of the effect of diffraction on Depth of Field is based on a two-thin-lens model, as suggested by Alan Robinson[1].  We chose this model because it allows us to associate geometrical optics with one lens and Fourier optics with the other, thus simplifying the underlying math and our understanding.

In the last article we discussed how the front element of the model could present at the rear element the wavefront resulting from an on-axis source as a function of distance from the lens.  We accomplished this by using simple geometry in complex notation.  In this one we will take the relative wavefront present at the exit pupil and project it onto the sensing plane, taking diffraction into account numerically.  We already know how to do it since we dealt with this subject in the recent past.

Figure 1. Where is the plane with the Circle of Least Confusion?  Through Focus Line Spread Function Image of a lens at f/2.8 with the indicated third order spherical aberration coefficient, and relative measures of ‘sharpness’ MTF50 and Acutance curves.  Acutance is scaled to the same peak as MTF50 for ease of comparison and refers to my typical pixel peeping conditions: 100% zoom, 16″ away from my 24″ monitor.

The Geometrical Field from the Front Element

According to the simplified two-thin-lens-touching model described in the last article, the field in front of the rear element (equivalent to the exit pupil in this case) will be

(1)   \begin{equation*} U_{2}'' = e^{i k (W_2 \rho^2 + W_{040} \rho^4)} \end{equation*}

with

  • k = \frac{2\pi}{\lambda}, the wave number
  • \lambda the mean wavelength of light
  • \rho the radial distance from the optical axis within the exit pupil
  • W_2 the p-v coefficient of phase error introduced by an on-axis object not positioned at the focal length, better defined below
  • W_{040} the p-v coefficient of phase error introduced by \rho^4 aberrations in both lenses (mainly 3rd order spherical aberrations and axial color)
Figure 2.  The two thin lens model used in this article.  The lenses touch but between them there is an imaginary phase shifting plate that collects the effect of their aberrations.  The front element with focal length fu is focused on the object at u.  The imaging plane is positioned a distance z from the rear element, which has nominal focal length fn.

Maximum Optical Path Difference W_2 is the key input variable in our diffracted DOF study since it is geometrically related to the position of an on-axis out-of-focus object a distance u_2 away from the front lens, which is deemed to have focal length f_u and circular aperture of diameter D:

(2)   \begin{equation*} W_2 = -[\sqrt{ f_u^2 - \frac{D^2}{4}  } - \sqrt{ u_2^2 - \frac{D^2}{4}  } - (f_u - u_2)] \end{equation*}

The minus sign in front is there to remind us that the optical z axis is positive to the right of the lens.

Determining the Rear Element’s Image Plane

The image-facing lens in our model has nominal focal length f_n and the same maximum diameter D as the object facing lens.  We could consider the sensing plane, which is assumed to be normal to the optical axis, to be positioned a fixed distance f_n from the rear element and calculate the diffracted Point Spread Function on it as the modulus of the Fourier Transform of the function at the exit pupil squared, as we have done in the past.  But since we are trying to be precise we are going to make two small adjustments to it.

First the combined focal length of a two-lens system when the lenses are touching (we will call it f_z) is

(3)   \begin{equation*} \frac{1}{f_z} = \frac{1}{f_u} + \frac{1}{f_n} . \end{equation*}

If we placed the sensing plane at f_z this is the unaberrated diffracted intensity spread that we could expect if it were moved slightly back and forth a distance d_z from there, say with effective f-number N_w = \frac{f_z}{D} = 2.8 for instance

Figure 3. Through-Focus of a diffraction limited lens at f/2.8. Vertical Line Spread Functions along the optical axis near the focal length. If this image looks a bit fuzzier than others seen online it is because LSFs are shown here instead of the amplitude of intensity. LSFs are relevant for MTFs.

Pretend that you are looking from the side at light from the exit pupil as it converges towards the location where the sensing plane would be located, at d_z = 0.  The vertical intensity spread is what is normally referred to as the diameter of the Circle of Confusion.  In geometrical optics it has a hard edge and goes to zero at the paraxial plane – but here diffraction causes a more gradual decrease in intensity spread and the minimum is tied to the intensity of the relative Airy Pattern, which never reaches zero.  You can estimate a CoC of sorts from this image by picking a suitable intensity threshold.  Looks symmetrical around the focal plane, doesn’t it?  It virtually is.

Since the spread looks most collected and intensity reaches a central maximum at d_z = 0 we couldn’t be faulted for choosing f_z as the imaging plane in the case above.  On the other hand, if we introduce spherical aberrations typical of a Nikkor Z 50mm/1.8 S at f/2.8 in the center, the best position for the sensing plane appears to shift and its choice becomes a bit more nebulous:

Figure 4. Through-Focus of lens with Spherical Aberration W040 coefficient 0.619um at f/2.8. Vertical Line Spread Functions along the optical axis near the focal length if the lens at dz = 0. If this image looks a bit fuzzier than others seen online it is because LSFs are shown here instead of amplitude.

A  reasonable choice for the plane of ‘best focus’ (also sometimes referred to as the location of the Circle of Least Confusion) is where the aggregate wavefront aberration results in the lowest Root Mean Square intensity, which Wyant[2] tells us occurs when the W_{040} SA3 coefficient is counteracted by an equal and opposite amount of W_{020} defocus (observation plane shift).  According to the article on defocus that should occur approximately at

(4)   \begin{equation*} $ d_z = - 8  W_{020} N_w^2$, \end{equation*}

which corresponds to about 39 \mu m with N_w = 2.8 and W_{020} = –W_{040} = -0.619 \mu m. This indeed appears to be in close agreement with maximum readings of the Modulation Transfer Function resulting from the lens in the center and a Nikon Z7 pixel vertically, since MTF50 peaks at 41 \mu m as shown below:

Figure 5. Through-Focus of lens with Spherical Aberration W040 coefficient 0.619um at f/2.8. Vertical Line Spread Functions along the optical axis near the focal length if the lens at dz = 0.  The yellow lines represent the geometrical Circle of Confusion centered at dz = 8*W020*N^2, with defocus coefficient W020=-W040.  The Cyan curve is MTF50 in the vertical direction as a function of dz, calculated from the lens LSF at each plane convolved with a Nikon Z7 pixel.

Using other MTF-based measures of ‘sharpness’ like Edge Acutance to Nyquist[3] (see Figure 1) would result in the choice of ‘best focus’ plane a few microns further away to 43.4 \mu m in my standard pixel peeping conditions.  Not enough of a difference to warrant all the extra number crunching so we will stick to the easily calculated minimum RMS imaging plane position in what follows.

All this to say that we will project the following field at the circular exit pupil

(5)   \begin{equation*} U_{2}'' = e^{i k (W_2 \rho^2 + W_{040} \rho^4 + W_{020}\rho^2)} \end{equation*}

to the observation plane a distance

(6)   \begin{equation*} z_i = ( \frac{1}{f_u} + \frac{1}{f_n})^{-1} - 8 W_{020}N_w^2 \end{equation*}

away, with W_{020} = –W_{040}.

We could further refine z_i but I think we would fast approach diminishing returns since dz is typically much smaller than focal length f_n and we are going for a simplified simulation of normal photography.[4]

The f-number used for the units of the relative PSF and MTF in the next section will then be N_w = \frac{z_i}{D_x}, with D_x maximum exit pupil diameter.  It can also be calculated as N_w = (1+\frac{|m|}{p})N, with m system magnification for the given setup, p exit divided by entrance pupil diameters, and N the published f-number.

Intensity on the Observation Plane

Now that we know where the sensing plane should be located with respect to the exit pupil for ‘best focus’, we have the variables needed to apply numerical methods in order to estimate the diffracted Intensity Point Spread Function (PSF) and Modulation Transfer Function (MTF) produced by an on-axis point source a distance u_2 in front of our two-thin-lens model[5]:

(7)   \begin{equation*} PSF(u_2,f_u,D_x,W_{040},f_n) = \left|  \mathcal{F} (U_2''P)\right|^2 \end{equation*}

with \mathcal{F} the two-dimensional Fast Fourier Transform and P the circular stop function, as better described in the dedicated article.  The Modulation Transfer Function will then be

(8)   \begin{equation*} MTF(PSF) = \left|  \mathcal{F}(PSF)\right| \end{equation*}

after normalization to one at the origin.

And We Are Done

We are done characterizing the two-thin-lens model for diffracted DOF.  With the procedure outlined above we should be able to determine the relative ‘sharpness’ on the image of any on-axis object in front of the lens, taking diffraction into account.

To keep the math simple we have restricted the model as follows:

  • two thin lenses of the same diameter, touching
  • therefore coincident principal plane, Entrance/Exit pupils and pupil magnification of 1
  • on-axis performance only, therefore limiting application to the center of the field of view (thus ignoring vignetting[4] and more complex aberrations)
  • the paraxial approximation, essential to simplify both object and image side calculations
  • the Fresnel approximation and all others in Fourier Optics, without which Equation (7) would be much more complicated

None of these restrictions should prevent use of the model in unusual situations like macro photography as long as effective/ working f-number N_w is used.  If you are a practitioner please let me know if you spot any weaknesses or have any suggestions for improvement.  In the next article we will describe the setup to which the model will be applied.

Notes and References


1. Thanks to Alan Robinson for his excellent insights into these subjects.
2. Basic Wavefront Aberration Theory for Optical Metrology, James C. Wyant and Katherine Creath.
3. See “Development of the I3A CPIQ spatial metrics, Baxter et al.”  for the Camera Phone Image Quality initiative’s definition of Edge Acutance.
4. The touching two-thin-lens model allows us to avoid having to deal with effective focal length and f-number, since the stop, the principal planes, the Entrance and Exit pupils are all assumed to be co-located.  For a more in-depth discussion of the effect of pupil magnification and lens focus distance on z_i and N_w see Appendix iv here.
5. Introduction to Fourier Optics, 3rd Edition. Joseph W Goodman.
6. The Matlab/Octave code used to produce these plots can be downloaded from here.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.