Art_Speaker_Delta.cpp 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /* Art_Speaker_Delta.cpp
  2. *
  3. * Copyright (C) 1992-2005,2009,2011,2016-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. #include "Art_Speaker_Delta.h"
  19. #include "Art_Speaker.h"
  20. void Art_Speaker_intoDelta (Art art, Speaker speaker, Delta delta)
  21. {
  22. double f = speaker -> relativeSize * 1e-3;
  23. double xe [30], ye [30], xi [30], yi [30], xmm [30], ymm [30];
  24. /* Lungs. */
  25. for (integer itube = 7; itube <= 18; itube ++)
  26. delta -> tube [itube]. Dyeq = 120 * f * (1 + art -> art [(int) kArt_muscle::LUNGS]);
  27. /* Glottis. */
  28. {
  29. Delta_Tube t = delta -> tube + 36;
  30. t -> Dyeq = f * (5 - 10 * art -> art [(int) kArt_muscle::INTERARYTENOID]
  31. + 3 * art -> art [(int) kArt_muscle::POSTERIOR_CRICOARYTENOID]
  32. - 3 * art -> art [(int) kArt_muscle::LATERAL_CRICOARYTENOID]); // 4.38
  33. t -> k1 = speaker -> lowerCord.k1 * (1 + art -> art [(int) kArt_muscle::CRICOTHYROID]);
  34. t -> k3 = t -> k1 * (20 / t -> Dz) * (20 / t -> Dz);
  35. }
  36. if (speaker -> cord.numberOfMasses >= 2) {
  37. Delta_Tube t = delta -> tube + 37;
  38. t -> Dyeq = delta -> tube [36]. Dyeq;
  39. t -> k1 = speaker -> upperCord.k1 * (1 + art -> art [(int) kArt_muscle::CRICOTHYROID]);
  40. t -> k3 = t -> k1 * (20 / t -> Dz) * (20 / t -> Dz);
  41. }
  42. if (speaker -> cord.numberOfMasses >= 10) {
  43. delta -> tube [84]. Dyeq = 0.75 * 1 * f + 0.25 * delta -> tube [36]. Dyeq;
  44. delta -> tube [85]. Dyeq = 0.50 * 1 * f + 0.50 * delta -> tube [36]. Dyeq;
  45. delta -> tube [86]. Dyeq = 0.25 * 1 * f + 0.75 * delta -> tube [36]. Dyeq;
  46. delta -> tube [84]. k1 = 0.75 * 160 + 0.25 * delta -> tube [36]. k1;
  47. delta -> tube [85]. k1 = 0.50 * 160 + 0.50 * delta -> tube [36]. k1;
  48. delta -> tube [86]. k1 = 0.25 * 160 + 0.75 * delta -> tube [36]. k1;
  49. for (integer itube = 84; itube <= 86; itube ++)
  50. delta -> tube [itube]. k3 = delta -> tube [itube]. k1 *
  51. (20 / delta -> tube [itube]. Dz) * (20 / delta -> tube [itube]. Dz);
  52. }
  53. /* Vocal tract. */
  54. bool closed [40];
  55. Art_Speaker_meshVocalTract (art, speaker, xi, yi, xe, ye, xmm, ymm, closed);
  56. for (integer itube = 38; itube <= 64; itube ++) {
  57. Delta_Tube t = delta -> tube + itube;
  58. integer i = itube - 37;
  59. double dx = xmm [i] - xmm [i + 1];
  60. double dy = ymm [i] - ymm [i + 1];
  61. t -> Dxeq = sqrt (dx * dx + dy * dy);
  62. dx = xe [i] - xi [i];
  63. dy = ye [i] - yi [i];
  64. t -> Dyeq = sqrt (dx * dx + dy * dy);
  65. if (closed [i]) t -> Dyeq = - t -> Dyeq;
  66. }
  67. delta -> tube [65]. Dxeq = delta -> tube [51]. Dxeq = delta -> tube [50]. Dxeq;
  68. /* Voor [r]: thy tube [60]. Brel = 0.1; thy tube [60]. k1 = 3; */
  69. /* Nasopharyngeal port. */
  70. delta -> tube [65]. Dyeq = f * (18 - 25 * art -> art [(int) kArt_muscle::LEVATOR_PALATINI]); // 4.40
  71. for (integer itube = 1; itube <= delta -> numberOfTubes; itube ++) {
  72. Delta_Tube t = delta -> tube + itube;
  73. t -> s1 = 5e6 * t -> Dxeq * t -> Dzeq;
  74. t -> s3 = t -> s1 / (0.9e-3 * 0.9e-3);
  75. }
  76. }
  77. /* End of file Art_Speaker_Delta.cpp */