Table of Contents

Class ComplexFieldInterpolation

Namespace
VirtualLabAPI.Core.Numerics
Assembly
VirtualLabAPI.dll

This class contains static member functions to interpolate a ComplexField to another sampling grid.

public class ComplexFieldInterpolation
Inheritance
ComplexFieldInterpolation
Inherited Members

Methods

CombinedInterpolation(ComplexField, SamplingParameters, VectorD, ExtrapolationInfo)

Uses the windowed sinc interpolation and the cubic 4 point interpolation to interpolate a ComplexField. In general windowed sinc interpolation with 10 border pixels is used. Is the interpolated field is narrower than 3 sampling points (in on direction) the cubic 4 point interpolation is used.

public static ComplexField CombinedInterpolation(ComplexField cf, SamplingParameters samplingParameters, VectorD zeroPoint, ExtrapolationInfo extrapolation)

Parameters

cf ComplexField

Field to be interpolated.

samplingParameters SamplingParameters

Contains the new number of sampling points and the sampling distance of the interpolated field relative to the sampling distance before the interpolation. A sampling distance less than 1 means a finer sampling grid. A sampling distance greater than one indicates a rougher sampling grid.

zeroPoint VectorD

Zero position of the interpolated field in pixel coordinates. Use this parameter to interpolate non centered parts of the original field. The zero point parameter specifies the position of the center of the interpolated field and is measured in the pixel coordinates of the given field before the interpolation.

extrapolation ExtrapolationInfo

The mode of extrapolation used if point lies outside the definition area of the ComplexField.

Returns

ComplexField

Result of operation.

Cubic4PointInterpolation(ComplexField, SamplingParameters, VectorD, ExtrapolationInfo)

Interpolates a ComplexField using the cubic 4 point interpolation method. It is possible to interpolate a non-centered part of the field using the zeroPoint parameter.

public static ComplexField Cubic4PointInterpolation(ComplexField cf, SamplingParameters samplingParameters, VectorD zeroPoint, ExtrapolationInfo extrapolation)

Parameters

cf ComplexField

Field to be interpolated.

samplingParameters SamplingParameters

Contains the new number of sampling points and the sampling distance of the interpolated field relative to the sampling distance before the interpolation. A sampling distance less than 1 means a finer sampling grid. A sampling distance greater than one indicates a rougher sampling grid.

zeroPoint VectorD

Zero position of the interpolated field in pixel coordinates. Use this parameter to interpolate non centered parts of the original field. The zero point parameter specifies the position of the center of the interpolated field and is measured in the pixel coordinates of the given field before the interpolation.

extrapolation ExtrapolationInfo

The mode of extrapolation used if point lies outside the definition area of the ComplexField.

Returns

ComplexField

Result of operation.

Cubic4PointInterpolation(ComplexField, SamplingParameters, VectorD, ExtrapolationInfo, bool)

Interpolates a ComplexField using the cubic 4 point interpolation method. It is possible to interpolate a non-centered part of the field using the zeroPoint parameter.

public static ComplexField Cubic4PointInterpolation(ComplexField cf, SamplingParameters samplingParameters, VectorD zeroPoint, ExtrapolationInfo extrapolation, bool dontGiveNegativeValuesInRealPart)

Parameters

cf ComplexField

Field to be interpolated.

samplingParameters SamplingParameters

Contains the new number of sampling points and the sampling distance of the interpolated field relative to the sampling distance before the interpolation. A sampling distance less than 1 means a finer sampling grid. A sampling distance greater than one indicates a rougher sampling grid.

zeroPoint VectorD

Zero position of the interpolated field in pixel coordinates. Use this parameter to interpolate non centered parts of the original field. The zero point parameter specifies the position of the center of the interpolated field and is measured in the pixel coordinates of the given field before the interpolation.

extrapolation ExtrapolationInfo

The mode of extrapolation used if point lies outside the definition area of the ComplexField.

dontGiveNegativeValuesInRealPart bool

Sometimes, for real valued fields, no negative interpolated values are desired. So filter that out if this flag is set to TRUE.

Returns

ComplexField

Result of operation.

Cubic6PointInterpolation(ComplexField, SamplingParameters, VectorD, ExtrapolationInfo)

Interpolates a ComplexField using the cubic 6 point interpolation method. It is possible to interpolate a non-centered part of the ComplexField using the zeroPoint parameter.

