manual_formant.cpp 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640
  1. /* manual_formant.cpp
  2. *
  3. * Copyright (C) 1992-2008,2010,2011,2014-2017 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 "ManPagesM.h"
  19. void manual_formant_init (ManPages me);
  20. void manual_formant_init (ManPages me) {
  21. MAN_BEGIN (U"Create FormantGrid...", U"ppgb", 20080425)
  22. INTRO (U"A command in the @@New menu@ to create an empty @FormantGrid object.")
  23. ENTRY (U"Settings")
  24. TAG (U"##Start time (s)")
  25. TAG (U"##End time (s)")
  26. DEFINITION (U"the @@time domain@ of the resulting FormantGrid.")
  27. TAG (U"##Number of formants# (e.g. 10)")
  28. DEFINITION (U"the number of formants in the resulting FormantGrid. For instance, if you set this to 10, "
  29. "the resulting FormantGrid will contain 10 formant tiers (for F1 through F10) "
  30. "and 10 bandwidth tiers (for B1 through B10). Each of these 20 tiers will contain one point.")
  31. TAG (U"##Initial first formant# (e.g. 550 Hz)")
  32. DEFINITION (U"the frequency value of the single formant point in the first formant tier. "
  33. "Because of @@constant extrapolation@, F1 will have this value throughout the time domain.")
  34. TAG (U"##Initial formant spacing# (e.g. 1100 Hz)")
  35. DEFINITION (U"the difference between the frequency values of the points in adjacent formant tiers. "
  36. "For instance, the example values mentioned here cause F2 to be 1650 Hz throughout the time domain; "
  37. "F3 will be 2750 Hz, F4 will be 3850 Hz, and so on.")
  38. TAG (U"##Initial first bandwidth# (e.g. 60 Hz)")
  39. DEFINITION (U"the value of the single bandwidth point in the first bandwidth tier. "
  40. "Because of @@constant extrapolation@, B1 will have this value throughout the time domain.")
  41. TAG (U"##Initial bandwidth spacing# (e.g. 50 Hz)")
  42. DEFINITION (U"the difference between the values of the points in adjacent bandwidth tiers. "
  43. "For instance, the example values mentioned here cause B2 to be 110 Hz throughout the time domain; "
  44. "B3 will be 160 Hz, B4 will be 210 Hz, and so on.")
  45. NORMAL (U"To add some points to it, use @@FormantGrid: Add formant point...@ and @@FormantGrid: Add bandwidth point...@.")
  46. NORMAL (U"For more examples, see @@Source-filter synthesis@.")
  47. MAN_END
  48. MAN_BEGIN (U"Formant", U"ppgb", 20050427)
  49. INTRO (U"One of the @@types of objects@ in Praat. "
  50. "A Formant object represents spectral structure as a function of time: a %%formant contour%. "
  51. "Unlike the time-stamped @FormantGrid object, it is sampled into a number of %frames centred around equally spaced times, "
  52. "Each frame contains frequency and bandwidth information about several formants.")
  53. ENTRY (U"Inside a Formant object")
  54. NORMAL (U"With @Inspect, you will see the following attributes:")
  55. TAG (U"%xmin")
  56. DEFINITION (U"start time, in seconds.")
  57. TAG (U"%xmax")
  58. DEFINITION (U"end time, in seconds.")
  59. TAG (U"%nx")
  60. DEFINITION (U"the number of frames (≥ 1).")
  61. TAG (U"%dx")
  62. DEFINITION (U"time step = frame length = frame duration, in seconds.")
  63. TAG (U"%x1")
  64. DEFINITION (U"the time associated with the first frame, in seconds. "
  65. "This will usually be in the range [%xmin, %xmax]. "
  66. "The time associated with the last frame (i.e., %x1 + (%nx – 1) %dx)) "
  67. "will also usually be in that range.")
  68. TAG (U"%frame__%i_, %i = 1 ... %nx")
  69. DEFINITION (U"the frames (see below).")
  70. ENTRY (U"Attributes of a formant frame")
  71. NORMAL (U"Each %frame__%i_ contains the following attributes:")
  72. TAG (U"%intensity")
  73. DEFINITION (U"an indication of the maximum intensity (a squared sound amplitude) in this frame.")
  74. TAG (U"%nFormants")
  75. DEFINITION (U"the number of formants in this frame (usually between 2 and 6).")
  76. TAG (U"%formant__%j_, %j = 1 ... %nFormants")
  77. DEFINITION (U"the information about each formant (see below).")
  78. ENTRY (U"Attributes of each formant")
  79. NORMAL (U"Each %formant__%j_ contains the following attributes:")
  80. TAG (U"%frequency")
  81. DEFINITION (U"the formant's centre frequency (in Hz).")
  82. TAG (U"%bandwidth")
  83. DEFINITION (U"the formant's bandwidth (in Hz).")
  84. ENTRY (U"See also")
  85. NORMAL (U"##Linear Prediction#")
  86. MAN_END
  87. MAN_BEGIN (U"Formant: Down to FormantGrid", U"ppgb", 20080427)
  88. INTRO (U"A command to convert every selected @Formant into a @FormantGrid.")
  89. NORMAL (U"This performs a trivial copying of frames to points. "
  90. "Each formant tier and each bandwidth tier of the resulting FormantGrid contains a point for each original frame. "
  91. "The intensity information is lost.")
  92. MAN_END
  93. MAN_BEGIN (U"Formant: Draw tracks...", U"ppgb", 19980321)
  94. INTRO (U"A command to draw the selected @Formant objects to the @@Picture window@.")
  95. ENTRY (U"Behaviour")
  96. NORMAL (U"Every formant value is drawn as one or two short line segments, connected, if possible, "
  97. "with a line segment of the corresponding formant values in the adjacent frames.")
  98. ENTRY (U"Settings")
  99. TAG (U"##From time (s)")
  100. TAG (U"##To time (s)")
  101. DEFINITION (U"the time domain of the drawing. If ##To time# is not greater than ##From time#, "
  102. "the entire formant contour is drawn.")
  103. TAG (U"##Maximum frequency (Hz)")
  104. DEFINITION (U"the height of the %y axis. For speech, 5000 Hz is a usual value.")
  105. TAG (U"##Garnish")
  106. DEFINITION (U"determines whether axes, numbers, and texts (\"Time\", \"Formant frequency\") will be drawn in the margins around the picture. "
  107. "Turn this button off if you prefer to garnish your picture by yourself with the @Margins menu.")
  108. ENTRY (U"Usage")
  109. NORMAL (U"Unlike @@Formant: Speckle...@, this procedure assumes that e.g. the second formant in frame %i "
  110. "has something to do with the second formant in frame %i+1. To make this assumption more plausible, "
  111. "use @@Formant: Track...@ first.")
  112. MAN_END
  113. MAN_BEGIN (U"Formant: Formula (bandwidths)...", U"ppgb", 19980323)
  114. INTRO (U"A command to modify each selected @Formant object with a specified formula.")
  115. NORMAL (U"For what you can do with formulas, see @@Matrix: Formula...@. "
  116. "The %%i%th row contains the values of the %%i%th bandwidth contour.")
  117. NORMAL (U"See @@Formant: Formula (frequencies)...@ for more information.")
  118. MAN_END
  119. MAN_BEGIN (U"Formant: Formula (frequencies)...", U"ppgb", 19981221)
  120. INTRO (U"A command to modify each selected @Formant object with a specified formula.")
  121. NORMAL (U"For what you can do with formulas, see @@Matrix: Formula...@. "
  122. "The %%i%th row contains the values of the %%i%th frequency contour.")
  123. NORMAL (U"For an example, see @@Source-filter synthesis@.")
  124. MAN_END
  125. MAN_BEGIN (U"Formant: Get bandwidth at time...", U"ppgb", 19991016)
  126. INTRO (U"A @query to the selected @Formant object for the bandwidth of the specified formant at the specified time.")
  127. ENTRY (U"Settings")
  128. TAG (U"##Formant number")
  129. DEFINITION (U"the ordinal number of the formant, counting up from 0 Hz. Specify \"2\" for %F__2_ etc.")
  130. TAG (U"##Time (s)")
  131. DEFINITION (U"the time at which to evaluate the bandwidth.")
  132. TAG (U"##Units")
  133. DEFINITION (U"the units of the result (#hertz or #Bark).")
  134. ENTRY (U"Return value")
  135. NORMAL (U"the estimated bandwidth in hertz or Bark. "
  136. "If %Time is not within half a frame width of any frame centre, or "
  137. "If the specified %%Formant number% is greater than the number of formants in the frame, "
  138. "the return value is @undefined; "
  139. "otherwise, the formant is considered to belong to the frame whose centre is nearest to the specified time.")
  140. ENTRY (U"Algorithm")
  141. NORMAL (U"If possible (i.e. if the adjacent frame has enough formants), "
  142. "a linear interpolation is performed between the centre of the frame and the centre of the adjacent frame. "
  143. "With Bark units, the hertz-to-Bark transformation is performed "
  144. "on the two frequencies %F ± 1/2 %B (after interpolation), and the result is the difference between these two values")
  145. MAN_END
  146. MAN_BEGIN (U"Formant: Get maximum...", U"ppgb", 19991016)
  147. INTRO (U"A @query to ask the selected @Formant object for the maximum value of the specified formant.")
  148. ENTRY (U"Return value")
  149. NORMAL (U"the maximum, in hertz or Bark.")
  150. ENTRY (U"Settings")
  151. TAG (U"##Formant number")
  152. DEFINITION (U"the ordinal number of the formant, counting up from 0 Hz. Specify \"2\" for %F__2_ etc.")
  153. TAG (U"##From time (s)")
  154. TAG (U"##To time (s)")
  155. DEFINITION (U"the selected time domain. Values outside this domain are ignored. "
  156. "If ##To time# is not greater than ##From time#, the entire time domain of the formant contour is considered.")
  157. TAG (U"##Units")
  158. DEFINITION (U"the units of the result (#Hertz or #Bark).")
  159. TAG (U"##Interpolation")
  160. DEFINITION (U"the interpolation method (#None or #Parabolic). See @@vector peak interpolation@.")
  161. MAN_END
  162. MAN_BEGIN (U"Formant: Get mean...", U"ppgb", 20140421)
  163. INTRO (U"A @query to ask the selected @Formant object for the mean value of the specified formant.")
  164. ENTRY (U"Return value")
  165. NORMAL (U"the mean, in hertz or Bark.")
  166. ENTRY (U"Settings")
  167. TAG (U"##Formant number")
  168. DEFINITION (U"the ordinal number of the formant, counting up from 0 Hz. Specify \"2\" for %F__2_ etc.")
  169. TAG (U"##From time (s)")
  170. TAG (U"##To time (s)")
  171. DEFINITION (U"the selected time domain. Values outside this domain are ignored. "
  172. "If ##To time# is not greater than ##From time#, the entire time domain of the formant contour is considered.")
  173. TAG (U"##Units")
  174. DEFINITION (U"the units of the result (#Hertz or #Bark).")
  175. ENTRY (U"Scripting")
  176. NORMAL (U"You can use this command to put the mean into a script variable:")
  177. CODE (U"selectObject: \"Formant hallo\"")
  178. CODE (U"mean = Get mean: 2, 0, 0, \"Hertz\"")
  179. NORMAL (U"In this case, the value will not be written into the Info window.")
  180. MAN_END
  181. MAN_BEGIN (U"Formant: Get minimum...", U"ppgb", 19991016)
  182. INTRO (U"A @query to ask the selected @Formant object for the minimum value of the specified formant.")
  183. ENTRY (U"Return value")
  184. NORMAL (U"the minimum, in hertz or Bark.")
  185. ENTRY (U"Settings")
  186. TAG (U"##Formant number")
  187. DEFINITION (U"the ordinal number of the formant, counting up from 0 Hz. Specify \"2\" for %F__2_ etc.")
  188. TAG (U"##From time (s)")
  189. TAG (U"##To time (s)")
  190. DEFINITION (U"the selected time domain. Values outside this domain are ignored. "
  191. "If ##To time# is not greater than ##From time#, the entire time domain of the formant contour is considered.")
  192. TAG (U"##Units")
  193. DEFINITION (U"the units of the result (#Hertz or #Bark).")
  194. TAG (U"##Interpolation")
  195. DEFINITION (U"the interpolation method (#None or #Parabolic). See @@vector peak interpolation@.")
  196. MAN_END
  197. MAN_BEGIN (U"Formant: Get number of formants", U"ppgb", 19991016)
  198. INTRO (U"A @query to ask the selected @Formant object for the number of formants in a specified frame.")
  199. ENTRY (U"Setting")
  200. TAG (U"##Frame number")
  201. DEFINITION (U"the frame number whose formant count is sought.")
  202. ENTRY (U"Return value")
  203. NORMAL (U"the number of formants.")
  204. MAN_END
  205. MAN_BEGIN (U"Formant: Get quantile...", U"ppgb", 19991016)
  206. INTRO (U"A @query to ask the selected @Formant object for an estimation of the specified quantile of the distribution "
  207. "that underlies the attested values of the specified formant.")
  208. ENTRY (U"Return value")
  209. NORMAL (U"the quantile, in hertz or Bark.")
  210. ENTRY (U"Settings")
  211. TAG (U"##Formant number")
  212. DEFINITION (U"the ordinal number of the formant, counting up from 0 Hz. Specify \"2\" for %F__2_ etc.")
  213. TAG (U"##From time (s)")
  214. TAG (U"##To time (s)")
  215. DEFINITION (U"the selected time domain. Values outside this domain are ignored. "
  216. "If ##To time# is not greater than ##From time#, the entire time domain of the formant contour is considered.")
  217. TAG (U"##Units")
  218. DEFINITION (U"the units of the result (#Hertz or #Bark).")
  219. TAG (U"##Quantile")
  220. DEFINITION (U"the fraction (between 0 and 1) of the values of the underlying distribution expected to lie below the result. "
  221. "For instance, if #Quantile is 0.10, the algorithm estimates the formant value below which 10\\% of all formant values "
  222. "are expected to lie. To get an estimate of the %median of the underlying distribution, specify a quantile of 0.50.")
  223. ENTRY (U"Algorithm")
  224. NORMAL (U"First, the available formant values within the selected time domain are collected in an array. "
  225. "This array is then sorted and the @@quantile algorithm@ is performed. With Bark units, "
  226. "the hertz-to-Bark transformation is performed before the quantile algorithm.")
  227. MAN_END
  228. MAN_BEGIN (U"Formant: Get standard deviation", U"ppgb", 19991016)
  229. INTRO (U"A @query to ask the selected @Formant object for the standard deviation of the attested values of the specified formant "
  230. "within a specified time domain.")
  231. ENTRY (U"Return value")
  232. NORMAL (U"the standard deviation, in hertz or Bark.")
  233. ENTRY (U"Settings")
  234. TAG (U"##Formant number")
  235. DEFINITION (U"the ordinal number of the formant, counting up from 0 Hz. Specify \"2\" for %F__2_ etc.")
  236. TAG (U"##From time (s)")
  237. TAG (U"##To time (s)")
  238. DEFINITION (U"the selected time domain. Values outside this domain are ignored. "
  239. "If ##To time# is not greater than ##From time#, the entire time domain of the formant contour is considered.")
  240. TAG (U"##Units")
  241. DEFINITION (U"the units of the result (#Hertz or #Bark).")
  242. MAN_END
  243. MAN_BEGIN (U"Formant: Get time of maximum...", U"ppgb", 19991016)
  244. INTRO (U"A @query to ask the selected @Formant object for the time associated with the maximum value "
  245. "of a specified formant within a specified time domain.")
  246. ENTRY (U"Settings")
  247. TAG (U"##Formant number")
  248. DEFINITION (U"the ordinal number of the formant, counting up from 0 Hz. Specify \"2\" for %F__2_ etc.")
  249. TAG (U"##From time (s)")
  250. TAG (U"##To time (s)")
  251. DEFINITION (U"the selected time domain. Values outside this domain are ignored, except for interpolation. "
  252. "If ##To time# is not greater than ##From time#, the entire time domain of the formant contour is considered.")
  253. TAG (U"##Units")
  254. DEFINITION (U"the units of the result (#Hertz or #Bark).")
  255. TAG (U"##Interpolation")
  256. DEFINITION (U"the interpolation method (#None or #Parabolic). See @@vector peak interpolation@.")
  257. ENTRY (U"Return value")
  258. NORMAL (U"the time expressed in seconds. If no relevant formants are found, the value is @undefined.")
  259. MAN_END
  260. MAN_BEGIN (U"Formant: Get time of minimum...", U"ppgb", 19991016)
  261. INTRO (U"A @query to ask the selected @Formant object for the time associated with the minimum value "
  262. "of a specified formant within a specified time domain.")
  263. ENTRY (U"Settings")
  264. TAG (U"##Formant number")
  265. DEFINITION (U"the ordinal number of the formant, counting up from 0 Hz. Specify \"2\" for %F__2_ etc.")
  266. TAG (U"##From time (s)")
  267. TAG (U"##To time (s)")
  268. DEFINITION (U"the selected time domain. Values outside this domain are ignored, except for interpolation. "
  269. "If ##To time# is not greater than ##From time#, the entire time domain of the formant contour is considered.")
  270. TAG (U"##Units")
  271. DEFINITION (U"the units of the result (#Hertz or #Bark).")
  272. TAG (U"##Interpolation")
  273. DEFINITION (U"the interpolation method (#None or #Parabolic). See @@vector peak interpolation@.")
  274. ENTRY (U"Return value")
  275. NORMAL (U"the time expressed in seconds. If no relevant formants are found, the value is @undefined.")
  276. MAN_END
  277. MAN_BEGIN (U"Formant: Get value at time...", U"ppgb", 19991016)
  278. INTRO (U"A @query to ask the selected @Formant object for the frequency of the specified formant at the specified time.")
  279. ENTRY (U"Settings")
  280. TAG (U"##Formant number")
  281. DEFINITION (U"the ordinal number of the formant, counting up from 0 Hz. Specify \"2\" for %F__2_ etc.")
  282. TAG (U"##Time (s)")
  283. DEFINITION (U"the time at which to evaluate the formant frequency.")
  284. TAG (U"##Units)")
  285. DEFINITION (U"the units of the result (#Hertz or #Bark).")
  286. TAG (U"##Interpolation")
  287. DEFINITION (U"the interpolation method, see @@vector value interpolation@. "
  288. "Always Linear.")
  289. ENTRY (U"Return value")
  290. NORMAL (U"the bandwidth in hertz or Bark. "
  291. "If #Time is not within half a frame width of any frame centre, or "
  292. "if ##Formant number# is greater than the number of formants in the frame, "
  293. "the value is @undefined; "
  294. "otherwise, the formant is considered to belong to the frame whose centre is nearest to #Time.")
  295. ENTRY (U"Algorithm")
  296. NORMAL (U"If possible (i.e. if the adjacent frame has enough formants), "
  297. "a linear interpolation is performed between the centre of the frame and the centre of the adjacent frame. "
  298. "With Bark units, the hertz-to-Bark transformation is performed before interpolation.")
  299. MAN_END
  300. MAN_BEGIN (U"Formant: Speckle...", U"ppgb", 20030916)
  301. INTRO (U"A command to draw the selected @Formant objects to the @@Picture window@.")
  302. ENTRY (U"Behaviour")
  303. NORMAL (U"Every formant value is drawn as a small circle, filled with the current colour.")
  304. ENTRY (U"Settings")
  305. TAG (U"##From time (s)")
  306. TAG (U"##To time (s)")
  307. DEFINITION (U"the time domain of the drawing. If ##To time# is not greater than ##From time#, "
  308. "the entire formant contour is drawn.")
  309. TAG (U"##Maximum frequency (Hz)")
  310. DEFINITION (U"the height of the %y axis. For speech, 5000 Hz is a usual value.")
  311. TAG (U"##Dynamic range (dB)")
  312. DEFINITION (U"determines the signal intensity (as stored in each formant frame) below which "
  313. "no formants will be drawn. If zero, all formants will be drawn. The standard value is 30 dB, "
  314. "which would mean that formants in frames with intensities less than the maximum intensity minus 30 dB will not be drawn.")
  315. TAG (U"##Garnish")
  316. DEFINITION (U"determines whether axes, numbers, and texts (\"Time\", \"Formant frequency\") will be drawn in the margins around the picture. "
  317. "Turn this button off if you prefer to garnish your picture by yourself with the @Margins menu.")
  318. MAN_END
  319. MAN_BEGIN (U"Formant: Track...", U"ppgb", 20020308)
  320. INTRO (U"A command to extract a specified number of formant tracks from each selected @Formant object. "
  321. "The tracks represent the cheapest paths through the measured formant values in consecutive frames.")
  322. ENTRY (U"How to use")
  323. NORMAL (U"In order to be capable of producing three tracks (i.e. F1, F2, and F3), there must be at least "
  324. "three formant candidates in %every frame of the Formant object. The typical use of "
  325. "this command, therefore, is to analyse five formants with @@Sound: To Formant (burg)...@ "
  326. "and then use the tracking command to extract three tracks.")
  327. ENTRY (U"When to use, when not")
  328. NORMAL (U"This command only makes sense if the whole of the formant contour makes sense. "
  329. "For speech, formant contours make sense only for vowels and the like. "
  330. "During some consonants, the Formant object may have fewer than three formant values, "
  331. "and trying to create three tracks through them will fail. "
  332. "You will typically use this command for the contours in diphthongs, if at all.")
  333. ENTRY (U"Settings")
  334. NORMAL (U"To be able to interpret the settings, you should know that the aim of the procedure is "
  335. "to minimize the sum of the %costs associated with the three tracks.")
  336. TAG (U"##Number of tracks")
  337. DEFINITION (U"the number of formant tracks that the procedure must find. If this number is 3, "
  338. "the procedure will try to find tracks for F1, F2, and F3; if the Formant object contains "
  339. "a frame with less than three formants, the tracking procedure will fail.")
  340. TAG (U"##Reference F1 (Hz)")
  341. DEFINITION (U"the preferred value near which the first track wants to be. "
  342. "For average (i.e. adult female) speakers, this value will be around "
  343. "the average F1 for vowels of female speakers, i.e. 550 Hz.")
  344. TAG (U"##Reference F2 (Hz)")
  345. DEFINITION (U"the preferred value near which the second track wants to be. "
  346. "A good value will be around "
  347. "the average F2 for vowels of female speakers, i.e. 1650 Hz.")
  348. TAG (U"##Reference F3 (Hz)")
  349. DEFINITION (U"the preferred value near which the third track wants to be. "
  350. "A good value will be around "
  351. "the average F3 for vowels of female speakers, i.e. 2750 Hz. "
  352. "This argument will be ignored if you choose to have fewer than three tracks, "
  353. "i.e., if you are only interested in F1 and F2.")
  354. TAG (U"##Reference F4 (Hz)")
  355. DEFINITION (U"the preferred value near which the fourth track wants to be. "
  356. "A good value may be around 3850 Hz, but you will usually not want to "
  357. "track F4, because traditional formant lore tends to ignore it "
  358. "(however inappropriate this may be for the vowel [i]), "
  359. "and because Formant objects often contain not more than three formant values "
  360. "in some frames. So you will not usually specify a higher %%Number of tracks% than 3, "
  361. "and in that case, this argument will be ignored.")
  362. TAG (U"##Reference F5 (Hz)")
  363. DEFINITION (U"the preferred value near which the five track wants to be. "
  364. "In the unlikely case that you want five tracks, "
  365. "a good value may be around 4950 Hz.")
  366. TAG (U"##Frequency cost (per kiloHertz)")
  367. DEFINITION (U"the local cost of having a formant value in your track that deviates "
  368. "from the reference value. For instance, if a candidate (i.e. any formant in a frame "
  369. "of the Formant object) has a formant frequency of 800 Hz, "
  370. "and ##Frequency cost# is 1.0/kHz, "
  371. "the cost of putting this formant in the first track is 0.250, "
  372. "because the distance to the reference F1 of 550 Hz is 250 Hz. "
  373. "The cost of putting the formant in the second track would be 0.850 "
  374. "(= (1.650 kHz - 0.600 kHz) · 1.0/kHz), so we see that the procedure "
  375. "locally favours the inclusion of the 800 Hz candidate into the F1 track. "
  376. "But the next two cost factors may override this local preference.")
  377. TAG (U"##Bandwidth cost")
  378. DEFINITION (U"the local cost of having a bandwidth, relative to the formant frequency. "
  379. "For instance, if a candidate has a formant frequency of 400 Hz and "
  380. "a bandwidth of 80 Hz, and ##Bandwidth cost# is 1.0, "
  381. "the cost of having this formant in any track is (80/400) · 1.0 = 0.200. "
  382. "So we see that the procedure locally favours the inclusion of candidates "
  383. "with low relative bandwidths.")
  384. TAG (U"##Transition cost (per octave)")
  385. DEFINITION (U"the cost of having two different consecutive formant values in a track. "
  386. "For instance, if a proposed track through the candidates has two consecutive formant "
  387. "values of 300 Hz and 424 Hz, and ##Transition cost# is 1.0/octave, "
  388. "the cost of having this large frequency jump is (0.5 octave) · (1.0/octave) = 0.500.")
  389. ENTRY (U"Algorithm")
  390. NORMAL (U"This command uses a Viterbi algorithm with multiple planes. For instance, if the selected Formant object "
  391. "contains up to five formants per frame, and you request three tracks, the Viterbi algorithm will have to choose "
  392. "between ten candidates (the number of combinations of three out of five) for each frame.")
  393. NORMAL (U"The formula for the cost of e.g. track 3, with proposed values %F__2%i_ (%i = 1...%N, "
  394. "where %N is the number of frames) is:")
  395. FORMULA (U"∑__%i=1..%N_ %frequencyCost·|%F__3%i_ – %referenceF3|/1000 +")
  396. FORMULA (U"+ ∑__%i=1..%N_ %bandWidthCost·%B__3%i_/%F__3%i_ +")
  397. FORMULA (U"+ ∑__%i=1..%N-1_ %transitionCost·|log__2_(%F__3%i_/%F__3,%i+1_)|")
  398. NORMAL (U"Analogous formulas compute the cost of track 1 and track 2. "
  399. "The procedure will assign those candidates to the three tracks that minimize "
  400. "the sum of three track costs.")
  401. MAN_END
  402. MAN_BEGIN (U"FormantGrid", U"ppgb", 20080427)
  403. INTRO (U"One of the @@types of objects@ in Praat.")
  404. NORMAL (U"A FormantGrid object represents spectral structure as a function of time: a %%formant contour%. "
  405. "Unlike the evenly sampled @Formant object, it consists of a number of formant tiers and bandwidth tiers, "
  406. "each of which contains a number of formant or bandwidth %points (or %targets), sorted by time.")
  407. NORMAL (U"For examples, see @@Source-filter synthesis@.")
  408. ENTRY (U"FormantGrid commands")
  409. NORMAL (U"Creation:")
  410. LIST_ITEM (U"From scratch:")
  411. LIST_ITEM (U"• @@Create FormantGrid...")
  412. LIST_ITEM (U"• @@FormantGrid: Add formant point...")
  413. LIST_ITEM (U"• @@FormantGrid: Add bandwidth point...")
  414. LIST_ITEM (U"Copy from another object:")
  415. LIST_ITEM (U"• @@Formant: Down to FormantGrid@: trivial copying of frames to points.")
  416. //NORMAL (U"Conversion:")
  417. //LIST_ITEM (U"• @@FormantGrid: Down to PointProcess@: copy times.")
  418. NORMAL (U"Synthesis:")
  419. LIST_ITEM (U"• @@Sound & FormantGrid: Filter@: see @@Source-filter synthesis@.")
  420. //NORMAL (U"Queries:")
  421. //LIST_ITEM (U"• @@Get low index from time...")
  422. //LIST_ITEM (U"• @@Get high index from time...")
  423. //LIST_ITEM (U"• @@Get nearest index from time...")
  424. NORMAL (U"Modification:")
  425. LIST_ITEM (U"• @@FormantGrid: Add formant point...")
  426. LIST_ITEM (U"• @@FormantGrid: Add bandwidth point...")
  427. //LIST_ITEM (U"• @@Remove point...")
  428. //LIST_ITEM (U"• @@Remove point near...")
  429. LIST_ITEM (U"• @@FormantGrid: Remove formant points between...")
  430. LIST_ITEM (U"• @@FormantGrid: Remove bandwidth points between...")
  431. MAN_END
  432. MAN_BEGIN (U"FormantGrid: Add bandwidth point...", U"ppgb", 20080425)
  433. INTRO (U"A command to add a bandwidth point to each selected @FormantGrid.")
  434. NORMAL (U"For examples, see @@Source-filter synthesis@.")
  435. ENTRY (U"Settings")
  436. TAG (U"##Formant number")
  437. DEFINITION (U"the number of the formant (e.g. 1, 2,...) to which a bandwidth point is to be added.")
  438. TAG (U"##Time (s)")
  439. DEFINITION (U"the time at which a bandwidth point is to be added.")
  440. TAG (U"##Bandwidth (Hz)")
  441. DEFINITION (U"the bandwidth value of the requested new point.")
  442. ENTRY (U"Example")
  443. NORMAL (U"To set the bandwidth of F2 at 0.3 seconds to 130 Hz, "
  444. "you set ##Formant number# to 2, #Time to 0.3 s, and #Bandwidth to 130 Hz.")
  445. ENTRY (U"Behaviour")
  446. NORMAL (U"The formant tier is modified so that it contains the new point. "
  447. "If a bandwidth point at the specified time was already present in the formant tier, nothing happens.")
  448. MAN_END
  449. MAN_BEGIN (U"FormantGrid: Add formant point...", U"ppgb", 20080425)
  450. INTRO (U"A command to add a formant point to each selected @FormantGrid.")
  451. NORMAL (U"For examples, see @@Source-filter synthesis@.")
  452. ENTRY (U"Settings")
  453. TAG (U"##Formant number")
  454. DEFINITION (U"the number of the formant (e.g. 1, 2,...) to which a formant point is to be added.")
  455. TAG (U"##Time (s)")
  456. DEFINITION (U"the time at which a formant point is to be added.")
  457. TAG (U"##Frequency (Hz)")
  458. DEFINITION (U"the formant frequency value of the requested new point.")
  459. ENTRY (U"Example")
  460. NORMAL (U"To set the value of F2 at 0.3 seconds to 2200 Hz, "
  461. "you set ##Formant number# to 2, #Time to 0.3 s, and #Frequency to 2200 Hz.")
  462. ENTRY (U"Behaviour")
  463. NORMAL (U"The formant tier is modified so that it contains the new point. "
  464. "If a formant point at the specified time was already present in the formant tier, nothing happens.")
  465. MAN_END
  466. MAN_BEGIN (U"FormantGrid: Remove bandwidth points between...", U"ppgb", 20080427)
  467. INTRO (U"A command to remove some points from a bandwidth tier in every selected @FormantGrid.")
  468. ENTRY (U"Settings")
  469. TAG (U"##Formant number")
  470. DEFINITION (U"the formant (1, 2,...) from whose bandwidth tier you want to remove some points.")
  471. TAG (U"##From time (s))")
  472. TAG (U"##To time (s)")
  473. DEFINITION (U"the times between which you want to remove all bandwidth points.")
  474. ENTRY (U"Example")
  475. NORMAL (U"If you want to remove all bandwidth points in F2 between 0.5 and 0.7 seconds, "
  476. "you set ##Formant number# to 2, ##From time# to 0.5 s, and ##To time# to 0.7 s.")
  477. MAN_END
  478. MAN_BEGIN (U"FormantGrid: Remove formant points between...", U"ppgb", 20080427)
  479. INTRO (U"A command to remove some points from a formant tier in every selected @FormantGrid.")
  480. ENTRY (U"Settings")
  481. TAG (U"%%Formant number")
  482. DEFINITION (U"the formant (1, 2,...) from which you want to remove some points.")
  483. TAG (U"##From time (s))")
  484. TAG (U"##To time (s)")
  485. DEFINITION (U"the times between which you want to remove all formant points.")
  486. ENTRY (U"Example")
  487. NORMAL (U"If you want to remove all formant points in F2 between 0.5 and 0.7 seconds, "
  488. "you set ##Formant number# to 2, ##From time# to 0.5 s, and ##To time# to 0.7.")
  489. MAN_END
  490. MAN_BEGIN (U"Sound: To Formant (burg)...", U"ppgb", 20101007)
  491. INTRO (U"A command that creates a @Formant object from every selected @Sound object. "
  492. "It performs a short-term spectral analysis, approximating the spectrum of each "
  493. "analysis frame by a number of formants.")
  494. ENTRY (U"Settings")
  495. TAG (U"##Time step (s)")
  496. DEFINITION (U"the time between the centres of consecutive analysis frames. If the sound is 2 seconds long, "
  497. "and the time step is 0.01 seconds, there will be approximately 200 analysis frames. "
  498. "The actual number is somewhat lower (usually 195), because we cannot measure very well "
  499. "near the edges. If you set the time step to 0.0 (the standard), Praat will use a time step "
  500. "that is equal to 25 percent of the analysis window length (see below).")
  501. TAG (U"##Maximum number of formants")
  502. DEFINITION (U"for most analyses of human speech, you will want to extract 5 formants per frame. "
  503. "This, in combination with the ##Maximum formant# setting, is the only way "
  504. "in which this procedure will give you results compatible with how people "
  505. "tend to interpret formants for vowels, i.e. in terms of "
  506. "vowel height (F1) and vowel place (F2). Otherwise, the ##Maximum number of formants# can be any multiple of 0.5, "
  507. "you can choose 4, 4.5, 5, 5.5, 6, and so on (see below).")
  508. TAG (U"##Maximum formant (Hz)")
  509. DEFINITION (U"the ceiling of the formant search range, in hertz. It is crucial that you set this to a value suitable for your speaker. "
  510. "The standard value of 5500 Hz is suitable for an average adult female. For a male, use 5000 Hz; "
  511. "if you use 5500 Hz for an adult male, you may end up with too few formants in the low frequency region, "
  512. "e.g. analysing an [u] as having a single formant near 500 Hz whereas you want two formants at 300 and 600 Hz. "
  513. "For a young child, use a value much higher than 5500 Hz, for instance 8000 Hz (experiment with it on steady vowels).")
  514. TAG (U"##Window length (s)")
  515. DEFINITION (U"the effective duration of the analysis window, in seconds. The actual length is twice this value, "
  516. "because Praat uses a Gaussian-like analysis window with sidelobes below -120 dB. "
  517. "For instance, if the ##Window length# is 0.025 seconds, the actual Gaussian window duration "
  518. "is 0.050 seconds. This window has values below 4\\% outside the central 0.025 seconds, "
  519. "and its frequency resolution (-3 dB point) is 1.298 / (0.025 s) = 51.9 Hz, as computed "
  520. "with the formula given at @@Sound: To Spectrogram...@. This is comparable to the bandwidth "
  521. "of a Hamming window of 0.025 seconds, which is 1.303 / (0.025 s) = 52.1 Hz, "
  522. "but that window (which is the window most often used in other analysis programs) "
  523. "has three spectral lobes of about -42 dB on each side.")
  524. TAG (U"##Pre-emphasis from (Hz)")
  525. DEFINITION (U"the +3 dB point for an inverted low-pass filter with a slope of +6 dB/octave. "
  526. "If this value is 50 Hz, then frequencies below 50 Hz are not enhanced, "
  527. "frequencies around 100 Hz are amplified by 6 dB, frequencies around 200 Hz are amplified by 12 dB, "
  528. "and so forth. The point of this is that vowel spectra tend to fall by 6 dB per octave; "
  529. "the pre-emphasis creates a flatter spectrum, which is better for formant analysis "
  530. "because we want our formants to match the local peaks, not the global spectral slope. "
  531. "See the @@source-filter synthesis@ tutorial for a technical explanation, "
  532. "and @@Sound: Pre-emphasize (in-place)...@ for the algorithm.")
  533. ENTRY (U"Algorithm")
  534. NORMAL (U"The sound will be resampled to a sampling frequency of twice the value of %%Maximum formant%, "
  535. "with the algorithm described at @@Sound: Resample...@. "
  536. "After this, pre-emphasis is applied with the algorithm described at @@Sound: Pre-emphasize (in-place)...@. "
  537. "For each analysis window, Praat applies a Gaussian-like window, "
  538. "and computes the LPC coefficients with the algorithm by Burg, as given by @@Childers (1978)@ "
  539. "and @@Press et al. (1992)@. The number of \"poles\" that this algorithm computes is twice the %%Maximum number of formants%; "
  540. "that's why you can set the %%Maximum number of formants% to any multiple of 0.5).")
  541. NORMAL (U"The algorithm will initially find ##Maximum number of formants# formants in the whole range between 0 Hz "
  542. "and ##Maximum formant#. The initially found formants can therefore sometimes have very low frequencies (near 0 Hz) "
  543. "or very high frequencies (near ##Maximum formant#). Such low or high \"formants\" tend to be artefacts of the LPC algorithm, "
  544. "i.e., the algorithm tends to use them to match the spectral slope if that slope differs from the 6 dB/octave assumption. "
  545. "Therefore, such low or high \"formants\" cannot usually be associated with the vocal tract resonances that you are looking for. "
  546. "In order for you to be able to identify the traditional F1 and F2, "
  547. "all formants below 50 Hz and all formants above ##Maximum formant# minus 50 Hz, "
  548. "are therefore removed. If you don't want this removal, you may experiment with @@Sound: To Formant (keep all)...@ instead. "
  549. "If you prefer an algorithm that always yields the requested number of formants, nicely distributed "
  550. "across the frequency domain, you may try the otherwise rather unreliable Split-Levinson procedure @@Sound: To Formant (sl)...@.")
  551. MAN_END
  552. MAN_BEGIN (U"Sound: To Formant (keep all)...", U"ppgb", 20000210)
  553. INTRO (U"A command that creates a @Formant object from every selected @Sound object. Not recommended for general use.")
  554. ENTRY (U"Purpose")
  555. NORMAL (U"to perform a short-term spectral analysis, approximating the spectrum of each frame by a number of formants.")
  556. ENTRY (U"Settings")
  557. NORMAL (U"The same as with @@Sound: To Formant (burg)...@.")
  558. ENTRY (U"Algorithm")
  559. NORMAL (U"The same as with @@Sound: To Formant (burg)...@. In contrast with that command, "
  560. "however, all formant values are kept, even those below 50 Hz and those above %%Maximum formant% minus 50 Hz. "
  561. "Although this makes the identification of the traditional F1 and F2 more difficult, "
  562. "this might give better results in resynthesis (see @@Sound & Formant: Filter@), but it usually generates funny values instead.")
  563. MAN_END
  564. MAN_BEGIN (U"Sound: To Formant (sl)...", U"ppgb", 20021215)
  565. INTRO (U"A command that creates a @Formant object from every selected @Sound object. Not recommended for general use.")
  566. ENTRY (U"Purpose")
  567. NORMAL (U"to perform a short-term spectral analysis, approximating the spectrum of each frame by a number of formants.")
  568. ENTRY (U"Settings")
  569. NORMAL (U"The same as with @@Sound: To Formant (burg)...@.")
  570. ENTRY (U"Algorithm")
  571. NORMAL (U"The algorithm is based on the implementation of the `Split Levinson' algorithm by @@Willems (1986)@. "
  572. "This algorithm will always find the requested number of formants in every frame, even if they do not exist. "
  573. "The standard routine (@@Sound: To Formant (burg)...@) yields much more reliable formant values, though it is more sensitive "
  574. "to the %%Maximum formant% argument.")
  575. NORMAL (U"Because of the general funny behaviour of the Split-Levinson algorithm, we did not bother to implement an analysis "
  576. "of the bandwidths. They are all set arbitrarily to 50 Hz.")
  577. MAN_END
  578. MAN_BEGIN (U"Sound & Formant: Filter", U"ppgb", 19991119)
  579. INTRO (U"A command to create a new Sound from the selected @Sound and @Formant objects.")
  580. NORMAL (U"For examples, see @@Source-filter synthesis@.")
  581. NORMAL (U"The resulting Sound is scaled so that its maximum absolute amplitude is 0.99. "
  582. "If you don't want this, use @@Sound & Formant: Filter (no scale)@ instead.")
  583. MAN_END
  584. MAN_BEGIN (U"Sound & Formant: Filter (no scale)", U"ppgb", 19991119)
  585. INTRO (U"A command to create a new Sound from the selected @Sound and @Formant objects.")
  586. NORMAL (U"For examples, see @@Source-filter synthesis@.")
  587. NORMAL (U"Unlike what happens in @@Sound & Formant: Filter@, "
  588. "the resulting Sound is not scaled. This allows generation of a series "
  589. "of signals with controlled relative intensities.")
  590. MAN_END
  591. MAN_BEGIN (U"Sound & FormantGrid: Filter", U"ppgb", 20080425)
  592. INTRO (U"A command to create a new Sound from the selected @Sound and @FormantGrid objects.")
  593. NORMAL (U"For examples, see @@Source-filter synthesis@.")
  594. NORMAL (U"The resulting Sound is scaled so that its maximum absolute amplitude is 0.99. "
  595. "If you don't want this, use @@Sound & FormantGrid: Filter (no scale)@ instead.")
  596. MAN_END
  597. MAN_BEGIN (U"Sound & FormantGrid: Filter (no scale)", U"ppgb", 20080425)
  598. INTRO (U"A command to create a new Sound from the selected @Sound and @FormantGrid objects.")
  599. NORMAL (U"For examples, see @@Source-filter synthesis@.")
  600. NORMAL (U"Unlike what happens in @@Sound & FormantGrid: Filter@, "
  601. "the resulting Sound is not scaled. This allows generation of a series "
  602. "of signals with controlled relative intensities.")
  603. MAN_END
  604. }
  605. /* End of file manual_formant.cpp */