Interpolation along two dimensions. More...
Functions | |
AFAPI array | approx2 (const array &in, const array &pos0, const array &pos1, const interpType method=AF_INTERP_LINEAR, const float off_grid=0.0f) |
C++ Interface for data interpolation on two-dimensional signals. More... | |
AFAPI array | approx2 (const array &in, const array &pos0, const int interp_dim0, const double idx_start_dim0, const double idx_step_dim0, const array &pos1, const int interp_dim1, const double idx_start_dim1, const double idx_step_dim1, const interpType method=AF_INTERP_LINEAR, const float off_grid=0.0f) |
C++ Interface for data interpolation on two-dimensional signals. More... | |
AFAPI af_err | af_approx2 (af_array *out, const af_array in, const af_array pos0, const af_array pos1, const af_interp_type method, const float off_grid) |
C Interface for signals interpolation on two dimensional signals. More... | |
AFAPI af_err | af_approx2_v2 (af_array *out, const af_array in, const af_array pos0, const af_array pos1, const af_interp_type method, const float off_grid) |
C Interface for the version of af_approx2 that accepts a preallocated output array. More... | |
AFAPI af_err | af_approx2_uniform (af_array *out, const af_array in, const af_array pos0, const int interp_dim0, const double idx_start_dim0, const double idx_step_dim0, const af_array pos1, const int interp_dim1, const double idx_start_dim1, const double idx_step_dim1, const af_interp_type method, const float off_grid) |
C Interface for signals interpolation on two dimensional signals along specified dimensions. More... | |
AFAPI af_err | af_approx2_uniform_v2 (af_array *out, const af_array in, const af_array pos0, const int interp_dim0, const double idx_start_dim0, const double idx_step_dim0, const af_array pos1, const int interp_dim1, const double idx_start_dim1, const double idx_step_dim1, const af_interp_type method, const float off_grid) |
C Interface for the version of af_approx2_uniform that accepts a preallocated output array. More... | |
Interpolation along two dimensions.
Performs interpolation on data along two dimensions.
Interpolation is the process of computing for unknown values within a continuous range described by a discrete set of known values. These known values correspond to a uniformly-spaced range of indices determined by start and step values, whose defaults are 0.0 and 1.0, respectively.
The positions arrays (pos0
and pos1
) contain the interpolating points (indices whose values we want to find) along two given dimensions. Values of known indices will be looked up in the input array, while values of unknown indices will be found via interpolation. Indices outside of the index range are not extrapolated. Instead, those values are set to off_grid
, whose default value is 0.0.
All of the interpolation methods defined in af_interp_type are supported by approx2. Unless specified, linear interpolation is performed by default.
AFAPI af_err af_approx2 | ( | af_array * | out, |
const af_array | in, | ||
const af_array | pos0, | ||
const af_array | pos1, | ||
const af_interp_type | method, | ||
const float | off_grid | ||
) |
C Interface for signals interpolation on two dimensional signals.
[out] | out | the interpolated array. |
[in] | in | is the multidimensional input array. Values assumed to lie uniformly spaced indices in the range of [0, n) along both interpolation dimensions. n is the number of elements in the array. |
[in] | pos0 | positions of the interpolation points along the first dimension. |
[in] | pos1 | positions of the interpolation points along the second dimension. |
[in] | method | is the interpolation method to be used. All interpolation types defined in af_interp_type are supported. |
[in] | off_grid | is the default value for any indices outside the valid range of indices. |
AFAPI af_err af_approx2_uniform | ( | af_array * | out, |
const af_array | in, | ||
const af_array | pos0, | ||
const int | interp_dim0, | ||
const double | idx_start_dim0, | ||
const double | idx_step_dim0, | ||
const af_array | pos1, | ||
const int | interp_dim1, | ||
const double | idx_start_dim1, | ||
const double | idx_step_dim1, | ||
const af_interp_type | method, | ||
const float | off_grid | ||
) |
C Interface for signals interpolation on two dimensional signals along specified dimensions.
af_approx2_uniform() accepts two dimensions to perform the interpolation along the input. It also accepts start and step values which define the uniform range of corresponding indices.
[out] | out | the interpolated array. |
[in] | in | is the multidimensional input array. |
[in] | pos0 | positions of the interpolation points along interp_dim0 . |
[in] | interp_dim0 | is the first dimension to perform interpolation across. |
[in] | idx_start_dim0 | is the first index value along interp_dim0 . |
[in] | idx_step_dim0 | is the uniform spacing value between subsequent indices along interp_dim0 . |
[in] | pos1 | positions of the interpolation points along interp_dim1 . |
[in] | interp_dim1 | is the second dimension to perform interpolation across. |
[in] | idx_start_dim1 | is the first index value along interp_dim1 . |
[in] | idx_step_dim1 | is the uniform spacing value between subsequent indices along interp_dim1 . |
[in] | method | is the interpolation method to be used. All interpolation types defined in af_interp_type are supported. |
[in] | off_grid | is the default value for any indices outside the valid range of indices. |
AFAPI af_err af_approx2_uniform_v2 | ( | af_array * | out, |
const af_array | in, | ||
const af_array | pos0, | ||
const int | interp_dim0, | ||
const double | idx_start_dim0, | ||
const double | idx_step_dim0, | ||
const af_array | pos1, | ||
const int | interp_dim1, | ||
const double | idx_start_dim1, | ||
const double | idx_step_dim1, | ||
const af_interp_type | method, | ||
const float | off_grid | ||
) |
C Interface for the version of af_approx2_uniform that accepts a preallocated output array.
[in,out] | out | the interpolated array. |
[in] | in | is the multidimensional input array. |
[in] | pos0 | positions of the interpolation points along interp_dim0 . |
[in] | interp_dim0 | is the first dimension to perform interpolation across. |
[in] | idx_start_dim0 | is the first index value along interp_dim0 . |
[in] | idx_step_dim0 | is the uniform spacing value between subsequent indices along interp_dim0 . |
[in] | pos1 | positions of the interpolation points along interp_dim1 . |
[in] | interp_dim1 | is the second dimension to perform interpolation across. |
[in] | idx_start_dim1 | is the first index value along interp_dim1 . |
[in] | idx_step_dim1 | is the uniform spacing value between subsequent indices along interp_dim1 . |
[in] | method | is the interpolation method to be used. All interpolation types defined in af_interp_type are supported. |
[in] | off_grid | is the default value for any indices outside the valid range of indices. |
out
can either be a null or existing af_array
object. If it is a sub-array of an existing af_array
, only the corresponding portion of the af_array
will be overwritten af_array
to out
that has not been initialized will cause undefined behavior. AFAPI af_err af_approx2_v2 | ( | af_array * | out, |
const af_array | in, | ||
const af_array | pos0, | ||
const af_array | pos1, | ||
const af_interp_type | method, | ||
const float | off_grid | ||
) |
C Interface for the version of af_approx2 that accepts a preallocated output array.
[in,out] | out | the interpolated array (can be preallocated). |
[in] | in | is the multidimensional input array. Values assumed to lie uniformly spaced indices in the range of [0, n) along both interpolation dimensions. n is the number of elements in the array. |
[in] | pos0 | positions of the interpolation points along the first dimension. |
[in] | pos1 | positions of the interpolation points along the second dimension. |
[in] | method | is the interpolation method to be used. All interpolation types defined in af_interp_type are supported. |
[in] | off_grid | is the default value for any indices outside the valid range of indices. |
out
can either be a null or existing af_array
object. If it is a sub-array of an existing af_array
, only the corresponding portion of the af_array
will be overwritten af_array
to out
that has not been initialized will cause undefined behavior. AFAPI array approx2 | ( | const array & | in, |
const array & | pos0, | ||
const array & | pos1, | ||
const interpType | method = AF_INTERP_LINEAR , |
||
const float | off_grid = 0.0f |
||
) |
C++ Interface for data interpolation on two-dimensional signals.
[in] | in | is the multidimensional input array. Values assumed to lie uniformly spaced indices in the range of [0, n) along both interpolation dimensions. n is the number of elements in the array. |
[in] | pos0 | positions of the interpolation points along the first dimension. |
[in] | pos1 | positions of the interpolation points along the second dimension. |
[in] | method | is the interpolation method to be used. All interpolation types defined in af_interp_type are supported. |
[in] | off_grid | is the default value for any indices outside the valid range of indices. |
The code sample below demonstrates approx2()'s usage:
AFAPI array approx2 | ( | const array & | in, |
const array & | pos0, | ||
const int | interp_dim0, | ||
const double | idx_start_dim0, | ||
const double | idx_step_dim0, | ||
const array & | pos1, | ||
const int | interp_dim1, | ||
const double | idx_start_dim1, | ||
const double | idx_step_dim1, | ||
const interpType | method = AF_INTERP_LINEAR , |
||
const float | off_grid = 0.0f |
||
) |
C++ Interface for data interpolation on two-dimensional signals.
The following version of the approx2() accepts the two dimensions to perform the interpolation along the input. It also accepts start and step values which define the uniform range of corresponding indices.
[in] | in | is the multidimensional input array. |
[in] | pos0 | positions of the interpolation points along interp_dim0 . |
[in] | interp_dim0 | is the first dimension to perform interpolation across. |
[in] | idx_start_dim0 | is the first index value along interp_dim0 . |
[in] | idx_step_dim0 | is the uniform spacing value between subsequent indices along interp_dim0 . |
[in] | pos1 | positions of the interpolation points along interp_dim1 . |
[in] | interp_dim1 | is the second dimension to perform interpolation across. |
[in] | idx_start_dim1 | is the first index value along interp_dim1 . |
[in] | idx_step_dim1 | is the uniform spacing value between subsequent indices along interp_dim1 . |
[in] | method | is the interpolation method to be used. All interpolation types defined in af_interp_type are supported. |
[in] | off_grid | is the default value for any indices outside the valid range of indices. |
The code sample below demonstrates usage: