praat_LPC_init.cpp 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168
  1. /* praat_LPC_init.cpp
  2. *
  3. * Copyright (C) 1994-2016 David Weenink
  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. See the GNU
  13. * 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. /*
  19. djmw 20030613 Latest modification
  20. djmw 20040414 Forms texts.
  21. djmw 20060428 Latest modification
  22. djmw 20061218 Changed to Melder_information<x> format.
  23. djmw 20070902 Melder_error<1...>
  24. djmw 20071011 REQUIRE requires L"".
  25. djmw 20080313 Cepstrum_formula
  26. djmw 20100212 Analysis window length is now "Window length"
  27. */
  28. #include <math.h>
  29. #include "Cepstrumc.h"
  30. #include "Cepstrogram.h"
  31. #include "Cepstrum_and_Spectrum.h"
  32. #include "DTW.h"
  33. #include "FilterBank.h"
  34. #include "Formant_extensions.h"
  35. #include "LPC.h"
  36. #include "MFCC.h"
  37. #include "LFCC.h"
  38. #include "LPC_and_Cepstrumc.h"
  39. #include "LPC_and_Formant.h"
  40. #include "LPC_and_LFCC.h"
  41. #include "LPC_and_LineSpectralFrequencies.h"
  42. #include "LPC_and_Polynomial.h"
  43. #include "LPC_and_Tube.h"
  44. #include "LPC_to_Spectrogram.h"
  45. #include "LPC_to_Spectrum.h"
  46. #include "NUM2.h"
  47. #include "Sound_and_LPC.h"
  48. #include "Sound_and_LPC_robust.h"
  49. #include "Sound_and_Cepstrum.h"
  50. #include "Sound_to_MFCC.h"
  51. #include "VocalTractTier.h"
  52. #include "praat_TimeFunction.h"
  53. #include "praat_Matrix.h"
  54. #define praat_Quefrency_RANGE(fromQuefrency,toQuefrency) \
  55. REAL (fromQuefrency, U"left Quefrency range (s)", U"0.0") \
  56. REAL (toQuefrency, U"right Quefrency range (s)", U"0.0 (= all)")
  57. static const conststring32 DRAW_BUTTON = U"Draw -";
  58. static const conststring32 QUERY_BUTTON = U"Query -";
  59. static const conststring32 MODIFY_BUTTON = U"Modify -";
  60. void praat_CC_init (ClassInfo klas);
  61. void praat_TimeFrameSampled_query_init (ClassInfo klas);
  62. /********************** Cepstrum ****************************************/
  63. DIRECT (NEW_Cepstrum_downto_PowerCepstrum) {
  64. CONVERT_EACH (Cepstrum)
  65. autoPowerCepstrum result = Cepstrum_downto_PowerCepstrum (me);
  66. CONVERT_EACH_END (my name.get())
  67. }
  68. DIRECT (HELP_PowerCepstrum_help) {
  69. HELP (U"PowerCepstrum")
  70. }
  71. FORM (GRAPHICS_Cepstrum_drawLinear, U"Cepstrum: Draw linear", U"Cepstrum: Draw (linear)...") {
  72. praat_Quefrency_RANGE(fromQuefrency,toQuefrency)
  73. REAL (ymin, U"Minimum", U"0.0")
  74. REAL (ymax, U"Maximum", U"0.0")
  75. BOOLEAN (garnish, U"Garnish", true)
  76. OK
  77. DO
  78. GRAPHICS_EACH (Cepstrum)
  79. Cepstrum_drawLinear (me, GRAPHICS, fromQuefrency, toQuefrency, ymin, ymax, garnish);
  80. GRAPHICS_EACH_END
  81. }
  82. FORM (GRAPHICS_PowerCepstrum_draw, U"PowerCepstrum: Draw", U"PowerCepstrum: Draw...") {
  83. praat_Quefrency_RANGE(fromQuefrency,toQuefrency)
  84. REAL (ymin, U"Minimum (dB)", U"0.0")
  85. REAL (ymax, U"Maximum (dB)", U"0.0")
  86. BOOLEAN (garnish, U"Garnish", true)
  87. OK
  88. DO
  89. GRAPHICS_EACH (PowerCepstrum)
  90. PowerCepstrum_draw (me, GRAPHICS, fromQuefrency, toQuefrency, ymin, ymax, garnish);
  91. GRAPHICS_EACH_END
  92. }
  93. FORM (GRAPHICS_PowerCepstrum_drawTiltLine, U"PowerCepstrum: Draw tilt line", U"PowerCepstrum: Draw tilt line...") {
  94. praat_Quefrency_RANGE(fromQuefrency,toQuefrency)
  95. REAL (fromAmplitude_dB, U"left Amplitude range (dB)", U"0.0")
  96. REAL (toAmplitude_dB, U"right Amplitude range (dB)", U"0.0")
  97. LABEL (U"Parameters for the tilt line fit")
  98. REAL (fromQuefrency_tiltLine, U"left Tilt line quefrency range (s)", U"0.001")
  99. REAL (toQuefrency_tiltLine, U"right Tilt line quefrency range (s)", U"0.0 (= end)")
  100. OPTIONMENU (lineType, U"Line type", 1)
  101. OPTION (U"Straight")
  102. OPTION (U"Exponential decay")
  103. OPTIONMENU (fitMethod, U"Fit method", 2)
  104. OPTION (U"Least squares")
  105. OPTION (U"Robust")
  106. OK
  107. DO
  108. GRAPHICS_EACH (PowerCepstrum)
  109. PowerCepstrum_drawTiltLine (me, GRAPHICS, fromQuefrency, toQuefrency,fromAmplitude_dB,toAmplitude_dB, fromQuefrency_tiltLine, toQuefrency_tiltLine, lineType, fitMethod);
  110. GRAPHICS_EACH_END
  111. }
  112. FORM (MODIFY_PowerCepstrum_formula, U"PowerCepstrum: Formula...", U"PowerCepstrum: Formula...") {
  113. LABEL (U"y := y1; for row := 1 to nrow do { x := x1; "
  114. "for col := 1 to ncol do { self [row, col] := `formula' ; x := x + dx } y := y + dy }")
  115. TEXTFIELD (formula, U"Formula:", U"self")
  116. OK
  117. DO
  118. MODIFY_EACH (PowerCepstrum)
  119. Matrix_formula (me, formula, interpreter, nullptr);
  120. MODIFY_EACH_END
  121. }
  122. FORM (REAL_PowerCepstrum_getPeak, U"PowerCepstrum: Get peak", nullptr) {
  123. REAL (fromPitch, U"left Search peak in pitch range (Hz)", U"60.0")
  124. REAL (toPitch, U"right Search peak in pitch range (Hz)", U"333.3")
  125. RADIO (interpolationMethod, U"Interpolation", 2)
  126. RADIOBUTTON (U"None")
  127. RADIOBUTTON (U"Parabolic")
  128. RADIOBUTTON (U"Cubic")
  129. RADIOBUTTON (U"Sinc70")
  130. OK
  131. DO
  132. NUMBER_ONE (PowerCepstrum)
  133. double result;
  134. PowerCepstrum_getMaximumAndQuefrency (me, fromPitch, toPitch, interpolationMethod - 1, & result, nullptr);
  135. NUMBER_ONE_END (U" dB")
  136. }
  137. FORM (REAL_PowerCepstrum_getQuefrencyOfPeak, U"PowerCepstrum: Get quefrency of peak", nullptr) {
  138. REAL (fromPitch, U"left Search peak in pitch range (Hz)", U"60.0")
  139. REAL (toPitch, U"right Search peak in pitch range (Hz)", U"333.3")
  140. RADIO (interpolationMethod, U"Interpolation", 2)
  141. RADIOBUTTON (U"None")
  142. RADIOBUTTON (U"Parabolic")
  143. RADIOBUTTON (U"Cubic")
  144. RADIOBUTTON (U"Sinc70")
  145. OK
  146. DO
  147. NUMBER_ONE (PowerCepstrum)
  148. double result, quefrency;
  149. PowerCepstrum_getMaximumAndQuefrency (me, fromPitch, toPitch, interpolationMethod - 1, & quefrency, & result);
  150. double f = 1.0 / quefrency;
  151. NUMBER_ONE_END (U" s (f =", f, U" Hz)")
  152. }
  153. FORM (REAL_PowerCepstrum_getRNR, U"PowerCepstrum: Get rhamonics to noise ration", nullptr) {
  154. REAL (fromPitch, U"left Pitch range (Hz)", U"60.0")
  155. REAL (toPitch, U"right Pitch range (Hz)", U"333.3")
  156. POSITIVE (fractionalWIdth, U"Fractional width (0-1)", U"0.05")
  157. OK
  158. DO
  159. NUMBER_ONE (PowerCepstrum)
  160. double result = PowerCepstrum_getRNR (me, fromPitch, toPitch, fractionalWIdth);
  161. NUMBER_ONE_END (U" (rnr)")
  162. }
  163. FORM (REAL_PowerCepstrum_getPeakProminence_hillenbrand, U"PowerCepstrum: Get peak prominence (hillenbrand)", U"PowerCepstrum: Get peak prominence (hillenbrand)...") {
  164. REAL (fromPitch, U"left Search peak in pitch range (Hz)", U"60.0")
  165. REAL (toPitch, U"right Search peak in pitch range (Hz)", U"333.3")
  166. OK
  167. DO
  168. NUMBER_ONE (PowerCepstrum)
  169. double qpeak, result = PowerCepstrum_getPeakProminence_hillenbrand (me, fromPitch, toPitch, & qpeak);
  170. NUMBER_ONE_END (U" dB; quefrency=", qpeak, U" s (f=", 1.0 / qpeak, U" Hz).")
  171. }
  172. FORM (REAL_PowerCepstrum_getTiltLineSlope, U"PowerCepstrum: Get tilt line slope", nullptr) {
  173. REAL (fromQuefrency_tiltLine, U"left Tilt line quefrency range (s)", U"0.001")
  174. REAL (toQuefrency_tiltLine, U"right Tilt line quefrency range (s)", U"0.0 (= end)")
  175. OPTIONMENU (lineType, U"Line type", 1)
  176. OPTION (U"Straight")
  177. OPTION (U"Exponential decay")
  178. OPTIONMENU (fitMethod, U"Fit method", 2)
  179. OPTION (U"Least squares")
  180. OPTION (U"Robust")
  181. OK
  182. DO
  183. NUMBER_ONE (PowerCepstrum)
  184. double result;
  185. PowerCepstrum_fitTiltLine (me, fromQuefrency_tiltLine, toQuefrency_tiltLine, & result, nullptr, lineType, fitMethod);
  186. NUMBER_ONE_END (U" dB / ", lineType == 1 ? U"s" : U"ln (s)");
  187. }
  188. FORM (REAL_PowerCepstrum_getTiltLineIntercept, U"PowerCepstrum: Get tilt line intercept", nullptr) {
  189. REAL (fromQuefrency_tiltLine, U"left Tilt line quefrency range (s)", U"0.001")
  190. REAL (toQuefrency_tiltLine, U"right Tilt line quefrency range (s)", U"0.0 (= end)")
  191. OPTIONMENU (lineType, U"Line type", 1)
  192. OPTION (U"Straight")
  193. OPTION (U"Exponential decay")
  194. OPTIONMENU (fitMethod, U"Fit method", 2)
  195. OPTION (U"Least squares")
  196. OPTION (U"Robust")
  197. OK
  198. DO
  199. NUMBER_ONE (PowerCepstrum)
  200. double result;
  201. PowerCepstrum_fitTiltLine (me, fromQuefrency_tiltLine, toQuefrency_tiltLine, nullptr, & result, lineType, fitMethod);
  202. NUMBER_ONE_END (U" dB")
  203. }
  204. FORM (REAL_PowerCepstrum_getPeakProminence, U"PowerCepstrum: Get peak prominence", U"PowerCepstrum: Get peak prominence...") {
  205. REAL (fromPitch, U"left Search peak in pitch range (Hz)", U"60.0")
  206. REAL (toPitch, U"right Search peak in pitch range (Hz)", U"333.3")
  207. RADIO (interpolationMethod, U"Interpolation", 2)
  208. RADIOBUTTON (U"None")
  209. RADIOBUTTON (U"Parabolic")
  210. RADIOBUTTON (U"Cubic")
  211. RADIOBUTTON (U"Sinc70")
  212. REAL (fromQuefrency_tiltLine, U"left Tilt line quefrency range (s)", U"0.001")
  213. REAL (toQuefrency_tiltLine, U"right Tilt line quefrency range (s)", U"0.0 (= end)")
  214. OPTIONMENU (lineType, U"Line type", 1)
  215. OPTION (U"Straight")
  216. OPTION (U"Exponential decay")
  217. OPTIONMENU (fitMethod, U"Fit method", 2)
  218. OPTION (U"Least squares")
  219. OPTION (U"Robust")
  220. OK
  221. DO
  222. NUMBER_ONE (PowerCepstrum)
  223. double qpeak, result = PowerCepstrum_getPeakProminence (me, fromPitch, toPitch, interpolationMethod - 1, fromQuefrency_tiltLine, toQuefrency_tiltLine, lineType, fitMethod, & qpeak);
  224. NUMBER_ONE_END (U" dB; quefrency=", qpeak, U" s (f=", 1.0 / qpeak, U" Hz).");
  225. }
  226. FORM (MODIFY_PowerCepstrum_subtractTilt_inplace, U"PowerCepstrum: Subtract tilt (in-place)", nullptr) {
  227. REAL (fromQuefrency_tiltLine, U"left Tilt line quefrency range (s)", U"0.001")
  228. REAL (toQuefrency_tiltLine, U"right Tilt line quefrency range (s)", U"0.0 (= end)")
  229. OPTIONMENU (lineType, U"Line type", 1)
  230. OPTION (U"Straight")
  231. OPTION (U"Exponential decay")
  232. OPTIONMENU (fitMethod, U"Fit method", 2)
  233. OPTION (U"Least squares")
  234. OPTION (U"Robust")
  235. OK
  236. DO
  237. MODIFY_EACH (PowerCepstrum)
  238. PowerCepstrum_subtractTilt_inplace (me, fromQuefrency_tiltLine, toQuefrency_tiltLine, lineType, fitMethod);
  239. MODIFY_EACH_END
  240. }
  241. FORM (MODIFY_PowerCepstrum_smooth_inplace, U"PowerCepstrum: Smooth (in-place)", nullptr) {
  242. REAL (quefrencySmoothingWindowDuration, U"Quefrency averaging window (s)", U"0.0005")
  243. NATURAL (numberOfIterations, U"Number of iterations", U"1");
  244. OK
  245. DO
  246. MODIFY_EACH (PowerCepstrum)
  247. PowerCepstrum_smooth_inplace (me, quefrencySmoothingWindowDuration, numberOfIterations);
  248. MODIFY_EACH_END
  249. }
  250. FORM (NEW_PowerCepstrum_smooth, U"PowerCepstrum: Smooth", nullptr) {
  251. REAL (quefrencySmoothingWindowDuration, U"Quefrency averaging window (s)", U"0.0005")
  252. NATURAL (numberOfIterations, U"Number of iterations", U"1");
  253. OK
  254. DO
  255. CONVERT_EACH (PowerCepstrum)
  256. autoPowerCepstrum result = PowerCepstrum_smooth (me, quefrencySmoothingWindowDuration, numberOfIterations);
  257. CONVERT_EACH_END (my name.get(), U"_smooth")
  258. }
  259. FORM (NEW_PowerCepstrum_subtractTilt, U"PowerCepstrum: Subtract tilt", nullptr) {
  260. REAL (fromQuefrency_tiltLine, U"left Tilt line quefrency range (s)", U"0.001")
  261. REAL (toQuefrency_tiltLine, U"right Tilt line quefrency range (s)", U"0.0 (= end)")
  262. OPTIONMENU (lineType, U"Line type", 1)
  263. OPTION (U"Straight")
  264. OPTION (U"Exponential decay")
  265. OPTIONMENU (fitMethod, U"Fit method", 2)
  266. OPTION (U"Least squares")
  267. OPTION (U"Robust")
  268. OK
  269. DO
  270. CONVERT_EACH (PowerCepstrum)
  271. autoPowerCepstrum result = PowerCepstrum_subtractTilt (me, fromQuefrency_tiltLine, toQuefrency_tiltLine, lineType, fitMethod);
  272. CONVERT_EACH_END (my name.get(), U"_minusTilt")
  273. }
  274. DIRECT (NEW_Cepstrum_to_Spectrum) {
  275. CONVERT_EACH (Cepstrum)
  276. autoSpectrum result = Cepstrum_to_Spectrum (me);
  277. CONVERT_EACH_END (my name.get())
  278. }
  279. DIRECT (NEW_PowerCepstrum_to_Matrix) {
  280. CONVERT_EACH (PowerCepstrum)
  281. autoMatrix result = PowerCepstrum_to_Matrix (me);
  282. CONVERT_EACH_END (my name.get())
  283. }
  284. /********************** Cepstrogram ****************************************/
  285. DIRECT (HELP_PowerCepstrogram_help) {
  286. HELP (U"PowerCepstrogram")
  287. }
  288. FORM (GRAPHICS_old_PowerCepstrogram_paint, U"PowerCepstrogram: Paint", nullptr) {
  289. praat_TimeFunction_RANGE(fromTime,toTime)
  290. praat_Quefrency_RANGE(fromQuefrency,toQuefrency)
  291. REAL (minimum_dB, U"Minimum (dB)", U"0.0")
  292. REAL (maximum_dB, U"Maximum (dB)", U"0.0")
  293. BOOLEAN (garnish, U"Garnish", true);
  294. OK
  295. DO
  296. GRAPHICS_EACH (PowerCepstrogram)
  297. PowerCepstrogram_paint (me, GRAPHICS, fromTime, toTime, fromQuefrency, toQuefrency, maximum_dB, false, maximum_dB - minimum_dB, 0.0, garnish);
  298. GRAPHICS_EACH_END
  299. }
  300. FORM (GRAPHICS_PowerCepstrogram_paint, U"PowerCepstrogram: Paint", U"PowerCepstrogram: Paint...") {
  301. praat_TimeFunction_RANGE(fromTime,toTime)
  302. praat_Quefrency_RANGE(fromQuefrency,toQuefrency)
  303. REAL (maximum_dB, U"Maximum (dB)", U"80.0")
  304. BOOLEAN (autoscaling, U"Autoscaling", false);
  305. REAL (dynamicRange_dB, U"Dynamic range (dB)", U"30.0");
  306. REAL (compression, U"Dynamic compression (0-1)", U"0.0");
  307. BOOLEAN (garnish, U"Garnish", true);
  308. OK
  309. DO_ALTERNATIVE (GRAPHICS_old_PowerCepstrogram_paint)
  310. GRAPHICS_EACH (PowerCepstrogram)
  311. PowerCepstrogram_paint (me, GRAPHICS, fromTime, toTime, fromQuefrency, toQuefrency, maximum_dB, autoscaling, dynamicRange_dB, compression, garnish);
  312. GRAPHICS_EACH_END
  313. }
  314. FORM (NEW_PowerCepstrogram_smooth, U"PowerCepstrogram: Smooth", U"PowerCepstrogram: Smooth...") {
  315. REAL (smoothingWindowDuration, U"Time averaging window (s)", U"0.02")
  316. REAL (quefrencySmoothingWindowDuration, U"Quefrency averaging window (s)", U"0.0005")
  317. OK
  318. DO
  319. CONVERT_EACH (PowerCepstrogram)
  320. autoPowerCepstrogram result = PowerCepstrogram_smooth (me, smoothingWindowDuration, quefrencySmoothingWindowDuration);
  321. CONVERT_EACH_END (my name.get(), U"_smoothed")
  322. }
  323. DIRECT (REAL_PowerCepstrogram_getStartQuefrency) {
  324. NUMBER_ONE (PowerCepstrogram)
  325. double result = my ymin;
  326. NUMBER_ONE_END (U" (s)")
  327. }
  328. DIRECT (REAL_PowerCepstrogram_getEndQuefrency) {
  329. NUMBER_ONE (PowerCepstrogram)
  330. double result = my ymax;
  331. NUMBER_ONE_END (U" (s)")
  332. }
  333. DIRECT (INTEGER_PowerCepstrogram_getNumberOfQuefrencyBins) {
  334. INTEGER_ONE (PowerCepstrogram)
  335. integer result = my ny;
  336. INTEGER_ONE_END (U" quefrency bins")
  337. }
  338. DIRECT (REAL_PowerCepstrogram_getQuefrencyStep) {
  339. NUMBER_ONE (PowerCepstrogram)
  340. double result = my dy;
  341. NUMBER_ONE_END (U" s (quefrency step)")
  342. }
  343. FORM (NEW_PowerCepstrogram_subtractTilt, U"PowerCepstrogram: Subtract tilt", nullptr) {
  344. REAL (fromQuefrency_tiltLine, U"left Tilt line quefrency range (s)", U"0.001")
  345. REAL (toQuefrency_tiltLine, U"right Tilt line quefrency range (s)", U"0.0 (= end)")
  346. OPTIONMENU (lineType, U"Line type", 2)
  347. OPTION (U"Straight")
  348. OPTION (U"Exponential decay")
  349. OPTIONMENU (fitMethod, U"Fit method", 2)
  350. OPTION (U"Least squares")
  351. OPTION (U"Robust")
  352. OK
  353. DO
  354. CONVERT_EACH (PowerCepstrogram)
  355. autoPowerCepstrogram result = PowerCepstrogram_subtractTilt (me, fromQuefrency_tiltLine, toQuefrency_tiltLine, lineType, fitMethod);
  356. CONVERT_EACH_END (my name.get(), U"_minusTilt")
  357. }
  358. FORM (MODIFY_PowerCepstrogram_subtractTilt_inplace, U"PowerCepstrogram: Subtract tilt (in-place)", nullptr) {
  359. REAL (fromQuefrency_tiltLine, U"left Tilt line quefrency range (s)", U"0.001")
  360. REAL (toQuefrency_tiltLine, U"right Tilt line quefrency range (s)", U"0.0 (= end)")
  361. OPTIONMENU (lineType, U"Line type", 2)
  362. OPTION (U"Straight")
  363. OPTION (U"Exponential decay")
  364. OPTIONMENU (fitMethod, U"Fit method", 2)
  365. OPTION (U"Least squares")
  366. OPTION (U"Robust")
  367. OK
  368. DO
  369. MODIFY_EACH (PowerCepstrogram)
  370. PowerCepstrogram_subtractTilt_inplace (me, fromQuefrency_tiltLine, toQuefrency_tiltLine, lineType, fitMethod);
  371. MODIFY_EACH_END
  372. }
  373. FORM (REAL_PowerCepstrogram_getCPPS_hillenbrand, U"PowerCepstrogram: Get CPPS", nullptr) {
  374. LABEL (U"Smoothing:")
  375. BOOLEAN (subtractTiltBeforeSmoothing, U"Subtract tilt before smoothing", true)
  376. REAL (smoothinWindowDuration, U"Time averaging window (s)", U"0.001")
  377. REAL (quefrencySmoothinWindowDuration, U"Quefrency averaging window (s)", U"0.00005")
  378. LABEL (U"Peak search:")
  379. REAL (fromPitch, U"left Peak search pitch range (Hz)", U"60.0")
  380. REAL (toPitch, U"right Peak search pitch range (Hz)", U"330.0")
  381. OK
  382. DO
  383. NUMBER_ONE (PowerCepstrogram)
  384. double result = PowerCepstrogram_getCPPS_hillenbrand (me, subtractTiltBeforeSmoothing, smoothinWindowDuration, quefrencySmoothinWindowDuration, fromPitch, toPitch);
  385. NUMBER_ONE_END (U" dB")
  386. }
  387. FORM (REAL_PowerCepstrogram_getCPPS, U"PowerCepstrogram: Get CPPS", nullptr) {
  388. LABEL (U"Smoothing:")
  389. BOOLEAN (subtractTiltBeforeSmoothing, U"Subtract tilt before smoothing", true)
  390. REAL (smoothingWindowDuration, U"Time averaging window (s)", U"0.02")
  391. REAL (quefrencySmoothingWindowDuration, U"Quefrency averaging window (s)", U"0.0005")
  392. LABEL (U"Peak search:")
  393. REAL (fromPitch, U"left Peak search pitch range (Hz)", U"60.0")
  394. REAL (toPitch, U"right Peak search pitch range (Hz)", U"330.0")
  395. POSITIVE (tolerance, U"Tolerance (0-1)", U"0.05")
  396. RADIO (interpolationMethod, U"Interpolation", 2)
  397. RADIOBUTTON (U"None")
  398. RADIOBUTTON (U"Parabolic")
  399. RADIOBUTTON (U"Cubic")
  400. RADIOBUTTON (U"Sinc70")
  401. LABEL (U"Tilt line:")
  402. REAL (fromQuefrency_tiltLine, U"left Tilt line quefrency range (s)", U"0.001")
  403. REAL (toQuefrency_tiltLine, U"right Tilt line quefrency range (s)", U"0.0 (= end)")
  404. OPTIONMENU (lineType, U"Line type", 2)
  405. OPTION (U"Straight")
  406. OPTION (U"Exponential decay")
  407. OPTIONMENU (fitMethod, U"Fit method", 2)
  408. OPTION (U"Least squares")
  409. OPTION (U"Robust")
  410. OK
  411. DO
  412. NUMBER_ONE (PowerCepstrogram)
  413. double result = PowerCepstrogram_getCPPS (me, subtractTiltBeforeSmoothing, smoothingWindowDuration, quefrencySmoothingWindowDuration, fromPitch, toPitch, tolerance, interpolationMethod - 1, fromQuefrency_tiltLine, toQuefrency_tiltLine, lineType, fitMethod);
  414. NUMBER_ONE_END (U" dB");
  415. }
  416. FORM (MODIFY_PowerCepstrogram_formula, U"PowerCepstrogram: Formula", nullptr) {
  417. LABEL (U"Do for all times and quefrencies:")
  418. LABEL (U" `x` is the time in seconds")
  419. LABEL (U" `y` is the quefrency in seconds")
  420. LABEL (U" `self` is the current value")
  421. TEXTFIELD (formula, U" Replace all values with:", U"sqrt(self)")
  422. OK
  423. DO
  424. MODIFY_EACH_WEAK (PowerCepstrogram)
  425. Matrix_formula (me, formula, interpreter, nullptr);
  426. MODIFY_EACH_WEAK_END
  427. }
  428. FORM (NEW_PowerCepstrogram_to_PowerCepstrum_slice, U"PowerCepstrogram: To PowerCepstrum (slice)", nullptr) {
  429. REAL (time, U"Time (s)", U"0.1")
  430. OK
  431. DO
  432. CONVERT_EACH (PowerCepstrogram)
  433. autoPowerCepstrum result = PowerCepstrogram_to_PowerCepstrum_slice (me, time);
  434. CONVERT_EACH_END (my name.get(), NUMstring_timeNoDot (time));
  435. }
  436. FORM (NEW_PowerCepstrogram_to_Table_cpp, U"PowerCepstrogram: To Table (peak prominence)", U"PowerCepstrogram: To Table (peak prominence)...") {
  437. REAL (fromPitch, U"left Peak search pitch range (Hz)", U"60.0")
  438. REAL (toPitch, U"right Peak search pitch range (Hz)", U"330.0")
  439. POSITIVE (tolerance, U"Tolerance (0-1)", U"0.05")
  440. RADIO (interpolationMethod, U"Interpolation", 2)
  441. RADIOBUTTON (U"None")
  442. RADIOBUTTON (U"Parabolic")
  443. RADIOBUTTON (U"Cubic")
  444. RADIOBUTTON (U"Sinc70")
  445. REAL (fromQuefrency_tiltLine, U"left Tilt line quefrency range (s)", U"0.001")
  446. REAL (toQuefrency_tiltLine, U"right Tilt line quefrency range (s)", U"0.0 (= end)")
  447. OPTIONMENU (lineType, U"Line type", 2)
  448. OPTION (U"Straight")
  449. OPTION (U"Exponential decay")
  450. OPTIONMENU (fitMethod, U"Fit method", 2)
  451. OPTION (U"Least squares")
  452. OPTION (U"Robust")
  453. OK
  454. DO
  455. CONVERT_EACH (PowerCepstrogram)
  456. autoTable result = PowerCepstrogram_to_Table_cpp (me, fromPitch, toPitch, tolerance, interpolationMethod - 1, fromQuefrency_tiltLine, toQuefrency_tiltLine, lineType, fitMethod);
  457. CONVERT_EACH_END (my name.get(), U"_cpp");
  458. }
  459. FORM (NEW_PowerCepstrogram_to_Table_hillenbrand, U"PowerCepstrogram: To Table (hillenbrand)", U"PowerCepstrogram: To Table (peak prominence...") {
  460. REAL (fromPitch, U"left Peak search pitch range (Hz)", U"60.0")
  461. REAL (toPitch, U"right Peak search pitch range (Hz)", U"330.0")
  462. OK
  463. DO
  464. CONVERT_EACH (PowerCepstrogram)
  465. autoTable result = PowerCepstrogram_to_Table_hillenbrand (me,fromPitch, toPitch);
  466. CONVERT_EACH_END (my name.get(), U"_cpp")
  467. }
  468. DIRECT (NEW_PowerCepstrogram_to_Matrix) {
  469. CONVERT_EACH (PowerCepstrogram)
  470. autoMatrix result = PowerCepstrogram_to_Matrix (me);
  471. CONVERT_EACH_END (my name.get())
  472. }
  473. /********************** Cepstrumc ****************************************/
  474. DIRECT (NEW_Cepstrumc_to_LPC) {
  475. CONVERT_EACH (Cepstrumc)
  476. autoLPC result = Cepstrumc_to_LPC (me);
  477. CONVERT_EACH_END (my name.get())
  478. }
  479. FORM (NEW1_Cepstrumc_to_DTW, U"Cepstrumc: To DTW", U"Cepstrumc: To DTW...") {
  480. LABEL (U"Distance calculation between Cepstra")
  481. REAL (cepstralWeight, U"Cepstral weight", U"1.0")
  482. REAL (logEnergyWeight, U"Log energy weight", U"0.0")
  483. REAL (regressionWeight, U"Regression weight", U"0.0")
  484. REAL (regressionLogEnergyWeight, U"Regression weight log energy", U"0.0")
  485. REAL (windowDuration, U"Window for regression coefficients (seconds)", U"0.056")
  486. LABEL (U"Boundary conditions for time warp")
  487. BOOLEAN (matchBeginPositions, U"Match begin positions", false)
  488. BOOLEAN (matchEndPositions, U"Match end positions", false)
  489. RADIO (slopeConstraintType, U"Slope constraints", 1)
  490. RADIOBUTTON (U"no restriction")
  491. RADIOBUTTON (U"1/3 < slope < 3")
  492. RADIOBUTTON (U"1/2 < slope < 2")
  493. RADIOBUTTON (U"2/3 < slope < 3/2")
  494. OK
  495. DO
  496. CONVERT_COUPLE (Cepstrumc)
  497. autoDTW result = Cepstrumc_to_DTW (me, you, cepstralWeight, logEnergyWeight, regressionWeight, regressionLogEnergyWeight, windowDuration, matchBeginPositions, matchEndPositions, slopeConstraintType);
  498. CONVERT_COUPLE_END (my name.get(), U"_", your name.get())
  499. }
  500. DIRECT (NEW_Cepstrumc_to_Matrix) {
  501. CONVERT_EACH (Cepstrumc)
  502. autoMatrix result = Cepstrumc_to_Matrix (me);
  503. CONVERT_EACH_END (my name.get())
  504. }
  505. /******************** Formant ********************************************/
  506. FORM (NEW_Formant_to_LPC, U"Formant: To LPC", nullptr) {
  507. POSITIVE (samplingFrequency, U"Sampling frequency (Hz)", U"16000.0")
  508. OK
  509. DO
  510. CONVERT_EACH (Formant)
  511. autoLPC result = Formant_to_LPC (me, 1.0 / samplingFrequency);
  512. CONVERT_EACH_END (my name.get())
  513. }
  514. FORM (MODIFY_Formant_formula, U"Formant: Formula", nullptr) {
  515. praat_TimeFunction_RANGE(fromTime,toTime)
  516. NATURAL (fromFormant, U"left Formant range", U"1")
  517. NATURAL (toFormant, U"right Formant range", U"5")
  518. LABEL (U"Formant frequencies in odd numbered rows")
  519. LABEL (U"Formant bandwidths in even numbered rows")
  520. SENTENCE (formula, U"Formula", U"if row mod 2 = 1 and self[row,col]/self[row+1,col] < 5 then 0 else self fi")
  521. OK
  522. DO
  523. MODIFY_EACH_WEAK (Formant)
  524. Formant_formula (me, fromTime, toTime, fromFormant, toFormant, interpreter, formula);
  525. MODIFY_EACH_WEAK_END
  526. }
  527. /******************** Formant & Spectrogram ************************************/
  528. FORM (NEW1_Formant_Spectrogram_to_IntensityTier, U"Formant & Spectrogram: To IntensityTier", U"Formant & Spectrogram: To IntensityTier...") {
  529. NATURAL (formantNumber, U"Formant number", U"1")
  530. OK
  531. DO
  532. CONVERT_TWO (Formant, Spectrogram)
  533. autoIntensityTier result = Formant_Spectrogram_to_IntensityTier (me, you, formantNumber);
  534. CONVERT_TWO_END (my name.get(), U"_", formantNumber)
  535. }
  536. /********************LFCC ********************************************/
  537. DIRECT (HELP_LFCC_help) {
  538. HELP (U"LFCC")
  539. }
  540. FORM (NEW_LFCC_to_LPC, U"LFCC: To LPC", U"LFCC: To LPC...") {
  541. INTEGER (numberOfCoefficients, U"Number of coefficients", U"0")
  542. OK
  543. DO
  544. Melder_require (numberOfCoefficients >= 0, U"Number of coefficients should not be less than zero.");
  545. CONVERT_EACH (LFCC)
  546. autoLPC result = LFCC_to_LPC (me, numberOfCoefficients);
  547. CONVERT_EACH_END (my name.get());
  548. }
  549. /********************LineSpectralFrequencies ********************************************/
  550. DIRECT (HELP_LineSpectralFrequencies_help) {
  551. HELP (U"LineSpectralFrequencies")
  552. }
  553. FORM (GRAPHICS_LineSpectralFrequencies_drawFrequencies, U"LineSpectralFrequencies: Draw frequencies", nullptr) {
  554. praat_TimeFunction_RANGE(fromTime,toTime)
  555. REAL (fromFrequency, U"left Frequency range (Hz)", U"0.0")
  556. REAL (toFrequency, U"right Frequency range (Hz)", U"5000.0")
  557. BOOLEAN (garnish, U"Garnish", true)
  558. OK
  559. DO
  560. GRAPHICS_EACH (LineSpectralFrequencies)
  561. LineSpectralFrequencies_drawFrequencies (me, GRAPHICS, fromTime, toTime, fromFrequency, toFrequency, garnish);
  562. GRAPHICS_EACH_END
  563. }
  564. DIRECT (NEW_LineSpectralFrequencies_to_LPC) {
  565. CONVERT_EACH (LineSpectralFrequencies)
  566. autoLPC result = LineSpectralFrequencies_to_LPC (me);
  567. CONVERT_EACH_END (my name.get());
  568. }
  569. /********************LPC ********************************************/
  570. DIRECT (HELP_LPC_help) {
  571. HELP (U"LPC")
  572. }
  573. FORM (GRAPHICS_LPC_drawGain, U"LPC: Draw gain", U"LPC: Draw gain...") {
  574. praat_TimeFunction_RANGE(fromTime,toTime)
  575. REAL (minimumGain, U"Minimum gain", U"0.0")
  576. REAL (maximumGain, U"Maximum gain", U"0.0")
  577. BOOLEAN (garnish, U"Garnish", true)
  578. OK
  579. DO
  580. GRAPHICS_EACH (LPC)
  581. LPC_drawGain (me, GRAPHICS, fromTime, toTime, minimumGain, maximumGain, garnish);
  582. GRAPHICS_EACH_END
  583. }
  584. DIRECT (REAL_LPC_getSamplingInterval) {
  585. NUMBER_ONE (LPC)
  586. double result = my samplingPeriod;
  587. NUMBER_ONE_END (U" s");
  588. }
  589. FORM (INTEGER_LPC_getNumberOfCoefficients, U"LPC: Get number of coefficients", U"LPC: Get number of coefficients...") {
  590. NATURAL (frameNumber, U"Frame number", U"1")
  591. OK
  592. DO
  593. INTEGER_ONE (LPC)
  594. Melder_require (frameNumber <= my nx,
  595. U"Your frame number (", frameNumber, U") is too large. It should be between 1 and ", my nx, U".");
  596. integer result = my d_frames[frameNumber].nCoefficients;
  597. INTEGER_ONE_END (U" coefficients")
  598. }
  599. FORM (GRAPHICS_LPC_drawPoles, U"LPC: Draw poles", U"LPC: Draw poles...") {
  600. REAL (time, U"Time (seconds)", U"0.0")
  601. BOOLEAN (garnish, U"Garnish", true)
  602. OK
  603. DO
  604. GRAPHICS_EACH (LPC)
  605. LPC_drawPoles (me, GRAPHICS, time, garnish);
  606. GRAPHICS_EACH_END
  607. }
  608. DIRECT (NEW_LPC_to_Formant) {
  609. CONVERT_EACH (LPC)
  610. autoFormant result = LPC_to_Formant (me, 50.0);
  611. CONVERT_EACH_END (my name.get())
  612. }
  613. DIRECT (NEW_LPC_to_Formant_keep_all) {
  614. CONVERT_EACH (LPC)
  615. autoFormant result = LPC_to_Formant (me, 0.0);
  616. CONVERT_EACH_END (my name.get())
  617. }
  618. FORM (NEW_LPC_to_LFCC, U"LPC: To LFCC", U"LPC: To LFCC...") {
  619. INTEGER (numberOfCoefficients, U"Number of coefficients", U"0")
  620. OK
  621. DO
  622. Melder_require (numberOfCoefficients >= 0, U"The number of coefficients should not be less than zero.");
  623. CONVERT_EACH (LPC)
  624. autoLFCC result = LPC_to_LFCC (me, numberOfCoefficients);
  625. CONVERT_EACH_END (my name.get())
  626. }
  627. FORM (NEW_LPC_to_LineSpectralFrequencies, U"LPC: To LineSpectralFrequencies", nullptr) {
  628. REAL (gridSize, U"Grid size", U"0.0")
  629. OK
  630. DO
  631. CONVERT_EACH (LPC)
  632. autoLineSpectralFrequencies result = LPC_to_LineSpectralFrequencies (me, gridSize);
  633. CONVERT_EACH_END (my name.get())
  634. }
  635. FORM (NEW_LPC_to_Polynomial_slice, U"LPC: To Polynomial", U"LPC: To Polynomial (slice)...") {
  636. REAL (time, U"Time (s)", U"0.0")
  637. OK
  638. DO
  639. CONVERT_EACH (LPC)
  640. autoPolynomial result = LPC_to_Polynomial (me, time);
  641. CONVERT_EACH_END (my name.get(), NUMstring_timeNoDot (time))
  642. }
  643. FORM (NEW_LPC_to_Spectrum_slice, U"LPC: To Spectrum", U"LPC: To Spectrum (slice)...") {
  644. REAL (time, U"Time (seconds)", U"0.0")
  645. REAL (minimumFrequencyResolution, U"Minimum frequency resolution (Hz)", U"20.0")
  646. REAL (bandwidthReduction, U"Bandwidth reduction (Hz)", U"0.0")
  647. REAL (deemphasisFrequency, U"De-emphasis frequency (Hz)", U"50.0")
  648. OK
  649. DO
  650. CONVERT_EACH (LPC)
  651. autoSpectrum result = LPC_to_Spectrum (me, time, minimumFrequencyResolution, bandwidthReduction, deemphasisFrequency);
  652. CONVERT_EACH_END (my name.get(), NUMstring_timeNoDot (time))
  653. }
  654. FORM (NEW_LPC_to_Spectrogram, U"LPC: To Spectrogram", U"LPC: To Spectrogram...") {
  655. REAL (minimumFrequencyResolution, U"Minimum frequency resolution (Hz)", U"20.0")
  656. REAL (bandwidthReduction, U"Bandwidth reduction (Hz)", U"0.0")
  657. REAL (deemphasisFrequency, U"De-emphasis frequency (Hz)", U"50.0")
  658. OK
  659. DO
  660. CONVERT_EACH (LPC)
  661. autoSpectrogram result = LPC_to_Spectrogram (me, minimumFrequencyResolution, bandwidthReduction, deemphasisFrequency);
  662. CONVERT_EACH_END (my name.get())
  663. }
  664. FORM (NEW_LPC_to_VocalTract_slice_special, U"LPC: To VocalTract", U"LPC: To VocalTract (slice, special)...") {
  665. REAL (time, U"Time (s)", U"0.0")
  666. REAL (glottalDamping, U"Glottal damping", U"0.1")
  667. BOOLEAN (radiationDamping, U"Radiation damping", true)
  668. BOOLEAN (internalDamping, U"Internal damping", true)
  669. OK
  670. DO
  671. CONVERT_EACH (LPC)
  672. autoVocalTract result = LPC_to_VocalTract (me, time, glottalDamping, radiationDamping, internalDamping);
  673. CONVERT_EACH_END (my name.get(), NUMstring_timeNoDot (time))
  674. }
  675. FORM (NEW_LPC_to_VocalTract_slice, U"LPC: To VocalTract", U"LPC: To VocalTract (slice)...") {
  676. REAL (time, U"Time (s)", U"0.0")
  677. POSITIVE (lenght, U"Length (m)", U"0.17")
  678. OK
  679. DO
  680. CONVERT_EACH (LPC)
  681. autoVocalTract result = LPC_to_VocalTract (me, time, lenght);
  682. CONVERT_EACH_END (my name.get(), NUMstring_timeNoDot (time))
  683. }
  684. DIRECT (NEW_LPC_downto_Matrix_lpc) {
  685. CONVERT_EACH (LPC)
  686. autoMatrix result = LPC_downto_Matrix_lpc (me);
  687. CONVERT_EACH_END (my name.get(), U"_lpc")
  688. }
  689. DIRECT (NEW_LPC_downto_Matrix_rc) {
  690. CONVERT_EACH (LPC)
  691. autoMatrix result = LPC_downto_Matrix_rc (me);
  692. CONVERT_EACH_END (my name.get(), U"_rc");
  693. }
  694. DIRECT (NEW_LPC_downto_Matrix_area) {
  695. CONVERT_EACH (LPC)
  696. autoMatrix result = LPC_downto_Matrix_area (me);
  697. CONVERT_EACH_END (my name.get(), U"_area");
  698. }
  699. /********************** Sound *******************************************/
  700. FORM (NEW_Sound_to_PowerCepstrogram, U"Sound: To PowerCepstrogram", U"Sound: To PowerCepstrogram...") {
  701. POSITIVE (pitchFloor, U"Pitch floor (Hz)", U"60.0")
  702. POSITIVE (timeStep,U"Time step (s)", U"0.002")
  703. POSITIVE (maximumFrequency, U"Maximum frequency (Hz)", U"5000.0")
  704. POSITIVE (preEmphasisFrequency, U"Pre-emphasis from (Hz)", U"50")
  705. OK
  706. DO
  707. CONVERT_EACH (Sound)
  708. autoPowerCepstrogram result = Sound_to_PowerCepstrogram (me, pitchFloor, timeStep, maximumFrequency, preEmphasisFrequency);
  709. CONVERT_EACH_END (my name.get())
  710. }
  711. FORM (NEW_Sound_to_PowerCepstrogram_hillenbrand, U"Sound: To PowerCepstrogram (hillenbrand)", U"Sound: To PowerCepstrogram...") {
  712. POSITIVE (pitchFloor, U"Pitch floor (Hz)", U"60.0")
  713. POSITIVE (timeStep, U"Time step (s)", U"0.002")
  714. OK
  715. DO
  716. CONVERT_EACH (Sound)
  717. autoPowerCepstrogram result = Sound_to_PowerCepstrogram_hillenbrand (me, pitchFloor, timeStep);
  718. CONVERT_EACH_END (my name.get())
  719. }
  720. FORM (NEW_Sound_to_Formant_robust, U"Sound: To Formant (robust)", U"Sound: To Formant (robust)...") {
  721. REAL (timeStep, U"Time step (s)", U"0.0 (= auto)")
  722. POSITIVE (maximumNumberOfFormants, U"Max. number of formants", U"5.0")
  723. REAL (maximumFormantFrequency, U"Maximum formant (Hz)", U"5500.0 (= adult female)")
  724. POSITIVE (windowLength, U"Window length (s)", U"0.025")
  725. POSITIVE (preEmphasisFrequency, U"Pre-emphasis from (Hz)", U"50.0")
  726. POSITIVE (numberOfStandardDeviations, U"Number of std. dev.", U"1.5")
  727. NATURAL (maximumNumberOfIterations, U"Maximum number of iterations", U"5")
  728. REAL (tolerance, U"Tolerance", U"0.000001")
  729. OK
  730. DO
  731. CONVERT_EACH (Sound)
  732. autoFormant result = Sound_to_Formant_robust (me, timeStep, maximumNumberOfFormants, maximumFormantFrequency, windowLength, preEmphasisFrequency, 50.0, numberOfStandardDeviations, maximumNumberOfIterations, tolerance, 1);
  733. CONVERT_EACH_END (my name.get())
  734. }
  735. #define Sound_to_LPC_addWarning \
  736. LABEL (U"Warning 1: for formant analysis, use \"To Formant\" instead.") \
  737. LABEL (U"Warning 2: if you do use \"To LPC\", you may want to resample first.") \
  738. LABEL (U"Click Help for more details.") \
  739. LABEL (U"")
  740. FORM (NEW_Sound_to_LPC_autocorrelation, U"Sound: To LPC (autocorrelation)", U"Sound: To LPC (autocorrelation)...") {
  741. Sound_to_LPC_addWarning
  742. NATURAL (predictionOrder, U"Prediction order", U"16")
  743. POSITIVE (windowLength, U"Window length (s)", U"0.025")
  744. POSITIVE (timeStep, U"Time step (s)", U"0.005")
  745. REAL (preEmphasisFrequency, U"Pre-emphasis frequency (Hz)", U"50.0")
  746. OK
  747. DO
  748. preEmphasisFrequency = preEmphasisFrequency < 0.0 ? 0.0 : preEmphasisFrequency;
  749. CONVERT_EACH (Sound)
  750. autoLPC result = Sound_to_LPC_auto (me, predictionOrder, windowLength, timeStep, preEmphasisFrequency);
  751. CONVERT_EACH_END (my name.get())
  752. }
  753. FORM (NEW_Sound_to_LPC_covariance, U"Sound: To LPC (covariance)", U"Sound: To LPC (covariance)...") {
  754. Sound_to_LPC_addWarning
  755. NATURAL (predictionOrder, U"Prediction order", U"16")
  756. POSITIVE (windowLength, U"Window length (s)", U"0.025")
  757. POSITIVE (timeStep, U"Time step (s)", U"0.005")
  758. REAL (preEmphasisFrequency, U"Pre-emphasis frequency (Hz)", U"50.0")
  759. OK
  760. DO
  761. preEmphasisFrequency = preEmphasisFrequency < 0.0 ? 0.0 : preEmphasisFrequency;
  762. CONVERT_EACH (Sound)
  763. autoLPC result = Sound_to_LPC_covar (me, predictionOrder, windowLength, timeStep, preEmphasisFrequency);
  764. CONVERT_EACH_END (my name.get())
  765. }
  766. FORM (NEW_Sound_to_LPC_burg, U"Sound: To LPC (burg)", U"Sound: To LPC (burg)...") {
  767. Sound_to_LPC_addWarning
  768. NATURAL (predictionOrder, U"Prediction order", U"16")
  769. POSITIVE (windowLength, U"Window length (s)", U"0.025")
  770. POSITIVE (timeStep, U"Time step (s)", U"0.005")
  771. REAL (preEmphasisFrequency, U"Pre-emphasis frequency (Hz)", U"50.0")
  772. OK
  773. DO
  774. preEmphasisFrequency = preEmphasisFrequency < 0.0 ? 0.0 : preEmphasisFrequency;
  775. CONVERT_EACH (Sound)
  776. autoLPC result = Sound_to_LPC_burg (me, predictionOrder, windowLength, timeStep, preEmphasisFrequency);
  777. CONVERT_EACH_END (my name.get())
  778. }
  779. FORM (NEW_Sound_to_LPC_marple, U"Sound: To LPC (marple)", U"Sound: To LPC (marple)...") {
  780. Sound_to_LPC_addWarning
  781. NATURAL (predictionOrder, U"Prediction order", U"16")
  782. POSITIVE (windowLength, U"Window length (s)", U"0.025")
  783. POSITIVE (timeStep, U"Time step (s)", U"0.005")
  784. REAL (preEmphasisFrequency, U"Pre-emphasis frequency (Hz)", U"50.0")
  785. POSITIVE (tolerance1, U"Tolerance 1", U"1e-6")
  786. POSITIVE (tolerance2, U"Tolerance 2", U"1e-6")
  787. OK
  788. DO
  789. preEmphasisFrequency = preEmphasisFrequency < 0.0 ? 0.0 : preEmphasisFrequency;
  790. CONVERT_EACH (Sound)
  791. autoLPC result = Sound_to_LPC_marple (me, predictionOrder, windowLength, timeStep, preEmphasisFrequency, tolerance1, tolerance2);
  792. CONVERT_EACH_END (my name.get())
  793. }
  794. FORM (NEW_Sound_to_MFCC, U"Sound: To MFCC", U"Sound: To MFCC...") {
  795. NATURAL (numberOfCoefficients, U"Number of coefficients", U"12")
  796. POSITIVE (windowLength, U"Window length (s)", U"0.015")
  797. POSITIVE (timeStep, U"Time step (s)", U"0.005")
  798. LABEL (U"Filter bank parameters")
  799. POSITIVE (firstFilterFrequency, U"First filter frequency (mel)", U"100.0")
  800. POSITIVE (distancBetweenFilters, U"Distance between filters (mel)", U"100.0")
  801. REAL (maximumFrequency, U"Maximum frequency (mel)", U"0.0");
  802. OK
  803. DO
  804. Melder_require (numberOfCoefficients < 25, U"The number of coefficients should be less than 25.");
  805. CONVERT_EACH (Sound)
  806. autoMFCC result = Sound_to_MFCC (me, numberOfCoefficients, windowLength, timeStep, firstFilterFrequency, maximumFrequency, distancBetweenFilters);
  807. CONVERT_EACH_END (my name.get())
  808. }
  809. FORM (GRAPHICS_VocalTract_drawSegments, U"VocalTract: Draw segments", nullptr) {
  810. POSITIVE (maximumLength, U"Maximum length (cm)", U"20.0")
  811. POSITIVE (maximumArea, U"Maximum area (cm^2)", U"90.0")
  812. BOOLEAN (glottisClosed, U"Closed at glottis", true)
  813. OK
  814. DO
  815. GRAPHICS_EACH (VocalTract)
  816. VocalTract_drawSegments (me, GRAPHICS, maximumLength, maximumArea, glottisClosed);
  817. GRAPHICS_EACH_END
  818. }
  819. DIRECT (REAL_VocalTract_getLength) {
  820. NUMBER_ONE (VocalTract)
  821. double result = my xmax - my xmin;
  822. NUMBER_ONE_END (U" metres")
  823. }
  824. FORM (MODIFY_VocalTract_setLength, U"", nullptr) {
  825. POSITIVE (length, U"New length (m)", U"0.17")
  826. OK
  827. DO
  828. MODIFY_EACH (VocalTract)
  829. VocalTract_setLength (me, length);
  830. MODIFY_EACH_END
  831. }
  832. FORM (NEW_VocalTract_to_VocalTractTier, U"VocalTract: To VocalTractTier", nullptr) {
  833. REAL (fromTime, U"Tier start time (s)", U"0.0")
  834. REAL (toTime, U"Tier end time (s)", U"1.0")
  835. REAL (time, U"Insert at time (s)", U"0.5")
  836. OK
  837. DO
  838. Melder_require (fromTime < toTime, U"Your start time should be before your end time.");
  839. Melder_require (time >= fromTime && time <= toTime, U"Your insert time should be between your start and end times.");
  840. CONVERT_EACH (VocalTract)
  841. autoVocalTractTier result = VocalTract_to_VocalTractTier (me, fromTime, toTime, time);
  842. CONVERT_EACH_END (my name.get())
  843. }
  844. DIRECT (HELP_VocalTractTier_help) {
  845. HELP (U"VocalTractTier")
  846. }
  847. FORM (NEW_VocalTractTier_to_LPC, U"VocalTractTier: To LPC", nullptr) {
  848. POSITIVE (timeStep, U"Time step", U"0.005")
  849. OK
  850. DO
  851. CONVERT_EACH (VocalTractTier)
  852. autoLPC result = VocalTractTier_to_LPC (me, timeStep);
  853. CONVERT_EACH_END (my name.get())
  854. }
  855. FORM (NEW_VocalTractTier_to_VocalTract, U"", nullptr) {
  856. REAL (time, U"Time (s)", U"0.1")
  857. OK
  858. DO
  859. CONVERT_EACH (VocalTractTier)
  860. autoVocalTract result = VocalTractTier_to_VocalTract (me, time);
  861. CONVERT_EACH_END (my name.get())
  862. }
  863. FORM (MODIFY_VocalTractTier_addVocalTract, U"VocalTractTier: Add VocalTract", nullptr) {
  864. REAL (time, U"Time (s)", U"0.1")
  865. OK
  866. DO
  867. MODIFY_FIRST_OF_TWO (VocalTractTier, VocalTract)
  868. VocalTractTier_addVocalTract_copy (me, time, you);
  869. MODIFY_FIRST_OF_TWO_END
  870. }
  871. /******************* LPC & Sound *************************************/
  872. FORM (NEW1_LPC_Sound_filter, U"LPC & Sound: Filter", U"LPC & Sound: Filter...") {
  873. BOOLEAN (useGain, U"Use LPC gain", false)
  874. OK
  875. DO
  876. CONVERT_TWO (LPC, Sound)
  877. autoSound result = LPC_Sound_filter (me, you, useGain);
  878. CONVERT_TWO_END (my name.get())
  879. }
  880. FORM (NEW1_LPC_Sound_filterWithFilterAtTime, U"LPC & Sound: Filter with one filter at time", U"LPC & Sound: Filter with filter at time...") {
  881. OPTIONMENU (channel, U"Channel", 2)
  882. OPTION (U"Both")
  883. OPTION (U"Left")
  884. OPTION (U"Right")
  885. REAL (time, U"Use filter at time (s)", U"0.0")
  886. OK
  887. DO
  888. CONVERT_TWO (LPC, Sound)
  889. autoSound result = LPC_Sound_filterWithFilterAtTime (me, you, channel - 1, time);
  890. CONVERT_TWO_END (my name.get())
  891. }
  892. DIRECT (NEW1_LPC_Sound_filterInverse) {
  893. CONVERT_TWO (LPC, Sound)
  894. autoSound result = LPC_Sound_filterInverse (me, you);
  895. CONVERT_TWO_END (my name.get())
  896. }
  897. FORM (NEW1_LPC_Sound_filterInverseWithFilterAtTime, U"LPC & Sound: Filter (inverse) with filter at time",
  898. U"LPC & Sound: Filter (inverse) with filter at time...") {
  899. OPTIONMENU (channel, U"Channel", 2)
  900. OPTION (U"Both")
  901. OPTION (U"Left")
  902. OPTION (U"Right")
  903. REAL (time, U"Use filter at time (s)", U"0.0")
  904. OK
  905. DO
  906. CONVERT_TWO (LPC, Sound)
  907. autoSound result = LPC_Sound_filterInverseWithFilterAtTime (me, you, channel - 1, time);
  908. CONVERT_TWO_END (my name.get())
  909. }
  910. FORM (NEW1_LPC_Sound_to_LPC_robust, U"Robust LPC analysis", U"LPC & Sound: To LPC (robust)...") {
  911. POSITIVE (windowLength, U"Window length (s)", U"0.025")
  912. POSITIVE (preEmphasisFrequency, U"Pre-emphasis frequency (Hz)", U"50.0")
  913. POSITIVE (numberOfStandardDeviations, U"Number of std. dev.", U"1.5")
  914. NATURAL (maximumNumberOfIterations, U"Maximum number of iterations", U"5")
  915. REAL (tolerance, U"Tolerance", U"0.000001")
  916. BOOLEAN (locationVariable, U"Variable location", false)
  917. OK
  918. DO
  919. CONVERT_TWO (LPC, Sound)
  920. autoLPC result = LPC_Sound_to_LPC_robust (me, you, windowLength, preEmphasisFrequency, numberOfStandardDeviations, maximumNumberOfIterations, tolerance, locationVariable);
  921. CONVERT_TWO_END (my name.get(), U"_r");
  922. }
  923. extern void praat_TimeTier_query_init (ClassInfo klas);
  924. extern void praat_TimeTier_modify_init (ClassInfo klas);
  925. void praat_uvafon_LPC_init ();
  926. void praat_uvafon_LPC_init () {
  927. Thing_recognizeClassesByName (classCepstrumc, classPowerCepstrum, classCepstrogram, classPowerCepstrogram, classLPC, classLFCC, classLineSpectralFrequencies, classMFCC, classVocalTractTier, nullptr);
  928. praat_addAction1 (classPowerCepstrum, 0, U"PowerCepstrum help", 0, 0, HELP_PowerCepstrum_help);
  929. praat_addAction1 (classPowerCepstrum, 0, U"Draw...", 0, 0, GRAPHICS_PowerCepstrum_draw);
  930. praat_addAction1 (classPowerCepstrum, 0, U"Draw tilt line...", 0, 0, GRAPHICS_PowerCepstrum_drawTiltLine);
  931. praat_addAction1 (classCepstrum, 0, U"Draw (linear)...", 0, praat_HIDDEN, GRAPHICS_Cepstrum_drawLinear);
  932. praat_addAction1 (classCepstrum, 0, U"Down to PowerCepstrum", 0, 0, NEW_Cepstrum_downto_PowerCepstrum);
  933. praat_addAction1 (classPowerCepstrum, 1, U"Query -", 0, 0, 0);
  934. praat_addAction1 (classPowerCepstrum, 0, U"Get peak...", 0, 1, REAL_PowerCepstrum_getPeak);
  935. praat_addAction1 (classPowerCepstrum, 0, U"Get quefrency of peak...", 0, 1, REAL_PowerCepstrum_getQuefrencyOfPeak);
  936. praat_addAction1 (classPowerCepstrum, 0, U"Get peak prominence (hillenbrand)...", 0, praat_DEPTH_1 + praat_HIDDEN, REAL_PowerCepstrum_getPeakProminence_hillenbrand);
  937. praat_addAction1 (classPowerCepstrum, 0, U"Get peak prominence...", 0, 1, REAL_PowerCepstrum_getPeakProminence);
  938. praat_addAction1 (classPowerCepstrum, 0, U"Get tilt line slope...", 0, 1, REAL_PowerCepstrum_getTiltLineSlope);
  939. praat_addAction1 (classPowerCepstrum, 0, U"Get tilt line intercept...", 0, 1, REAL_PowerCepstrum_getTiltLineIntercept);
  940. praat_addAction1 (classPowerCepstrum, 0, U"Get rhamonics to noise ratio...", 0, 1, REAL_PowerCepstrum_getRNR);
  941. praat_addAction1 (classPowerCepstrum, 1, U"Modify -", 0, 0, 0);
  942. praat_addAction1 (classPowerCepstrum, 0, U"Formula...", 0, 1, MODIFY_PowerCepstrum_formula);
  943. praat_addAction1 (classPowerCepstrum, 0, U"Subtract tilt (in-place)...", 0, 1, MODIFY_PowerCepstrum_subtractTilt_inplace);
  944. praat_addAction1 (classPowerCepstrum, 0, U"Subtract tilt (in-line)...", 0, praat_DEPTH_1 + praat_DEPRECATED_2017, MODIFY_PowerCepstrum_subtractTilt_inplace);
  945. praat_addAction1 (classPowerCepstrum, 0, U"Smooth (in-place)...", 0, 1, MODIFY_PowerCepstrum_smooth_inplace);
  946. praat_addAction1 (classPowerCepstrum, 0, U"Smooth (in-line)...", 0, praat_DEPTH_1 + praat_DEPRECATED_2017, MODIFY_PowerCepstrum_smooth_inplace);
  947. praat_addAction1 (classPowerCepstrum, 0, U"Subtract tilt...", 0, 0, NEW_PowerCepstrum_subtractTilt);
  948. praat_addAction1 (classPowerCepstrum, 0, U"Smooth...", 0, 0, NEW_PowerCepstrum_smooth);
  949. praat_addAction1 (classCepstrum, 0, U"To Spectrum", 0, praat_HIDDEN, NEW_Cepstrum_to_Spectrum);
  950. praat_addAction1 (classPowerCepstrum, 0, U"To Matrix", 0, 0, NEW_PowerCepstrum_to_Matrix);
  951. praat_addAction1 (classPowerCepstrogram, 0, U"PowerCepstrogram help", 0, 0, HELP_PowerCepstrogram_help);
  952. praat_addAction1 (classPowerCepstrogram, 0, U"Paint...", 0, 0, GRAPHICS_PowerCepstrogram_paint);
  953. praat_addAction1 (classPowerCepstrogram, 1, U"Query -", 0, 0, 0);
  954. praat_TimeFrameSampled_query_init (classPowerCepstrogram);
  955. praat_addAction1 (classPowerCepstrogram, 1, U"Query quefrency domain", 0, 1, 0);
  956. praat_addAction1 (classPowerCepstrogram, 1, U"Get start quefrency", 0, 2, REAL_PowerCepstrogram_getStartQuefrency);
  957. praat_addAction1 (classPowerCepstrogram, 1, U"Get end quefrency", 0, 2, REAL_PowerCepstrogram_getEndQuefrency);
  958. praat_addAction1 (classPowerCepstrogram, 1, U"Query quefrency sampling", 0, 1, 0);
  959. praat_addAction1 (classPowerCepstrogram, 1, U"Get number of quefrency bins", 0, 2, INTEGER_PowerCepstrogram_getNumberOfQuefrencyBins);
  960. praat_addAction1 (classPowerCepstrogram, 1, U"Get quefrency step", 0, 2, REAL_PowerCepstrogram_getQuefrencyStep);
  961. praat_addAction1 (classPowerCepstrogram, 0, U"Get CPPS (hillenbrand)...", 0, praat_DEPTH_1 + praat_HIDDEN, REAL_PowerCepstrogram_getCPPS_hillenbrand);
  962. praat_addAction1 (classPowerCepstrogram, 0, U"Get CPPS...", 0, 1, REAL_PowerCepstrogram_getCPPS);
  963. praat_addAction1 (classPowerCepstrogram, 0, U"Modify -", nullptr, 0, nullptr);
  964. praat_TimeFunction_modify_init (classPowerCepstrogram);
  965. praat_addAction1 (classPowerCepstrogram, 0, U"Formula...", 0, 1, MODIFY_PowerCepstrogram_formula);
  966. praat_addAction1 (classPowerCepstrogram, 0, U"Subtract tilt (in-place)...", 0, 1, MODIFY_PowerCepstrogram_subtractTilt_inplace);
  967. praat_addAction1 (classPowerCepstrogram, 0, U"Subtract tilt (in-line)...", 0, praat_DEPTH_1 + praat_DEPRECATED_2017, MODIFY_PowerCepstrogram_subtractTilt_inplace);
  968. praat_addAction1 (classPowerCepstrogram, 0, U"To PowerCepstrum (slice)...", 0, 0, NEW_PowerCepstrogram_to_PowerCepstrum_slice);
  969. praat_addAction1 (classPowerCepstrogram, 0, U"Smooth...", 0, 0, NEW_PowerCepstrogram_smooth);
  970. praat_addAction1 (classPowerCepstrogram, 0, U"Subtract tilt...", 0, 0, NEW_PowerCepstrogram_subtractTilt);
  971. praat_addAction1 (classPowerCepstrogram, 0, U"To Table (hillenbrand)...", 0, praat_HIDDEN, NEW_PowerCepstrogram_to_Table_hillenbrand);
  972. praat_addAction1 (classPowerCepstrogram, 0, U"To Table (peak prominence)...", 0, praat_HIDDEN, NEW_PowerCepstrogram_to_Table_cpp);
  973. praat_addAction1 (classPowerCepstrogram, 0, U"To Matrix", 0, 0, NEW_PowerCepstrogram_to_Matrix);
  974. praat_addAction1 (classCepstrumc, 0, U"Analyse", 0, 0, 0);
  975. praat_addAction1 (classCepstrumc, 0, U"To LPC", 0, 0, NEW_Cepstrumc_to_LPC);
  976. praat_addAction1 (classCepstrumc, 2, U"To DTW...", 0, 0, NEW1_Cepstrumc_to_DTW);
  977. praat_addAction1 (classCepstrumc, 0, U"Hack", 0, 0, 0);
  978. praat_addAction1 (classCepstrumc, 0, U"To Matrix", 0, 0, NEW_Cepstrumc_to_Matrix);
  979. praat_addAction1 (classFormant, 0, U"Analyse", 0, 0, 0);
  980. praat_addAction1 (classFormant, 0, U"To LPC...", 0, 0, NEW_Formant_to_LPC);
  981. praat_addAction1 (classFormant, 0, U"Formula...", U"Formula (bandwidths)...", 1, MODIFY_Formant_formula);
  982. praat_addAction2 (classFormant, 1, classSpectrogram, 1, U"To IntensityTier...", 0, 0, NEW1_Formant_Spectrogram_to_IntensityTier);
  983. praat_addAction1 (classLFCC, 0, U"LFCC help", 0, 0, HELP_LFCC_help);
  984. praat_CC_init (classLFCC);
  985. praat_addAction1 (classLFCC, 0, U"To LPC...", 0, 0, NEW_LFCC_to_LPC);
  986. praat_addAction1 (classLineSpectralFrequencies, 0, U"LineSpectralFrequencies help", 0, 0, HELP_LineSpectralFrequencies_help);
  987. praat_addAction1 (classLineSpectralFrequencies, 0, U"Draw frequencies...", 0, 0, GRAPHICS_LineSpectralFrequencies_drawFrequencies);
  988. praat_addAction1 (classLineSpectralFrequencies, 0, U"To LPC", 0, 0, NEW_LineSpectralFrequencies_to_LPC);
  989. praat_addAction1 (classLPC, 0, U"LPC help", 0, 0, HELP_LPC_help);
  990. praat_addAction1 (classLPC, 0, DRAW_BUTTON, 0, 0, 0);
  991. praat_addAction1 (classLPC, 0, U"Draw gain...", 0, 1, GRAPHICS_LPC_drawGain);
  992. praat_addAction1 (classLPC, 0, U"Draw poles...", 0, 1, GRAPHICS_LPC_drawPoles);
  993. praat_addAction1 (classLPC, 0, QUERY_BUTTON, 0, 0, 0);
  994. praat_TimeFrameSampled_query_init (classLPC);
  995. praat_addAction1 (classLPC, 1, U"Get sampling interval", 0, 1, REAL_LPC_getSamplingInterval);
  996. praat_addAction1 (classLPC, 1, U"Get number of coefficients...", 0, 1, INTEGER_LPC_getNumberOfCoefficients);
  997. praat_addAction1 (classLPC, 0, MODIFY_BUTTON, 0, 0, 0);
  998. praat_TimeFunction_modify_init (classLPC);
  999. praat_addAction1 (classLPC, 0, U"Extract", 0, 0, 0);
  1000. praat_addAction1 (classLPC, 0, U"To Spectrum (slice)...", 0, 0, NEW_LPC_to_Spectrum_slice);
  1001. praat_addAction1 (classLPC, 0, U"To VocalTract (slice)...", 0, 0, NEW_LPC_to_VocalTract_slice);
  1002. praat_addAction1 (classLPC, 0, U"To VocalTract (slice, special)...", 0, 0, NEW_LPC_to_VocalTract_slice_special);
  1003. praat_addAction1 (classLPC, 0, U"To Polynomial (slice)...", 0, 0, NEW_LPC_to_Polynomial_slice);
  1004. praat_addAction1 (classLPC, 0, U"Down to Matrix (lpc)", 0, 0, NEW_LPC_downto_Matrix_lpc);
  1005. praat_addAction1 (classLPC, 0, U"Down to Matrix (rc)", 0, praat_HIDDEN, NEW_LPC_downto_Matrix_rc);
  1006. praat_addAction1 (classLPC, 0, U"Down to Matrix (area)", 0, praat_HIDDEN, NEW_LPC_downto_Matrix_area);
  1007. praat_addAction1 (classLPC, 0, U"Analyse", 0, 0, 0);
  1008. praat_addAction1 (classLPC, 0, U"To Formant", 0, 0, NEW_LPC_to_Formant);
  1009. praat_addAction1 (classLPC, 0, U"To Formant (keep all)", 0, 0, NEW_LPC_to_Formant_keep_all);
  1010. praat_addAction1 (classLPC, 0, U"To LFCC...", 0, 0, NEW_LPC_to_LFCC);
  1011. praat_addAction1 (classLPC, 0, U"To Spectrogram...", 0, 0, NEW_LPC_to_Spectrogram);
  1012. praat_addAction1 (classLPC, 0, U"To LineSpectralFrequencies...", 0, 0, NEW_LPC_to_LineSpectralFrequencies);
  1013. praat_addAction2 (classLPC, 1, classSound, 1, U"Analyse", 0, 0, 0);
  1014. praat_addAction2 (classLPC, 1, classSound, 1, U"Filter...", 0, 0, NEW1_LPC_Sound_filter);
  1015. praat_addAction2 (classLPC, 1, classSound, 1, U"Filter (inverse)", 0, 0, NEW1_LPC_Sound_filterInverse);
  1016. praat_addAction2 (classLPC, 1, classSound, 1, U"To LPC (robust)...", 0, praat_HIDDEN + praat_DEPTH_1, NEW1_LPC_Sound_to_LPC_robust);
  1017. praat_addAction2 (classLPC, 1, classSound, 1, U"Filter with filter at time...", 0, 0, NEW1_LPC_Sound_filterWithFilterAtTime);
  1018. praat_addAction2 (classLPC, 1, classSound, 1, U"Filter (inverse) with filter at time...", 0, 0, NEW1_LPC_Sound_filterInverseWithFilterAtTime);
  1019. praat_addAction1 (classSound, 0, U"To LPC (autocorrelation)...", U"To Formant (sl)...", 1, NEW_Sound_to_LPC_autocorrelation);
  1020. praat_addAction1 (classSound, 0, U"To LPC (covariance)...", U"To LPC (autocorrelation)...", 1, NEW_Sound_to_LPC_covariance);
  1021. praat_addAction1 (classSound, 0, U"To LPC (burg)...", U"To LPC (covariance)...", 1, NEW_Sound_to_LPC_burg);
  1022. praat_addAction1 (classSound, 0, U"To LPC (marple)...", U"To LPC (burg)...", 1, NEW_Sound_to_LPC_marple);
  1023. praat_addAction1 (classSound, 0, U"To MFCC...", U"To LPC (marple)...", 1, NEW_Sound_to_MFCC);
  1024. praat_addAction1 (classSound, 0, U"To Formant (robust)...", U"To Formant (sl)...", 2, NEW_Sound_to_Formant_robust);
  1025. praat_addAction1 (classSound, 0, U"To PowerCepstrogram...", U"To Harmonicity (gne)...", 1, NEW_Sound_to_PowerCepstrogram);
  1026. praat_addAction1 (classSound, 0, U"To PowerCepstrogram (hillenbrand)...", U"To Harmonicity (gne)...", praat_HIDDEN + praat_DEPTH_1, NEW_Sound_to_PowerCepstrogram_hillenbrand);
  1027. praat_addAction1 (classVocalTract, 0, U"Draw segments...", U"Draw", 0, GRAPHICS_VocalTract_drawSegments);
  1028. praat_addAction1 (classVocalTract, 1, U"Get length", U"Draw segments...", 0, REAL_VocalTract_getLength);
  1029. praat_addAction1 (classVocalTract, 1, U"Set length", U"Formula...", 0, MODIFY_VocalTract_setLength);
  1030. praat_addAction1 (classVocalTract, 0, U"To VocalTractTier...", U"To Spectrum...", 0, NEW_VocalTract_to_VocalTractTier);
  1031. praat_addAction1 (classVocalTractTier, 0, U"VocalTractTier help", 0, 0, HELP_VocalTractTier_help);
  1032. praat_addAction1 (classVocalTractTier, 0, U"Query -", 0, 0, 0);
  1033. praat_TimeTier_query_init (classVocalTractTier);
  1034. praat_addAction1 (classVocalTractTier, 0, U"Modify -", 0, 0, 0);
  1035. praat_TimeTier_modify_init (classVocalTractTier);
  1036. praat_addAction1 (classVocalTractTier, 0, U"To LPC...", 0, 0, NEW_VocalTractTier_to_LPC);
  1037. praat_addAction1 (classVocalTractTier, 0, U"To VocalTract...", 0, 0, NEW_VocalTractTier_to_VocalTract);
  1038. praat_addAction2 (classVocalTractTier, 1, classVocalTract, 1, U"Add VocalTract...", 0, 0, MODIFY_VocalTractTier_addVocalTract);
  1039. INCLUDE_MANPAGES (manual_LPC)
  1040. INCLUDE_MANPAGES (manual_DataModeler)
  1041. INCLUDE_LIBRARY (praat_DataModeler_init)
  1042. }
  1043. /* End of file praat_LPC_init.c */