public static ComplexField Cubic6PointInterpolation(ComplexField cf, SamplingParameters samplingParameters, VectorD zeroPoint, ExtrapolationInfo extrapolation)

Parameters

cf ComplexField

Field to be interpolated.

samplingParameters SamplingParameters

Contains the new number of sampling points and the sampling distance of the interpolated field relative to the sampling distance before the interpolation. A sampling distance less than 1 means a finer sampling grid. A sampling distance greater than one indicates a rougher sampling grid.

zeroPoint VectorD

Zero position of the interpolated field in pixel coordinates. Use this parameter to interpolate non centered parts of the original field. The zero point parameter specifies the position of the center of the interpolated field and is measured in the pixel coordinates of the given field before the interpolation.

extrapolation ExtrapolationInfo

The mode of extrapolation used if point lies outside the definition area of the ComplexField.

Returns

ComplexField

Result of operation.

Cubic8PointInterpolation(ComplexField, SamplingParameters, VectorD, ExtrapolationInfo)

Interpolates a ComplexField using the cubic 8 point interpolation method. It is possible to interpolate a non-centered part of the field using the zeroPoint parameter.

public static ComplexField Cubic8PointInterpolation(ComplexField cf, SamplingParameters samplingParameters, VectorD zeroPoint, ExtrapolationInfo extrapolation)

Parameters

cf ComplexField

Field to be interpolated.

samplingParameters SamplingParameters

Contains the new number of sampling points and the sampling distance of the interpolated field relative to the sampling distance before the interpolation. A sampling distance less than 1 means a finer sampling grid. A sampling distance greater than one indicates a rougher sampling grid.

zeroPoint VectorD

Zero position of the interpolated field in pixel coordinates. Use this parameter to interpolate non centered parts of the original field. The zero point parameter specifies the position of the center of the interpolated field and is measured in the pixel coordinates of the given field before the interpolation.

extrapolation ExtrapolationInfo

The mode of extrapolation used if point lies outside the definition area of the ComplexField.

Returns

ComplexField

Result of operation.

DiscreteOversampling(ComplexField, Vector)

Inserts zero points between sampling points.

public static ComplexField DiscreteOversampling(ComplexField field, Vector factor)

Parameters

field ComplexField

ComplexField to which the operation is applied.

factor Vector

E.g. a factor of two means, that every second sampling point is zero.

Returns

ComplexField

Result of operation.

Interpolation(ComplexField, SamplingParameters, VectorD, InterpolationMethod, ExtrapolationInfo)

Interpolates a ComplexField using the specified interpolation method. It is possible to interpolate a non-centered part of the field using the zeroPoint parameter.

public static ComplexField Interpolation(ComplexField cf, SamplingParameters samplingParameters, VectorD zeroPoint, InterpolationMethod interpolationMethod, ExtrapolationInfo extrapolation)

Parameters

cf ComplexField

Field to be interpolated.

samplingParameters SamplingParameters

Contains the new number of sampling points and the sampling distance of the interpolated field relative to the sampling distance before the interpolation. A sampling distance less than 1 means a finer sampling grid. A sampling distance greater than one indicates a rougher sampling grid.

zeroPoint VectorD

Zero position of the interpolated field in pixel coordinates. Use this parameter to interpolate non centered parts of the original field. The zero point parameter specifies the position of the center of the interpolated field and is measured in the pixel coordinates of the given field before the interpolation.

interpolationMethod InterpolationMethod

Method used for interpolation.

extrapolation ExtrapolationInfo

The mode of extrapolation used if point lies outside the definition area of the ComplexField.

Returns

ComplexField

Result of operation.

LinearInterpolation(ComplexField, SamplingParameters, VectorD, ExtrapolationInfo)

Interpolates a ComplexField using the linear interpolation method. It is possible to interpolate a non-centered part of the field using the zeroPoint parameter. The interpolation is done between 4 neighbor points. The function interpolates the phase by interpolating real and imaginary part of the points. The amplitude is interpolated separately.

public static ComplexField LinearInterpolation(ComplexField cf, SamplingParameters samplingParameters, VectorD zeroPoint, ExtrapolationInfo extrapolation)

Parameters

cf ComplexField

Field to be interpolated.

samplingParameters SamplingParameters

