GCpp general purpose C++ library
version 1.0
|
Go to the source code of this file.
Functions | |
int | GArrayInterpolationLinear (const u_int Nin, const double Yin[], const u_int Nout, double Yout[], const double X0, const double dX) |
int | GArrayInterpolationLinear (const u_int Nin, const double Yin[], const double Xin0, const double dXin, const u_int Nout, double Yout[], const double Xout0, const double dXout) |
int | GArrayInterpolationCubic (const u_int Nin, const double Yin[], const u_int Nout, double Yout[], const double X0, const double dX) |
int | GArrayInterpolationCubic (const u_int Nin, const double Yin[], const double Xin0, const double dXin, const u_int Nout, double Yout[], const double Xout0, const double dXout) |
Include file for interpolation functions.
int GArrayInterpolationCubic | ( | const u_int | Nin, |
const double | Yin[], | ||
const u_int | Nout, | ||
double | Yout[], | ||
const double | X0, | ||
const double | dX | ||
) |
Computes the output array Yout from a cubic interpolation of the input array Yin.
The input array is interpreted as a serie of Nin points with coordinates (x,y) = ( i, Yin[i] ), which means the fist point is at X=0 and the step on the X axis is 1. The output array as points with coordinates (x,y) = ( X0+j*dX, Yout[j] ).
If some of the output points are outside the input range [0:Nin-1], the result for those points will be an extrapolation from the first or last interval.
The function returns 0 if no error occured. The input array must have a dimension of at least 2, and the output one must be at leat 1 point.
Nin | size of the input array |
Yin | input array |
Nout | size of the output array |
Yout | output array |
X0 | X-position of the first point of the output array |
dX | output array step value |
References GLogWarning().
Referenced by GArrayInterpolationCubic(), GRealSampleFFT::InterpolateFrom(), and GRealSampleFFT::SetTimeResponse().
int GArrayInterpolationCubic | ( | const u_int | Nin, |
const double | Yin[], | ||
const double | Xin0, | ||
const double | dXin, | ||
const u_int | Nout, | ||
double | Yout[], | ||
const double | Xout0, | ||
const double | dXout | ||
) |
Computes the output array Yout from a cubic interpolation of the input array Yin.
The input array is interpreted as a serie of Nin points with coordinates (x,y) = ( Xin0+j*dXin, Yin[i] ). The output array as points with coordinates (x,y) = ( Xout0+j*dXout, Yout[j] ).
If some of the output points are outside the input range [0:Nin-1], the result for those points will be an extrapolation from the first or last interval.
The function returns 0 if no error occured. The input array must have a dimension of at least 2, and the output one must be at leat 1 point.
Nin | size of the input array |
Yin | input array |
Xin0 | X-position of the first point of the input array |
dXin | input array step value |
Nout | size of the output array |
Yout | output array |
Xout0 | X-position of the first point of the output array |
dXout | output array step value |
References GArrayInterpolationCubic(), and GLogWarning().
int GArrayInterpolationLinear | ( | const u_int | Nin, |
const double | Yin[], | ||
const u_int | Nout, | ||
double | Yout[], | ||
const double | X0, | ||
const double | dX | ||
) |
Computes the output array Yout from a linear interpolation of the input array Yin.
The input array is interpreted as a serie of Nin points with coordinates (x,y) = ( i, Yin[i] ), which means the fist point is at X=0 and the step on the X axis is 1. The output array as points with coordinates (x,y) = ( X0+j*dX, Yout[j] ).
If some of the output points are outside the input range [0:Nin-1], the result for those points will be an extrapolation from the first or last interval.
The function returns 0 if no error occured. The input array must have a dimension of at least 2, and the output one must be at leat 1 point.
Nin | size of the input array |
Yin | input array |
Nout | size of the output array |
Yout | output array |
X0 | X-position of the first point of the output array |
dX | output array step value |
References GLogWarning().
Referenced by GArrayInterpolationLinear(), GRealSampleFFT::InterpolateFrom(), and GRealSampleFFT::SetTimeResponse().
int GArrayInterpolationLinear | ( | const u_int | Nin, |
const double | Yin[], | ||
const double | Xin0, | ||
const double | dXin, | ||
const u_int | Nout, | ||
double | Yout[], | ||
const double | Xout0, | ||
const double | dXout | ||
) |
Computes the output array Yout from a linear interpolation of the input array Yin.
The input array is interpreted as a serie of Nin points with coordinates (x,y) = ( Xin0+j*dXin, Yin[i] ). The output array as points with coordinates (x,y) = ( Xout0+j*dXout, Yout[j] ).
If some of the output points are outside the input range [0:Nin-1], the result for those points will be an extrapolation from the first or last interval.
The function returns 0 if no error occured. The input array must have a dimension of at least 2, and the output one must be at leat 1 point.
Nin | size of the input array |
Yin | input array |
Xin0 | X-position of the first point of the input array |
dXin | input array step value |
Nout | size of the output array |
Yout | output array |
Xout0 | X-position of the first point of the output array |
dXout | output array step value |
References GArrayInterpolationLinear(), and GLogWarning().