Debian Codegraph @

melder/NUMinterpol.h

raw
1 #ifndef _NUMinterpol_h_
2 #define _NUMinterpol_h_
3 /* NUMinterpol.h
4 *
5 * Copyright (C) 1992-2018 Paul Boersma
6 *
7 * This code is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or (at
10 * your option) any later version.
11 *
12 * This code is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15 * See the GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this work. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 /********** Interpolation and optimization **********/
22
23 // Special values for interpolationDepth:
24 #define NUM_VALUE_INTERPOLATE_NEAREST 0
25 #define NUM_VALUE_INTERPOLATE_LINEAR 1
26 #define NUM_VALUE_INTERPOLATE_CUBIC 2
27 // Higher values than 2 yield a true sinc interpolation. Here are some examples:
28 #define NUM_VALUE_INTERPOLATE_SINC70 70
29 #define NUM_VALUE_INTERPOLATE_SINC700 700
30 double NUM_interpolate_sinc (constVEC const& y, double x, integer interpolationDepth);
31
32 #define NUM_PEAK_INTERPOLATE_NONE 0
33 #define NUM_PEAK_INTERPOLATE_PARABOLIC 1
34 #define NUM_PEAK_INTERPOLATE_CUBIC 2
35 #define NUM_PEAK_INTERPOLATE_SINC70 3
36 #define NUM_PEAK_INTERPOLATE_SINC700 4
37
38 double NUMimproveExtremum (constVEC const& y, integer ixmid, integer interpolationDepth, double *ixmid_real, bool isMaximum);
39 double NUMimproveMaximum (constVEC const& y, integer ixmid, integer interpolationDepth, double *ixmid_real);
40 double NUMimproveMinimum (constVEC const& y, integer ixmid, integer interpolationDepth, double *ixmid_real);
41
42 void NUM_viterbi (
43 integer numberOfFrames, integer maxnCandidates,
44 integer (*getNumberOfCandidates) (integer iframe, void *closure),
45 double (*getLocalCost) (integer iframe, integer icand, void *closure),
46 double (*getTransitionCost) (integer iframe, integer icand1, integer icand2, void *closure),
47 void (*putResult) (integer iframe, integer place, void *closure),
48 void *closure);
49
50 void NUM_viterbi_multi (
51 integer nframe, integer ncand, integer ntrack,
52 double (*getLocalCost) (integer iframe, integer icand, integer itrack, void *closure),
53 double (*getTransitionCost) (integer iframe, integer icand1, integer icand2, integer itrack, void *closure),
54 void (*putResult) (integer iframe, integer place, integer itrack, void *closure),
55 void *closure);
56
57 /* End of file NUMinterpol.h */
58 #endif