Contains the new number of sampling points and the sampling distance of the interpolated field relative to the sampling distance before the interpolation. A sampling distance less than 1 means a finer sampling grid. A sampling distance greater than one indicates a rougher sampling grid.

zeroPoint VectorD

Zero position of the interpolated field in pixel coordinates. Use this parameter to interpolate non centered parts of the original field. The zero point parameter specifies the position of the center of the interpolated field and is measured in the pixel coordinates of the given field before the interpolation.

extrapolation ExtrapolationInfo

The mode of extrapolation used if point lies outside the definition area of the ComplexField.

Returns

ComplexField

The interpolated field.

LinearInterpolation_RealAndImaginaryPart(ComplexField, SamplingParameters, VectorD, ExtrapolationInfo)

Interpolates a ComplexField using the linear interpolation method. It is possible to interpolate a non-centered part of the field using the zeroPoint parameter. The interpolation is done between 4 neighbor points. The function interpolates the real part and imaginary part of the complex values at all points separately.

public static ComplexField LinearInterpolation_RealAndImaginaryPart(ComplexField cf, SamplingParameters samplingParameters, VectorD zeroPoint, ExtrapolationInfo extrapolation)

Parameters

cf ComplexField

Field to be interpolated.

samplingParameters SamplingParameters

Contains the new number of sampling points and the sampling distance of the interpolated field relative to the sampling distance before the interpolation. A sampling distance less than 1 means a finer sampling grid. A sampling distance greater than one indicates a rougher sampling grid.

zeroPoint VectorD

Zero position of the interpolated field in pixel coordinates. Use this parameter to interpolate non centered parts of the original field. The zero point parameter specifies the position of the center of the interpolated field and is measured in the pixel coordinates of the given field before the interpolation.

extrapolation ExtrapolationInfo

The mode of extrapolation used if point lies outside the definition area of the ComplexField.

Returns

ComplexField

Result of operation.

NearestNeighbourInterpolation(ComplexField, SamplingParameters, VectorD, ExtrapolationInfo)

Interpolates a ComplexField using the nearest neighbor interpolation method. It is possible to interpolate a non-centered part of the field using the zeroPoint parameter.

public static ComplexField NearestNeighbourInterpolation(ComplexField cf, SamplingParameters samplingParameters, VectorD zeroPoint, ExtrapolationInfo extrapolation)

Parameters

cf ComplexField

Field to be interpolated.

samplingParameters SamplingParameters

Contains the new number of sampling points and the sampling distance of the interpolated field relative to the sampling distance before the interpolation. A sampling distance less than 1 means a finer sampling grid. A sampling distance greater than one indicates a rougher sampling grid.

zeroPoint VectorD

Zero position of the interpolated field in pixel coordinates. Use this parameter to interpolate non centered parts of the original field. The zero point parameter specifies the position of the center of the interpolated field and is measured in the pixel coordinates of the given field before the interpolation.

extrapolation ExtrapolationInfo

The mode of extrapolation used if point lies outside the definition area of the ComplexField.

Returns

ComplexField

Result of operation.

SincInterpolationFFT(ComplexField, SamplingParameters, VectorD)

Interpolates a ComplexField using the sinc interpolation method by FFT. It is possible to interpolate a non-centered part of the ComplexField using the zeroPoint parameter.

public static ComplexField SincInterpolationFFT(ComplexField cf, SamplingParameters samplingParameters, VectorD zeroPoint)

Parameters

cf ComplexField

Field to be interpolated.

samplingParameters SamplingParameters

Contains the new number of sampling points and the sampling distance of the interpolated field relative to the sampling distance before the interpolation. A sampling distance less than 1 means a finer sampling grid. A sampling distance greater than one indicates a rougher sampling grid.

zeroPoint VectorD

Zero position of the interpolated field in pixel coordinates. Use this parameter to interpolate non centered parts of the original field. The zero point parameter specifies the position of the center of the interpolated field and is measured in the pixel coordinates of the given field before the interpolation.

Returns

ComplexField

Result of operation.

SincInterpolationPointwise(ComplexField, SamplingParameters, VectorD, ExtrapolationInfo)

Interpolates a ComplexField using a point-wise sinc interpolation. It is possible to interpolate a non-centered part of the field using the zeroPoint parameter.

