主要内容

encircledEnergyAtRadius

R2026b

Compute encircled energy of point spread function

Since R2026b

Description

Add-On Required: This feature requires the Optical Design and Simulation Library for Image Processing Toolbox add-on.

ee = encircledEnergyAtRadius(psfr,radius) computes the fraction of total point spread function (PSF) energy inside each radius in radius. The function returns encircled energy values for each PSF object, wavelength, and radius.

example

Examples

collapse all

Load the sample Double Gauss lens system using zmximport. Define a field point at an angle of 4 degrees along the x-axis, specify a wavelength of 587.56 nm, and calculate the geometric PSF.

opsys = zmximport("DoubleGaussLens.zmx");
fp = fieldPoint(Angles=[4 0]);
lambda = 587.56;
psfr = psf(opsys, FieldPoints=fp, Wavelengths=lambda, Method="Geometric");

Calculate the fraction of the total intensity distribution that falls within a radius of 0.01 mm using the encircledEnergyAtRadius function.

ee = encircledEnergyAtRadius(psfr, 0.01)
ee = 
0.8634

Load the sample Double Gauss lens system using zmximport. Define a field point at an angle of 4 degrees along the x-axis and specify an array of three wavelengths (486.13 nm, 587.56 nm, and 656.28 nm).

opsys = zmximport("DoubleGaussLens.zmx");
fp = fieldPoint(Angles=[4 0]);
lambdas = [486.13 587.56 656.28];

Compute the Huygens PSF across all specified wavelengths by setting the Method name-value argument to "Huygens". Use the encircledEnergyAtRadius function to evaluate the fraction of total energy contained within radial distances of 0.005 mm and 0.01 mm.

psfr = psf(opsys, FieldPoints=fp, Wavelengths=lambdas, Method="Huygens");
ee = encircledEnergyAtRadius(psfr, [0.005 0.01])
ee = 
ee(:,:,1) =

    0.2768    0.6603    0.3714


ee(:,:,2) =

    0.4950    0.8576    0.7927

Input Arguments

collapse all

Point spread function results, specified as a GeometricPSF object, a HuygensPSF object, or an array of PSF result objects. Create these objects by using the psf object function.

When you specify an array of PSF result objects, all objects in the array must use the same wavelengths.

Radius at which to compute encircled energy, specified as a nonnegative real scalar or row vector of nonnegative real values. Units are in millimeters.

Data Types: double

Output Arguments

collapse all

Encircled energy fractions, returned as an N-by-M-by-K numeric array. N is the number of PSF objects in psfr, M is the number of wavelengths, and K is the number of radii in radius. Each value is the fraction of total PSF energy inside the corresponding radius.

Values are fractions from 0 to 1. A value of 0 indicates no energy inside the radius. A value of 1 indicates all PSF energy inside the radius.

If a PSF object contains an empty Image value, the corresponding encircled energy values are NaN.

Data Types: double

Algorithms

The encircledEnergyAtRadius object function computes encircled energy as the fraction of normalized PSF intensity enclosed within each specified radius. The radius is measured from the PSF centroid for each wavelength. Use encircled energy to quantify how tightly the PSF energy is concentrated around its center.

Version History

Introduced in R2026b