manual_voice.cpp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. /* manual_voice.cpp
  2. *
  3. * Copyright (C) 1992-2007,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_voice_init (ManPages me);
  20. void manual_voice_init (ManPages me) {
  21. MAN_BEGIN (U"Voice", U"ppgb", 20061028)
  22. INTRO (U"This tutorial describes how you can do voice analysis with Praat. "
  23. "To understand this tutorial, you have to be familiar with the @Intro, "
  24. "which describes the more general features of the @SoundEditor window.")
  25. NORMAL (U"Most of Praat's voice analysis methods start from the glottal pulses that are visible in the @SoundEditor window "
  26. "as blue vertical lines through the waveform. If you do not see these lines, "
  27. "choose @@Show pulses@ from the #Pulses menu. If your sound is long, you may have to zoom in "
  28. "in order to see the separate pulses. You may notice that for some sounds, the time location of the pulses "
  29. "can vary when you zoom or scroll. This is because only the visible part of the sound is used for the analysis. "
  30. "The measurement results will also vary slightly when you zoom or scroll.")
  31. NORMAL (U"The Pulse menu contains the command @@Voice report@, which will show in the Info window "
  32. "the results of many voice measurements for the visible part of the selection "
  33. "(or for the visible part of the whole sound, if there is a cursor instead of a selection or if the selection is not visible).")
  34. ENTRY (U"Pitch settings")
  35. NORMAL (U"The results of the voice measurements will depend on your @@Pitch settings...|Pitch settings@. "
  36. "In general, you will want to be careful about the pitch range. The standard range is 75\\--600 Hertz, "
  37. "but take a range of e.g. 50\\--200 Hertz for pathological male voices if that is the typical range. "
  38. "You may also want to choose ##Optimize for voice analysis#; otherwise, the voice report will complain about possible inaccuracies. "
  39. "The `advanced' pitch settings like ##Silence threshold# and ##Octave jump cost# can stay at their standard values.")
  40. LIST_ITEM (U"@@Voice 1. Voice breaks@")
  41. LIST_ITEM (U"@@Voice 2. Jitter@")
  42. LIST_ITEM (U"@@Voice 3. Shimmer@")
  43. LIST_ITEM (U"@@Voice 4. Additive noise@ (HNR, harmonicity)")
  44. LIST_ITEM (U"@@Voice 5. Comparison with other programs@")
  45. LIST_ITEM (U"@@Voice 6. Automating voice analysis with a script@")
  46. MAN_END
  47. MAN_BEGIN (U"Voice 1. Voice breaks", U"ppgb", 20030916)
  48. INTRO (U"Normal voices can easily maintain phonation for some time when saying [a]. "
  49. "Some pathological voices have trouble with it. This can be measured in Praat "
  50. "in two ways.")
  51. ENTRY (U"Fraction of locally unvoiced pitch frames")
  52. NORMAL (U"This is the fraction of pitch frames that are analysed as unvoiced (MDVP calls it DUV). If the pitch floor is 75 Hz, "
  53. "your Sound editor window will contain pitch measurements that are 0.01 seconds apart, so that if you select one second, "
  54. "there will be 100 pitch frames. If 86 of these are locally voiced, the Fraction will be 14 percent.")
  55. NORMAL (U"The usual pitch analysis contains a %%path finder% that searches for a smooth path through the local "
  56. "pitch candidates. This path finder is temporarily switched off to determine the fraction of locally unvoiced frames. "
  57. "A frame is regarded as %locally unvoiced if it has a voicing strength below the %%voicing threshold% (whose standard value is 0.45), "
  58. "or a local peak below the %%silence threshold% (whose standard value is 0.03).")
  59. NORMAL (U"In the voice report, the fraction of unvoiced frames will be reported as follows:")
  60. CODE (U"Fraction of locally unvoiced frames: 14.000\\% (14/100)")
  61. NORMAL (U"The numbers between parentheses are the number of unvoiced frames and the total number of frames, "
  62. "respectively (in MDVP, these are called NUV and SEG, respectively).")
  63. NORMAL (U"The normative value for the fraction of unvoiced frames is 0, i.e., normal healthy voices should "
  64. "have no trouble maintaining voicing during a sustained vowel. Every non-zero value can be considered "
  65. "a sign of pathology (like a common cold). "
  66. "Naturally, you will not select the leading and trailing silences when measuring this parameter.")
  67. ENTRY (U"Number of voice breaks")
  68. NORMAL (U"The number of distances between consecutive pulses that are longer than 1.25 divided by the pitch floor. "
  69. "Thus, if the pitch floor is 75 Hz, all inter-pulse intervals longer than 16.6667 milliseconds are regarded as voice breaks.")
  70. ENTRY (U"Degree of voice breaks")
  71. NORMAL (U"This is the total duration of the breaks between the voiced parts of the signal, "
  72. "divided by the total duration of the analysed part of the signal (MDVP calls it DVB). Since silences at the beginning "
  73. "and the end of the signal are not considered breaks, you will probably not want to select these silences "
  74. "when measuring this parameter.")
  75. NORMAL (U"In the voice report, the degree of voice breaks will be reported like this:")
  76. CODE (U"Degree of voice breaks: 29.529\\% (1.163061 s / 3.938685 s)")
  77. NORMAL (U"The numbers between parentheses are the total duration of the voice breaks and the duration of the analysed part of the signal, "
  78. "respectively.")
  79. MAN_END
  80. MAN_BEGIN (U"Voice 2. Jitter", U"ppgb", 20110302)
  81. NORMAL (U"You can measure jitter in the Sound editor window, after choosing @@Show pulses@ from the #Pulses menu. "
  82. "You will see blue lines that can be thought of as representing the glottal closures. "
  83. "Use @@Voice report@ from the #Pulses menu to get the jitter in the selected part. "
  84. "You typically perform jitter measurements only on long sustained vowels.")
  85. NORMAL (U"The voice report gives five kinds of jitter measurements. "
  86. "All of these measurements are based on the computation of all %periods by the waveform-matching procedure "
  87. "(see @@Voice 6. Automating voice analysis with a script@), "
  88. "where the ##Period floor# setting is 0.8 divided by the pitch ceiling, "
  89. "the ##Period ceiling# setting is 1.25 divided by the pitch floor, "
  90. "and the ##Maximum period factor# is determined in @@Advanced pulses settings...@.")
  91. ENTRY (U"Jitter (local)")
  92. NORMAL (U"This is the average absolute difference between consecutive periods, divided by the average period. "
  93. "For the precise procedure, see @@PointProcess: Get jitter (local)...@.")
  94. NORMAL (U"MDVP calls this parameter %Jitt, and gives 1.040\\% as a threshold for pathology. "
  95. "As this number was based on jitter measurements influenced by noise (see @@Voice 5. Comparison with other programs@), the correct threshold is probably lower.")
  96. ENTRY (U"Jitter (local, absolute)")
  97. NORMAL (U"This is the average absolute difference between consecutive periods, in seconds. "
  98. "For the precise procedure, see @@PointProcess: Get jitter (local, absolute)...@.")
  99. NORMAL (U"MDVP calls this parameter %Jita, and gives 83.200 \\mus as a threshold for pathology. "
  100. "As this number was based on jitter measurements influenced by noise (see @@Voice 5. Comparison with other programs@), the correct threshold is probably lower.")
  101. ENTRY (U"Jitter (rap)")
  102. NORMAL (U"This is the Relative Average Perturbation, "
  103. "the average absolute difference between a period and the average of it and its two neighbours, divided by the average period. "
  104. "For the precise procedure, see @@PointProcess: Get jitter (rap)...@.")
  105. NORMAL (U"MDVP gives 0.680\\% as a threshold for pathology. "
  106. "As this number was based on jitter measurements influenced by noise (see @@Voice 5. Comparison with other programs@), the correct threshold is probably lower.")
  107. ENTRY (U"Jitter (ppq5)")
  108. NORMAL (U"This is the five-point Period Perturbation Quotient, "
  109. "the average absolute difference between a period and the average of it and its four closest neighbours, divided by the average period. "
  110. "For the precise procedure, see @@PointProcess: Get jitter (ppq5)...@.")
  111. NORMAL (U"MDVP calls this parameter %PPQ, and gives 0.840\\% as a threshold for pathology; "
  112. "as this number was based on jitter measurements influenced by noise (see @@Voice 5. Comparison with other programs@), the correct threshold is probably lower.")
  113. ENTRY (U"Jitter (ddp)")
  114. NORMAL (U"This is the average absolute difference between consecutive differences between consecutive periods, divided by the average period. "
  115. "For the precise procedure, see @@PointProcess: Get jitter (ddp)...@.")
  116. NORMAL (U"This is Praat's original ##Get jitter#. The value is three times RAP.")
  117. MAN_END
  118. MAN_BEGIN (U"Voice 3. Shimmer", U"ppgb", 20030521)
  119. NORMAL (U"You can measure shimmer in the Sound editor window, after choosing @@Show pulses@ from the #Pulses menu. "
  120. "You will see blue lines that can be thought of as representing the glottal closures. "
  121. "Use the Pulse menu to get the shimmer in the selected part. You typically perform shimmer measurements only on "
  122. "long sustained vowels. The voice report gives six kinds of shimmer measurements.")
  123. ENTRY (U"Shimmer (local)")
  124. NORMAL (U"This is the average absolute difference between the amplitudes of consecutive periods, divided by the average amplitude. "
  125. "MDVP calls this parameter %Shim, and gives 3.810\\% as a threshold for pathology.")
  126. ENTRY (U"Shimmer (local, dB)")
  127. NORMAL (U"This is the average absolute base-10 logarithm of the difference between the amplitudes of consecutive periods, multiplied by 20. "
  128. "MDVP calls this parameter %ShdB, and gives 0.350 dB as a threshold for pathology.")
  129. ENTRY (U"Shimmer (apq3)")
  130. NORMAL (U"This is the three-point Amplitude Perturbation Quotient, "
  131. "the average absolute difference between the amplitude of a period and the average of the amplitudes of its neighbours, "
  132. "divided by the average amplitude.")
  133. ENTRY (U"Shimmer (apq5)")
  134. NORMAL (U"This is the five-point Amplitude Perturbation Quotient, "
  135. "the average absolute difference between the amplitude of a period and the average of the amplitudes of it and its four closest neighbours, "
  136. "divided by the average amplitude.")
  137. ENTRY (U"Shimmer (apq11)")
  138. NORMAL (U"This is the 11-point Amplitude Perturbation Quotient, "
  139. "the average absolute difference between the amplitude of a period and the average of the amplitudes of it and its ten closest neighbours, "
  140. "divided by the average amplitude. "
  141. "MDVP calls this parameter %APQ, and gives 3.070\\% as a threshold for pathology.")
  142. ENTRY (U"Shimmer (ddp)")
  143. NORMAL (U"This is the average absolute difference between consecutive differences between the amplitudes of consecutive periods. "
  144. "This is Praat's original ##Get shimmer#. The value is three times APQ3.")
  145. MAN_END
  146. MAN_BEGIN (U"Voice 4. Additive noise", U"ppgb", 20021206)
  147. NORMAL (U"For a signal that can be assumed periodic (i.e., a sustained vowel), "
  148. "the signal-to-noise ratio equals the harmonics-to-noise ratio, which you get can get "
  149. "by selecting a Sound and choosing one of the \"To Harmonicity...\" commands from the Periodicity menu "
  150. "(for the algorithm, see @@Sound: To Harmonicity (ac)...@ or @@Sound: To Harmonicity (cc)...@). "
  151. "These are the world's most sensitive HNR measurements (up to 90 dB). "
  152. "For more information, see the @Harmonicity manual page.")
  153. MAN_END
  154. MAN_BEGIN (U"Voice 5. Comparison with other programs", U"ppgb", 20100330)
  155. INTRO (U"Voicing, jitter, and shimmer measurements made by Praat cannot always be compared directly with those made by other "
  156. "programs such as MDVP. The causes are the voicing decision strategy and the accuracy of period and peak determination.")
  157. ENTRY (U"5.1. Voicing decisions: slightly different")
  158. NORMAL (U"Different programs use very different methods for deciding whether an irregular part of the signal is voiced or not. "
  159. "A comparison of @@Boersma (1993)@ for Praat and @@Deliyski (1993)@ for MDVP leads to the "
  160. "following considerations. Both Praat and MDVP use an autocorrelation method for "
  161. "pitch analysis, but MDVP quantizes the amplitudes into the values -1, 0, and +1 before computing "
  162. "the autocorrelation, whereas Praat uses the original amplitude. Also, Praat corrects "
  163. "the autocorrelation function by dividing it by the autocorrelation function of the window, "
  164. "unlike any other program. Lastly, Praat uses sinc interpolation to compute an accurate "
  165. "estimate of the height of the autocorrelation peaks, unlike any other program. "
  166. "All three of these differences (and there are more) influence the measurement of the height "
  167. "of the autocorrelation peak at 1/F0. This height is generally taken as a criterion for voicing: "
  168. "if it is more than the %%voicing threshold% (which you can change with @@Pitch settings...@, "
  169. "the frame is considered voiced, otherwise voiceless. "
  170. "In Praat, the standard voicing threshold is 0.45, in MDVP it is 0.29, which suggests that MDVP "
  171. "tends to regard more frames as voiced than Praat. But the difference between these two numbers "
  172. "may partly be explained by the fact that MDVP does not correct the autocorrelation function and that MDVP "
  173. "does not do an accurate sinc interpolation: both of these properties cause "
  174. "the measured height of the peak at 1/F0 (in MDVP) to be lower than the real height, as explained by @@Boersma (1993)@.")
  175. ENTRY (U"5.2. Jitter measurements: sometimes very different")
  176. NORMAL (U"The jitter measures in various programs may yield different results, with Praat often giving much lower values than MDVP, "
  177. "especially for noisy sounds. I will now explain where the difference comes from. "
  178. "A more elaborate explanation with pictures is given in @@Boersma (2009a)@.")
  179. NORMAL (U"If a sound is computer-generated as a glottal source signal with a random period duration variation of 1 percent (around a constant F0), "
  180. "then filtered with the characteristics of a vocal tract configuration corresponding to a sustained vowel, "
  181. "both Praat and MDVP will measure this sound as having a \"jitter\" of 1 percent. "
  182. "For non-noisy jittery sginals, therefore, the two programs give equally accurate results.")
  183. NORMAL (U"If a sound is computer-generated as a glottal source signal with a constant period, "
  184. "then filtered with the characteristics of a vocal tract configuration corresponding to a sustained vowel, "
  185. "both Praat and MDVP will measure this sound as having a \"jitter\" of less than 0.01 percent. "
  186. "The two programs, therefore, have a comparable sensitivity in measuring small jitter values.")
  187. NORMAL (U"So far, the two programs give comparable results. The difference between the two programs comes when noise is added.")
  188. NORMAL (U"If a sound is computer-generated as a glottal source signal with a constant period, "
  189. "then filtered with the characteristics of a vocal tract configuration corresponding to a sustained vowel, "
  190. "and if then 1 percent additive \"white\" noise (a quite usual amount) is added, "
  191. "Praat will measure this sound as having a \"jitter\" of 0.02 percent, "
  192. "whereas MDVP will measure this sound as having a \"jitter\" of 0.6 percent. "
  193. "In other words, Praat will tell you that there is almost no jitter, "
  194. "whereas MDVP will tell you that the jitter is of an almost pathological level. "
  195. "The relevant curves can be seen in my papers \"Stemmen meten met Praat\" and @@Boersma (2009a)@, "
  196. "and the numbers are confirmed by Deliyski, Shaw & Evans (%%Journal of Voice%, 2005: 23).")
  197. NORMAL (U"One can see that Praat's \"jitter\" measure attempts to separate the influence of period duration variation "
  198. "(which it reports as \"jitter\") from the influence of additive noise (which is does not report as \"jitter\"), "
  199. "and that MDVP's \"jitter\" measure combines the influence of period duration variation with the influence of additive noise "
  200. "(both of which it reports as \"jitter\").")
  201. NORMAL (U"The difference between Praat's and MDVP's jitter measures is due to a difference between the way in which periods are measured. "
  202. "Praat uses %%waveform-matching%, in which the duration of a period is determined by looking for best matching wave shapes "
  203. "(a \"cross-correlation\" maximum). MDVP uses %%peak-picking% instead, where the duration of a period is determined by "
  204. "measuring the time difference between two locally highest peaks in the wave form. The waveform-matching method "
  205. "averages away much of the influence of additive noise, whereas peak-picking is highly sensitive to additive noise. "
  206. "For detailed illustrations, see @@Boersma (2009a)@.")
  207. MAN_END
  208. MAN_BEGIN (U"Voice 6. Automating voice analysis with a script", U"ppgb", 20140421)
  209. INTRO (U"In a Praat script you usually do not want to raise a Sound window. "
  210. "Instead, you probably want to work with objects in the Objects window only. "
  211. "This page tells you how to do that for voice analysis.")
  212. ENTRY (U"1. Creating the pulses in the Objects window")
  213. NORMAL (U"The pulses you see as blue lines are a @PointProcess object. You can see this if "
  214. "you choose ##Extract visible pulses# from the #Pulses menu in the Sound window: "
  215. "a PointProcess object will appear in the list.")
  216. NORMAL (U"You can also create a PointProcess in the Objects window directly. To do this, "
  217. "select a Sound and choose @@Sound: To PointProcess (periodic, cc)...@ from the #Periodicity menu.")
  218. NORMAL (U"You can also do this in two steps. First you create a Pitch with "
  219. "@@Sound: To Pitch...@ or @@Sound: To Pitch (ac)...@ or @@Sound: To Pitch (cc)...@. "
  220. "Then you select the resulting Pitch %together with the original Sound "
  221. "and choose @@Sound & Pitch: To PointProcess (cc)@.")
  222. NORMAL (U"Since the direct method of @@Sound: To PointProcess (periodic, cc)...@ actually uses the AC method "
  223. "for computing the Pitch (which is optimal for intonation analysis), "
  224. "you may prefer the two-step version if your goal is to do voice analysis. "
  225. "In that case, you use @@Sound: To Pitch (cc)...@ as the first step, "
  226. "and @@Sound & Pitch: To PointProcess (cc)@ as the second step. "
  227. "This is also how the Sound window does it: if you choose ##Optimize for voice analysis# in the @@Pitch settings...|Pitch settings@, "
  228. "Praat uses @@Sound: To Pitch (cc)...@ for pitch analysis.")
  229. NORMAL (U"What you should %not do if you want to perform voice analysis is to create the PointProcess "
  230. "by selecting a Pitch only and then choosing @@Pitch: To PointProcess@. In that way, "
  231. "the resulting pulses would not be aligned to the periods in the Sound.")
  232. ENTRY (U"2. Measuring jitter from a script")
  233. NORMAL (U"Once you have a PointProcess that represents the periods in the Sound, "
  234. "you can select it and choose some ##Get jitter# commands from the #Query menu.")
  235. ENTRY (U"3. Measuring shimmer from a script")
  236. NORMAL (U"Once you have a PointProcess that represents the periods in the Sound, "
  237. "you can select it together with the Sound, then choose some ##Get shimmer# commands from the #Query menu.")
  238. ENTRY (U"4. Getting the whole voice report from a script")
  239. NORMAL (U"If you select the Sound, the Pitch, and the PointProcess together (all three), "
  240. "there will be a button that says ##Voice report...#. If you press it, the voice report "
  241. "will be written to the Info window. This is identical to the voice report in the Sound window, "
  242. "although you will have to specify the time range by manually typing it.")
  243. NORMAL (U"In a script, you can get the jitter and shimmer from the voice report by doing something like:")
  244. CODE (U"voiceReport\\$ = Voice report: 0, 0, 75, 500, 1.3, 1.6, 0.03, 0.45")
  245. CODE (U"jitter = extractNumber (voiceReport\\$ , \"Jitter (local): \")")
  246. CODE (U"shimmer = extractNumber (voiceReport\\$ , \"Shimmer (local): \")")
  247. CODE (U"writeInfoLine: \"Jitter = \", percent\\$ (jitter, 3), \", shimmer = \", percent\\$ (shimmer, 3)")
  248. ENTRY (U"5. Disadvantage of automating voice analysis")
  249. NORMAL (U"In all the commands mentioned above, you have to guess the time range, "
  250. "and you would usually supply \"0.0\" and \"0.0\", in which case "
  251. "you will get the average jitter and shimmer for the whole sound. "
  252. "This may include parts of the sound that you are often not interested in, such as false starts. "
  253. "You do not have these problems when asking for a voice report in the sound window, "
  254. "because there you would make an explicit time selection by hand after judging what part of the sound is relevant.")
  255. MAN_END
  256. MAN_BEGIN (U"Voice report", U"ppgb", 20030316)
  257. INTRO (U"A command in the #Pulses menu that will write to the Info window an extensive report "
  258. "about many voice parameters. See the @Voice tutorial.")
  259. MAN_END
  260. }
  261. /* End of file manual_voice.cpp */