Harmonicity.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #ifndef _Harmonicity_h_
  2. #define _Harmonicity_h_
  3. /* Harmonicity.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 "Vector.h"
  21. Thing_define (Harmonicity, Vector) {
  22. void v_info ()
  23. override;
  24. int v_domainQuantity ()
  25. override { return MelderQuantity_TIME_SECONDS; }
  26. };
  27. /* Attributes:
  28. xmin // Start time (seconds).
  29. xmax > xmin // End time (seconds).
  30. nx >= 1 // Number of time slices.
  31. dx > 0.0 // Time step (seconds).
  32. x1 // Centre of first time slice (seconds).
  33. ymin, ymax, dy, y1 = 1.0
  34. ny = 1
  35. z [1] [1..nt]
  36. // The harmonic strength, a real number between -150 dB and +150 dB:
  37. // -150 dB means not periodic at all, +150 dB means perfectly periodic.
  38. // Normal values for speech are between -10 dB for [s] and +30 dB for [u].
  39. // -200 means silence.
  40. */
  41. autoHarmonicity Harmonicity_create (double tmin, double tmax, integer nt, double dt, double t1);
  42. void Harmonicity_draw (Harmonicity me, double tmin, double tmax, double min, double max);
  43. /*
  44. draw a harmonicity contour into the current Graphics.
  45. If tmax <= tmin, draw whole time domain.
  46. If max <= min, scale to extrema.
  47. */
  48. double Harmonicity_getMean (Harmonicity me, double tmin, double tmax);
  49. double Harmonicity_getStandardDeviation (Harmonicity me, double tmin, double tmax);
  50. double Harmonicity_getQuantile (Harmonicity me, double quantile);
  51. autoMatrix Harmonicity_to_Matrix (Harmonicity me);
  52. autoHarmonicity Matrix_to_Harmonicity (Matrix me);
  53. /* End of file Harmonicity.h */
  54. #endif