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