WavefrontPeakToValley
R2026bPeak-to-valley wavefront error metric for optical system merit function
Since R2026b
Description
Add-On Required: This feature requires the Optical Design and Simulation Library for Image Processing Toolbox add-on.
A WavefrontPeakToValley object computes the weighted
peak-to-valley 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 a WavefrontPeakToValley object.
Use the
addWavefrontPeakToValleyobject function when you want to add this metric to anopticalMeritFunctionobject.Use the
optics.metric.WavefrontPeakToValleyfunction described here. Use this function when you want to create a peak‑to‑valley wavefront error metric without adding it to the optical merit function, or modify the properties of a peak‑to‑valley wavefront error metric already in the merit function. After creating the object, you can specify the peak‑to‑valley wavefront error properties by modifying the properties of the object.
Syntax
Description
metric = optics.metric.WavefrontPeakToValley creates a
peak‑to‑valley wavefront error metric for use with the optical system merit
function.
metric = optics.metric.WavefrontPeakToValley(
sets writable properties using one or more name-value arguments. For example,
PropertyName=Value)Target=[0 0.25] specifies a target peak‑to‑valley wavefront
error range of 0 to 0.25 waves.
Properties
Object Functions
evaluateMetric | Evaluate metric function |
Examples
Algorithms
The WavefrontPeakToValley metric computes the weighted peak-to-valley (P-V)
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 peak-to-valley 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. Each element wij represents the joint weight for field point i at wavelength j.
Compute the weighted peak-to-valley wavefront error across all selected field point and wavelength combinations:
where rij is the peak-to-valley wavefront error for field point i at wavelength j, and wij is the corresponding weight.
The overall metric value is the weighted RMS of the raw OPD peak-to-valley values:
Version History
Introduced in R2026b
See Also
WavefrontRMS | addWavefrontPeakToValley | addWavefrontRMS | opticalSystem