Cepstrumc.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #ifndef _Cepstrumc_h_
  2. #define _Cepstrumc_h_
  3. /* Cepstrumc.h
  4. *
  5. * Copyright (C) 1994-2017 David Weenink
  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. See the GNU
  15. * 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. djmw 19950822
  22. djmw 20020812 GPL header
  23. djmw 20110306 Latest modification.
  24. */
  25. #include "Sampled.h"
  26. #include "Matrix.h"
  27. #include "Graphics.h"
  28. #include "DTW.h"
  29. #include "Cepstrumc_def.h"
  30. void Cepstrumc_init (Cepstrumc me, double tmin, double tmax, integer nt, double dt, double t1,
  31. int nCoefficients, double samplingFrequency);
  32. autoCepstrumc Cepstrumc_create (double tmin, double tmax, integer nt, double dt, double t1,
  33. int nCoefficients, double samplingFrequency);
  34. /******************* Frames ************************************************/
  35. void Cepstrumc_Frame_init (Cepstrumc_Frame me, int nCoefficients);
  36. autoDTW Cepstrumc_to_DTW ( Cepstrumc me, Cepstrumc thee, double wc, double wle,
  37. double wr, double wer, double dtr, int matchStart, int matchEnd, int constraint);
  38. /*
  39. 1. Calculate distances between Cepstra:
  40. Distance between frame i (from me) and j (from thee) is
  41. wc * d1 + wle * d2 + wr * d3 + wer * d4,
  42. where wc, wle, wr & wer are weights and
  43. d1 = Sum (k=1; k=nCoefficients; (c[i,k]-c[j,k])^2)
  44. d2 = (c[0,k]-c[0,k])^2
  45. d3 = Sum (k=1; k=nCoefficients; (r[i,k]-r[j,k])^2), with
  46. r[i,k] the regression coefficient of the cepstral coefficients
  47. from the frames within a time span of 'dtr' seconds.
  48. c[i,j] is jth cepstral coefficient in frame i.
  49. d4 = regression on energy (c[0])
  50. 2. Find optimum path through the distance matrix (see DTW).
  51. PRECONDITIONS:
  52. at least one of wc, wle, wr, wer != 0
  53. */
  54. autoMatrix Cepstrumc_to_Matrix (Cepstrumc me);
  55. #endif /* _Cepstrumc_h_ */