int chirp_metric(double x, double y, double *m);This routine computes the coefficients of a local distance metric on the space of chirp templates, at a specified location in that space. It returns 0 upon successful completion, or 1 if the metric could not be computed at that point.
The arguments are:
Note that this routine uses the global parameter global_space,
defined at the top of the
chirp_templates.c module. This
parameter must be set by the routines set_chirp_space() or
get_chirp_templates() before chirp_metric() can be
called. The coordinate system used is the one defined in the
global_space structure: it is to a (counterclockwise) rotation
of the coordinate system by an angle of global_space.angle. The metric is computed by interpolating the
grid of precomputed quadratic coefficients of the match function,
stored in global_space.grid.
The local distance function is defined so that the match decreases to
the value global_space.match at a proper distance of 1. That
is, the unit of proper distance is defined to be the maximum template
patch radius. The metric coefficients m[0..2] are related to
the proper interval by:
(9.34.216) |
(9.34.217) |
(9.34.218) |
This routine also checks to make sure that the resulting metric is positive definite, which should always be the case if the match function is locally paraboloidal (rather than a saddle).