Formant_def.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* Formant_def.h
  2. *
  3. * Copyright (C) 1992-2005,2008,2011,2015-2018 Paul Boersma
  4. *
  5. * This code is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * This code is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. * See the GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this work. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #define ooSTRUCT Formant_Formant
  19. oo_DEFINE_STRUCT (Formant_Formant)
  20. #if oo_READING
  21. oo_VERSION_UNTIL (2)
  22. oo_FLOAT (frequency)
  23. oo_FLOAT (bandwidth)
  24. oo_VERSION_ELSE
  25. oo_DOUBLE (frequency)
  26. oo_DOUBLE (bandwidth)
  27. oo_VERSION_END
  28. #else
  29. oo_DOUBLE (frequency)
  30. oo_DOUBLE (bandwidth)
  31. #endif
  32. oo_END_STRUCT (Formant_Formant)
  33. #undef ooSTRUCT
  34. #define ooSTRUCT Formant_Frame
  35. oo_DEFINE_STRUCT (Formant_Frame)
  36. oo_FROM (1)
  37. oo_DOUBLE (intensity)
  38. oo_ENDFROM
  39. oo_INT16 (nFormants)
  40. oo_STRUCT_VECTOR (Formant_Formant, formant, nFormants)
  41. oo_END_STRUCT (Formant_Frame)
  42. #undef ooSTRUCT
  43. #define ooSTRUCT Formant
  44. oo_DEFINE_CLASS (Formant, Sampled)
  45. oo_INT16 (maxnFormants)
  46. oo_STRUCT_VECTOR (Formant_Frame, d_frames, nx)
  47. #if oo_DECLARING
  48. void v_info ()
  49. override;
  50. int v_domainQuantity ()
  51. override { return MelderQuantity_TIME_SECONDS; }
  52. double v_getValueAtSample (integer iframe, integer which, int units)
  53. override;
  54. #endif
  55. oo_END_CLASS (Formant)
  56. #undef ooSTRUCT
  57. /* End of file Formant_def.h */