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