NUMinterpol.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. /********** Interpolation and optimization **********/
  21. // Special values for interpolationDepth:
  22. #define NUM_VALUE_INTERPOLATE_NEAREST 0
  23. #define NUM_VALUE_INTERPOLATE_LINEAR 1
  24. #define NUM_VALUE_INTERPOLATE_CUBIC 2
  25. // Higher values than 2 yield a true sinc interpolation. Here are some examples:
  26. #define NUM_VALUE_INTERPOLATE_SINC70 70
  27. #define NUM_VALUE_INTERPOLATE_SINC700 700
  28. double NUM_interpolate_sinc (double y [], integer nx, double x, integer interpolationDepth);
  29. #define NUM_PEAK_INTERPOLATE_NONE 0
  30. #define NUM_PEAK_INTERPOLATE_PARABOLIC 1
  31. #define NUM_PEAK_INTERPOLATE_CUBIC 2
  32. #define NUM_PEAK_INTERPOLATE_SINC70 3
  33. #define NUM_PEAK_INTERPOLATE_SINC700 4
  34. double NUMimproveExtremum (double *y, integer nx, integer ixmid, int interpolation, double *ixmid_real, int isMaximum);
  35. double NUMimproveMaximum (double *y, integer nx, integer ixmid, int interpolation, double *ixmid_real);
  36. double NUMimproveMinimum (double *y, integer nx, integer ixmid, int interpolation, double *ixmid_real);
  37. void NUM_viterbi (
  38. integer numberOfFrames, integer maxnCandidates,
  39. integer (*getNumberOfCandidates) (integer iframe, void *closure),
  40. double (*getLocalCost) (integer iframe, integer icand, void *closure),
  41. double (*getTransitionCost) (integer iframe, integer icand1, integer icand2, void *closure),
  42. void (*putResult) (integer iframe, integer place, void *closure),
  43. void *closure);
  44. void NUM_viterbi_multi (
  45. integer nframe, integer ncand, integer ntrack,
  46. double (*getLocalCost) (integer iframe, integer icand, integer itrack, void *closure),
  47. double (*getTransitionCost) (integer iframe, integer icand1, integer icand2, integer itrack, void *closure),
  48. void (*putResult) (integer iframe, integer place, integer itrack, void *closure),
  49. void *closure);
  50. /* End of file NUMinterpol.h */
  51. #endif