Formant.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #ifndef _Formant_h_
  2. #define _Formant_h_
  3. /* Formant.h
  4. *
  5. * Copyright (C) 1992-2011,2015,2017 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. #include "Matrix.h"
  21. #include "Table.h"
  22. Thing_declare (Interpreter);
  23. #include "Formant_enums.h"
  24. #include "Formant_def.h"
  25. autoFormant Formant_create (double tmin, double tmax, integer nt, double dt, double t1, integer maximumNumberOfFormants);
  26. /*
  27. Function:
  28. return a new instance of Formant.
  29. Preconditions:
  30. nt >= 1;
  31. dt > 0.0;
  32. maxnFormants >= 1;
  33. Postconditions:
  34. my xmin = tmin;
  35. my xmax = tmax;
  36. my nx = nt;
  37. my dx = dt;
  38. my x1 = t1;
  39. my maximumNumberOfPairs == maxnFormants;
  40. my frames [1..nt]. intensity == 0.0;
  41. my frames [1..nt]. numberOfPairs == 0;
  42. my frames [1..nt]. formants [1..maxnFormants] = 0.0;
  43. my frames [1..nt]. bandwidths [1..maxnFormants] = 0.0;
  44. */
  45. integer Formant_getMinNumFormants (Formant me);
  46. integer Formant_getMaxNumFormants (Formant me);
  47. double Formant_getValueAtTime (Formant me, integer formantNumber, double time, kFormant_unit unit);
  48. double Formant_getBandwidthAtTime (Formant me, integer formantNumber, double time, kFormant_unit unit);
  49. void Formant_getExtrema (Formant me, integer formantNumber, double tmin, double tmax, double *fmin, double *fmax);
  50. void Formant_getMinimumAndTime (Formant me, integer formantNumber, double tmin, double tmax, kFormant_unit unit, int interpolate,
  51. double *return_minimum, double *return_timeOfMinimum);
  52. void Formant_getMaximumAndTime (Formant me, integer formantNumber, double tmin, double tmax, kFormant_unit unit, int interpolate,
  53. double *return_maximum, double *return_timeOfMaximum);
  54. double Formant_getMinimum (Formant me, integer formantNumber, double tmin, double tmax, kFormant_unit unit, int interpolate);
  55. double Formant_getMaximum (Formant me, integer formantNumber, double tmin, double tmax, kFormant_unit unit, int interpolate);
  56. double Formant_getTimeOfMaximum (Formant me, integer formantNumber, double tmin, double tmax, kFormant_unit unit, int interpolate);
  57. double Formant_getTimeOfMinimum (Formant me, integer formantNumber, double tmin, double tmax, kFormant_unit unit, int interpolate);
  58. double Formant_getQuantile (Formant me, integer formantNumber, double quantile, double tmin, double tmax, kFormant_unit unit);
  59. double Formant_getQuantileOfBandwidth (Formant me, integer formantNumber, double quantile, double tmin, double tmax, kFormant_unit unit);
  60. double Formant_getMean (Formant me, integer formantNumber, double tmin, double tmax, kFormant_unit unit);
  61. double Formant_getStandardDeviation (Formant me, integer formantNumber, double tmin, double tmax, kFormant_unit unit);
  62. void Formant_sort (Formant me);
  63. void Formant_drawTracks (Formant me, Graphics graphics, double tmin, double tmax, double fmax, bool garnish);
  64. void Formant_drawSpeckles_inside (Formant me, Graphics graphics, double tmin, double tmax, double fmin, double fmax,
  65. double suppress_dB);
  66. void Formant_drawSpeckles (Formant me, Graphics graphics, double tmin, double tmax, double fmax,
  67. double suppress_dB, bool garnish);
  68. void Formant_scatterPlot (Formant me, Graphics graphics, double tmin, double tmax,
  69. integer iformant1, double fmin1, double fmax1, integer iformant2, double fmin2, double fmax2,
  70. double size_mm, conststring32 mark, bool garnish);
  71. autoMatrix Formant_to_Matrix (Formant me, integer iformant);
  72. autoMatrix Formant_to_Matrix_bandwidths (Formant me, integer iformant);
  73. void Formant_formula_frequencies (Formant me, conststring32 formula, Interpreter interpreter);
  74. void Formant_formula_bandwidths (Formant me, conststring32 formula, Interpreter interpreter);
  75. autoFormant Formant_tracker (Formant me, integer numberOfTracks,
  76. double refF1, double refF2, double refF3, double refF4, double refF5,
  77. double dfCost, // per kHz
  78. double bfCost, double octaveJumpCost);
  79. autoTable Formant_downto_Table (Formant me, bool includeFrameNumbers,
  80. bool includeTimes, integer timeDecimals,
  81. bool includeIntensity, integer intensityDecimals,
  82. bool includeNumberOfFormants, integer frequencyDecimals,
  83. bool includeBandwidths);
  84. void Formant_list (Formant me, bool includeFrameNumbers,
  85. bool includeTimes, integer timeDecimals,
  86. bool includeIntensity, integer intensityDecimals,
  87. bool includeNumberOfFormants, integer frequencyDecimals,
  88. bool includeBandwidths);
  89. /* End of file Formant.h */
  90. #endif