This module implements several algorithms for performing sub-sample interpolation of peaks in the output of a matched filter.
The interface for each algorithm is the same. To illustrate, here is a description of the interface for the 'Lanczos' algorithm.
There is an opaque data type called LanczosTriggerInterpolant
that holds workspaces for performing the interpolation. To create one, call the function XLALCreateLanczosTriggerInterpolant
as follows:
The '5' is the interpolation window. In this example, the interpolation will take into account a given sample, the 5 samples before, and the 5 samples after, for a total of 11 samples.
To apply the interpolant to a time series, call XLALApplyLanczosTriggerInterpolant
. It is requried that |y[0]| >= |y[i]| for all i from -window
to +window
. Suppose that you have a complex array y:
and suppose that the maximum of |y[i]| occurs at i = 8. To interpolate the time and complex value at which the maximum occurs, do the following:
Upon success, the return value of XLALApplyLanczosTriggerInterpolant
is zero, the interpolated index of the maximum sample is 8 + *tmax
, and the interpolated value is in ymax
. Upon failure, the return value is nonzero and neither *tmax
nor *ymax
are modified.
When you are done, release all of the workspace resources associated with the interpolant with:
Modules | |
Cubic Spline Trigger Interpolant | |
Catmull-Rom cubic spline interpolation. | |
Lanczos Trigger Interpolant | |
Lanczos interpolation. | |
Nearest Neighbor Trigger Interpolant | |
Nearest-neighbor interpolation. | |
Quadratic Fit Trigger Interpolant | |
Quadratic fit. | |