WavefrontRMS
R2026bDescription
Add-On Required: This feature requires the Optical Design and Simulation Library for Image Processing Toolbox add-on.
A WavefrontRMS object computes the weighted root-mean-square
(RMS) wavefront error across specified field points and wavelengths for use in an optical
system merit function. Evaluate the metric and compute the normalized residual score
using the evaluateMetric object function.
Creation
There are two ways to create an WavefrontRMS object.
Use the
addWavefrontRMSobject function when you want to add this metric to anopticalMeritFunctionobject.Use the
optics.metric.WavefrontRMSfunction described here. Use this function when you want to create a RMS wavefront error metric without adding it to the optical merit function, or modify the properties of a RMS wavefront error metric already in the merit function. After creating the object, you can specify the RMS wavefront error properties by modifying the properties of the object.
Description
metric = optics.metric.WavefrontRMS creates a RMS
wavefront error metric for use with the optical system merit function.
metric = optics.metric.WavefrontRMS(
sets writable properties using one or more name-value arguments. For example,
PropertyName=Value)Target=[0 0.1] specifies a target RMS wavefront error
range of 0 to 0.1 waves.
Properties
Object Functions
evaluateMetric | Evaluate metric function |
Examples
Algorithms
The WavefrontRMS metric computes the weighted root-mean-square (RMS)
wavefront error across multiple field points and wavelengths using these steps.
Compute the optical path difference (OPD) for each combination of field point and wavelength specified by the
FieldPointIndexandWavelengthIndexproperties. If either property is empty, all field points or wavelengths defined in the optical system are used.Extract the RMS wavefront error from each OPD result to form a NumFP-by-NumWL matrix of values in waves, where NumFP is the number of field points and NumWL is the number of wavelengths.
Normalize the
FieldPointWeightsandWavelengthWeightsvectors from the optical system so that each sums to 1.Form a combined weights matrix as the outer product of the normalized field point weights and wavelength weights:
weights = wavelengthWeights.* fieldPointWeights'Each element w(i,j) represents the joint weight for field point i at wavelength j.
Compute the weighted RMS wavefront error across all selected field point and wavelength combinations:
where rij is the RMS wavefront error for field point i at wavelength j, and wij is the corresponding weight.
The overall RMS wavefront metric value is the weighted RMS of the raw OPD RMS values:
Version History
Introduced in R2026b