Spherical Aberration (SA) is one key component missing from our MTF toolkit for modeling an ideal imaging system’s ‘sharpness’ in the center of the field of view in the frequency domain. In this article formulas will be presented to compute the two dimensional Point Spread and Modulation Transfer Functions of the combination of diffraction, defocus and third order Spherical Aberration for an otherwise perfect lens with a circular aperture.
Spherical Aberrations result because most photographic lenses are designed with quasi spherical surfaces that do not necessarily behave ideally in all situations. For instance, they may focus light on systematically different planes depending on whether the respective ray goes through the exit pupil closer or farther from the optical axis, as shown below:
If one imagines the sensing plane being inserted parallel to the lens at various distances from it, it can be seen that in the presence of SA light from a distant star projected by the lens onto the sensing plane would not converge to a single point but to a disk – and that the size and position along the optical axis of the smallest achievable disk (the Circle of Least Confusion) would change as the lens is stopped down, resulting in focus shift. This effect interacts with axial chromatic aberrations (spherochromatism) and tends to be the key determinant of lens ‘sharpness’ loss in the center of most in-spec, well corrected lenses at wide apertures[1].
SA and Defocus Point Spread Function
As Figure 1 shows, with Spherical Aberrations there is no longer a single plane of focus so SA and defocus interact to produce a plane of minimum blur (presumably one that results in the Circle of Least Confusion). Wyant and Creath[2] suggest that the irradiance on the sensing plane (PSF) of the diffraction pattern of a circular aperture with a rotationally symmetric[*] pupil function illuminated by a uniform light source can be written as
(1)
with representing the following generalized pupil function if defocus and third order SA are present
(2)
where:
- , the radial distance from the center of the circularly symmetric PSF on the sensing plane
- , the power of light contained within the pupil
- , the wavelength of light
- , the effective f-number
- , the radial distance on the exit pupil plane from its center, normalized to one
- and , the peak Optical Path Differences from the reference sphere at the Exit Pupil – of third order SA and Defocus respectively, in the same units as light wavelength
- , the zeroth order Bessel function of the first kind.
Mathematically inclined readers will recognize the heart of Equation (1) as a Fourier Transform of complex pupil function , as better described in the next section. A slice through the center of the PSF looks as follows when varying defocus coefficient only (no SA)
When the image is in focus the PSF has the shape of an Airy disk, as expected. In that case a slice of the PSF would look as follows when only third order Spherical Aberration coefficient is varied:
These graphs thankfully look like the ones in Wyant so apparently my Octave/Matlab implementation of the formula works[3]. They represent a slice through the center of the 2D PSFs, so to obtain the full 2D PSF all one needs to do is rotate the relative radial slice around the origin.
SA and Defocus Modulation Transfer Functions
We are after a radial slice through the center of the 2D MTF, which yields the spectral performance of the system in the direction of the slice. Taking the discrete Fourier Transform of a one dimensional slice as depicted above will not produce the desired result, even though the PSF is circularly symmetric. We have two options: either expand the radial PSF above to two dimensions by rotating it and taking the normalized modulus of the 2D DFT of that; or obtain the MTF directly as the normalized modulus of the Fourier-Bessel Transform of Equation (1) as is. I opted for the latter in order to stay in FT, as opposed to DFT, math.
The Fourier Transform of a circularly symmetric function is itself circularly symmetric and can be obtained by applying the Fourier-Bessel Transformation (also known as the Hankel transform of zero order) to Equation (1)[4]. The result is a radial slice through the 2D MTF of the 2D PSF of the combination of diffraction, third order Spherical Aberrations and defocus:
(3)
with [5] the spatial frequencies of interest, indicating normalization to one at the origin, and as defined earlier. I don’t know how to solve equation (3) analytically but it’s easy enough to do it numerically in Octave/Matlab[3]. Doing so produces the following graph when varying third order SA with zero defocus:
The first curve with zero SA and defocus is just the MTF of the diffraction pattern caused by a circular aperture. When varying defocus without SA these are the resulting curves instead:
What do you know, this last graph matches MTFs generated by Hopkins’ analytical defocus equation explored in the last post:
SA and Defocus Interact to Produce the CLC
The signs of the and coefficients refer to whether the wavefront is ahead (+) or behind (-) the reference sphere. They interact, so when SA is present the plane of best focus is not necessarily with at zero, as can be gleaned from Figure 1. The plane of sharpest ‘focus’ as intended by photographers is the one where the extent of the PSF on the sensing plane is smallest.
Geometrically, the resulting disk is denoted the circle of least confusion (CLC) and Wyant suggests that its diameter is smallest when is equal to -1.5 * . Indeed a curve with the coefficients in those proportions is the best one below:
Taking diffraction into account the PSF has infinite support per Equation (1) so its energy is no longer neatly encircled in a disk. Definitions of ‘extent’ can therefore vary significantly depending on the application, for instance percentage of encircled energy (EE) or full width at half maximum (FWHM). One of the better ones for our purposes is minimum RMS wavefront error, which results in the ‘smallest’ value when = –:
Many other criteria are possible, for instance in the frequency domain where one could envision using the area under the MTF curve, or perceptually weighted SQF and CPIQ Acutance.
In terms of the MTF50 metric used extensively in these pages, performing an empirical simulation using the code described in the post scriptum article yields a factor of about -0.9/-0.95 (‘a’ in the Figure below) . That is peak MTF50 is achieved when is about equal to -0.95*, close to minimum RMS.
Bringing It All Together
So Equation (3) allows us to calculate the combined two dimensional Modulation Transfer Function of diffraction, defocus and third order Spherical Aberrations for an otherwise perfect lens with a circular aperture (). Together with the Transfer Functions of AA, pixel aperture and sampling pitch discussed in previous articles we should now have all the principal ingredients necessary to roughly model the linear spatial resolution (‘sharpness’) of a photographic digital camera matched to an excellent lens in the center of the field of view:
(4)
with indicating element-wise multiplication and 2-dimensional convolution. We could for instance simulate the effect of varying f-number, pixel size and shape while taking into account these basic lens imperfections. And by analyzing the raw data of an image captured with good technique we should be able to learn a fair amount about the imaging system that took it, as explored in a couple of following posts.
PS. This article allows the simulation of more complex lens imperfections and aberrations by taking a wholly numerical approach.
Notes and References
1. See this excellent paper for for a more in-depth treatment of SA.
2. Basic Wavefront Aberration Theory for Optical Metrology, James C. Wyant and Katherine Creath.
3. The Matlab/Octave scripts used to generate these plots can be downloaded from here.
4. Introduction to Fourier Optics, 3rd Edition. Joseph W Goodman, equation 2-31.
5. See here for a description of linear spatial frequency .
Thanks a lot for the amazing series of posts. I learnt a lot.
I am struggling with using the MTF or the OTF (seems you are mixing them in the figure, but it is OK) formula (including the Matlab code generated numerical values) to perform image convolution:
1. Assume I don’t use the PSF, using PSF should be OK since FFT(PSF) will have both real and imaginary parts.
2. Using OTF formula (your Matlab code), spin it (assume rotational symmetric) to get 2D OTF. But I only have the real part, no phase info. Would this create a problem if I directly use it to * fft(image)? If there is issue, anyway to solve it?
Thank you.
Hi Sheng, the code calculates the radial MTF, which is just a normalized version of the radial |OTF|. So to get the radial OTF simply take away the abs() function in the relative mtf line, and normalize appropriately.
Or you could take a numerical approach:
https://www.strollswithmydog.com/wavefront-to-psf-to-mtf-physical-units/
Jack
Thanks Jack. Probably I didn’t ask the correct question. I understand the differences between MTF and OTF. My question is more about if I only know OTF’s real part, how can I get PSF or convolve with an image (by directly multiply the fft(image), then ifft). The reason I am asking is because:
1. The 2nd eq. in your previous chapter (https://www.strollswithmydog.com/a-simple-model-for-sharpness-in-digital-cameras-defocus/), only has absolute value.
2. I calculated the value of 3rd eq. in this chapter above, without using abs in front, the resulting value (should be OTF) is still a vector of real values, there are no imaginary part.
I thought the OTF should have both real and imaginary parts as if I directly perform fft(PSF). Thanks.
Hello Sheng,
That’s because the Fourier Transform of a fully real, rotationally symmetric, 2D function (like those PSFs) is also only real – so I think you are good to go. More detail on this in the section on the OTF in the following article
https://www.strollswithmydog.com/fourier-optics-complex-pupil-function/#OTF
Jack
Thanks, Jack! I see above in eq(3) you are using the Bessel function for calculating MTF/OTF, instead of using fft(PSF), is this because the PSF you got in eq.(1) is 1D PSF instead of 2D? And the fft(1D PSF) ≠ cross-section(fft(2D PSF))? Moreover, is the fft(2D PSF) equivalent of performing 2D conversion of the 1D OTF get from eq.(3) (by rotating the 1D curve) ?
Thank you.
Hi Sheng,
Equation (1) produces a radial slice of the relative 2D rotationally symmetric PSF. Equation (3) is the FT of such a PSF in just one direction, that of the slice.
A slice is different than a projection (such as a Line Spread Function, LSF) – the latter is made up of components of every pixel in the 2D PSF, the former is not.
You can obtain the 2D MTF by taking the 2D FFT of the PSF slice from Equation (1) rotated around 360 degrees. Careful though with slices of the 2D MTF. The Fourier-Slice Theorem says that a slice of the 2D MTF corresponds to a 1D projection of the 2D PSF, in the direction perpendicular to that of the slice.
Jack