public static ComplexField SincInterpolationPointwise(ComplexField cf, SamplingParameters samplingParameters, VectorD zeroPoint, ExtrapolationInfo extrapolation)

Parameters

cf ComplexField

Field to be interpolated.

samplingParameters SamplingParameters

Contains the new number of sampling points and the sampling distance of the interpolated field relative to the sampling distance before the interpolation. A sampling distance less than 1 means a finer sampling grid. A sampling distance greater than one indicates a rougher sampling grid.

zeroPoint VectorD

Zero position of the interpolated field in pixel coordinates. Use this parameter to interpolate non centered parts of the original field. The zero point parameter specifies the position of the center of the interpolated field and is measured in the pixel coordinates of the given field before the interpolation.

extrapolation ExtrapolationInfo

The mode of extrapolation used if point lies outside the definition area of the ComplexField.

Returns

ComplexField

Result of operation.

TruncatedSincInterpolation(ComplexField, SamplingParameters, VectorD, ExtrapolationInfo)

Interpolates a ComplexField using the truncated sinc interpolation method. It is possible to interpolate a non-centered part of the field using the zeroPoint parameter.

public static ComplexField TruncatedSincInterpolation(ComplexField cf, SamplingParameters samplingParameters, VectorD zeroPoint, ExtrapolationInfo extrapolation)

Parameters

cf ComplexField

ComplexField to interpolate.

samplingParameters SamplingParameters

Contains the new number of Sampling Points and the sampling distance of the interpolated ComplexField relative to the sampling distance before the interpolation. A sampling distance lower 1 means a finer sampling grid. A sampling distance larger one indicates a rough sampling grid.

zeroPoint VectorD

Zero position of the interpolated field in pixel coordinates. Use this parameter to interpolate non centered parts of the original ComplexField. The zero point parameter specifies the position of the center of the interpolated ComplexField and is measured in the pixel coordinates of the ComplexField before the interpolation.

extrapolation ExtrapolationInfo

The mode of extrapolation used if point lies outside the definition area of the ComplexField.

Returns

ComplexField

Interpolated ComplexField.

WindowedSincInterpolation(ComplexField, SamplingParameters, VectorD)

Similar to the interpolation WindowedSincInterpolation(ComplexField, SamplingParameters, VectorD, int) but with 3 border pixels.

public static ComplexField WindowedSincInterpolation(ComplexField cf, SamplingParameters samplingParameters, VectorD zeroPoint)

Parameters

cf ComplexField

Field to be interpolated.

samplingParameters SamplingParameters

Contains the new number of sampling points and the sampling distance of the interpolated field relative to the sampling distance before the interpolation. A sampling distance less than 1 means a finer sampling grid. A sampling distance greater than one indicates a rougher sampling grid.

zeroPoint VectorD

Zero position of the interpolated field in pixel coordinates. Use this parameter to interpolate non centered parts of the original field. The zero point parameter specifies the position of the center of the interpolated field and is measured in the pixel coordinates of the given field before the interpolation.

Returns

ComplexField

Result of operation.

WindowedSincInterpolation(ComplexField, SamplingParameters, VectorD, int)

In difference to standard sinc interpolation (FFT based) that always interpolates the whole ComplexField this function extracts the desired interpolation array plus the border pixels on every side. This extracted array is sinc interpolated (FFT based). Since the sinc interpolation is a global interpolation this interpolation is only an approximation. Strongest numerical errors can be found close to the borders of the interpolated field. Decreased errors can be achieved by increasing the number of border pixels.

public static ComplexField WindowedSincInterpolation(ComplexField cf, SamplingParameters samplingParameters, VectorD zeroPoint, int borderPixels)

Parameters

cf ComplexField

Field to be interpolated.

samplingParameters SamplingParameters

Contains the new number of sampling points and the sampling distance of the interpolated field relative to the sampling distance before the interpolation. A sampling distance less than 1 means a finer sampling grid. A sampling distance greater than one indicates a rougher sampling grid.

zeroPoint VectorD

Zero position of the interpolated field in pixel coordinates. Use this parameter to interpolate non centered parts of the original field. The zero point parameter specifies the position of the center of the interpolated field and is measured in the pixel coordinates of the given field before the interpolation.

borderPixels int

Width of border around numerical window.

Returns

ComplexField

Result of operation.