Debian Codegraph @

fon/manual_pitch.cpp

raw symbols SCIP
1 /* manual_pitch.cpp
2 *
3 * Copyright (C) 1992-2007,2010,2011,2015-2017,2020-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"
20
21 void manual_pitch_init (ManPages me);
22 void manual_pitch_init (ManPages me) {
23
24 MAN_BEGIN (U"Create PitchTier...", U"ppgb", 20110101)
25 INTRO (U"A command in the @@New menu@ to create an empty @PitchTier object.")
26 NORMAL (U"The resulting object will have the specified name and time domain, but contain no pitch points. "
27 "To add some points to it, use @@PitchTier: Add point...@.")
28 NORMAL (U"For an example, see @@Source-filter synthesis@.")
29 MAN_END
30
31 MAN_BEGIN (U"Harmonicity", U"ppgb", 20030610)
32 INTRO (U"One of the @@types of objects@ in Praat.")
33 NORMAL (U"A Harmonicity object represents the degree of acoustic periodicity, "
34 "also called Harmonics-to-Noise Ratio (HNR). "
35 "Harmonicity is expressed in dB: "
36 "if 99\\% of the energy of the signal is in the periodic part, and 1\\% is noise, "
37 "the HNR is 10*log10(99/1) = 20 dB. "
38 "A HNR of 0 dB means that there is equal energy in the harmonics and in the noise.")
39 NORMAL (U"Harmonicity can be used as a measure for:")
40 LIST_ITEM (U"\\bu The signal-to-noise ratio of anything that generates a periodic signal.")
41 LIST_ITEM (U"\\bu Voice quality. For instance, a healthy speaker can produce a sustained [a] or [i] "
42 "with a harmonicity of around 20 dB, and an [u] at around 40 dB; "
43 "the difference comes from the high frequencies in [a] and [i], versus low frequencies in [u], "
44 "resulting in a much higher sensitivity of HNR to jitter in [a] and [i] than in [u]. "
45 "Hoarse speakers will have an [a] with a harmonicity much lower than 20 dB. "
46 "We know of a pathological case where a speaker had an HNR of 40 dB for [i], "
47 "because his voice let down above 2000 Hz.")
48 ENTRY (U"Harmonicity commands")
49 NORMAL (U"Creation:")
50 LIST_ITEM (U"\\bu @@Sound: To Harmonicity (cc)...@: cross-correlation method (preferred).")
51 LIST_ITEM (U"\\bu @@Sound: To Harmonicity (ac)...@: autocorrelation method.")
52 MAN_END
53
54 MAN_BEGIN (U"Harmonicity: Formula...", U"ppgb", 20021206)
55 INTRO (U"A command for changing the data in all selected @Harmonicity objects.")
56 NORMAL (U"See the @Formulas tutorial for examples and explanations.")
57 MAN_END
58
59 MAN_BEGIN (U"Harmonicity: Get maximum...", U"ppgb", 20200912)
60 INTRO (U"A @@Query submenu|query@ to the selected @Harmonicity object.")
61 ENTRY (U"Return value")
62 NORMAL (U"the maximum value, expressed in dB.")
63 ENTRY (U"Settings")
64 TERM (U"##From time (s)")
65 TERM (U"##To time (s)")
66 DEFINITION (U"the selected time domain. Values outside this domain are ignored. "
67 "If ##To time# is not greater than ##From time#, the entire time domain of the Harmonicity object is considered.")
68 TERM (U"##Interpolation")
69 DEFINITION (U"the interpolation method (#none, #parabolic, #cubic, #sinc, #sinc700) of the @@vector peak interpolation@. "
70 "The standard is Parabolic because of the usual nonlinearity (logarithm) in the computation of harmonicity; "
71 "sinc interpolation would be too stiff and may give unexpected results.")
72 MAN_END
73
74 MAN_BEGIN (U"Harmonicity: Get mean...", U"ppgb", 20041107)
75 INTRO (U"A @@Query submenu|query@ to the selected @Harmonicity object.")
76 ENTRY (U"Return value")
77 NORMAL (U"the mean value, expressed in dB.")
78 ENTRY (U"Setting")
79 TERM (U"##Time range (s)")
80 DEFINITION (U"the time range (%t__1_, %t__2_). Values outside this range are ignored. "
81 "If %t__1_ is not less than %t__2_, the entire time domain of the Harmonicity is considered.")
82 ENTRY (U"Algorithm")
83 NORMAL (U"The mean harmonicity between the times %t__1_ and %t__2_ is defined as")
84 EQUATION (U"1/(%t__2_ - %t__1_) \\in__%%t%1_^^%%t%2^ %dt %x(%t)")
85 NORMAL (U"where %x(%t) is the harmonicity (in dB) as a function of time. "
86 "Frames in which the value is undefined (i.e. in silent intervals) "
87 "are ignored. If all the frames are silent, the returned value is @undefined.")
88 MAN_END
89
90 MAN_BEGIN (U"Harmonicity: Get minimum...", U"ppgb", 20200912)
91 INTRO (U"A @@Query submenu|query@ to the selected @Harmonicity object.")
92 ENTRY (U"Return value")
93 NORMAL (U"the minimum value, expressed in dB.")
94 ENTRY (U"Settings")
95 TERM (U"##Time range (s)")
96 DEFINITION (U"the time range (%t__1_, %t__2_). Values outside this range are ignored, except for purposes of interpolation. "
97 "If %t__1_ is not less than %t__2_, the entire time domain of the Harmonicity is considered.")
98 TERM (U"##Interpolation")
99 DEFINITION (U"the interpolation method (#none, #parabolic, #cubic, #sinc70, #sinc700) of the @@vector peak interpolation@. "
100 "The standard is Parabolic because of the usual nonlinearity (logarithm) in the computation of harmonicity; "
101 "sinc interpolation would be too stiff and may give unexpected results.")
102 MAN_END
103
104 MAN_BEGIN (U"Harmonicity: Get standard deviation...", U"ppgb", 20041107)
105 INTRO (U"A @@Query submenu|query@ to the selected @Harmonicity object.")
106 ENTRY (U"Return value")
107 NORMAL (U"the standard deviation, expressed in dB.")
108 ENTRY (U"Setting")
109 TERM (U"##Time range (s)")
110 DEFINITION (U"the time range (%t__1_, %t__2_). Values outside this range are ignored. "
111 "If %t__1_ is not less than %t__2_, the entire time domain of the Harmonicity is considered.")
112 ENTRY (U"Algorithm")
113 NORMAL (U"The standard deviation between the times %t__1_ and %t__2_ is defined as")
114 EQUATION (U"1/(%t__2_ - %t__1_) \\in__%%t%1_^^%%t%2^ %dt (%x(%t) - %\\mu)^2")
115 NORMAL (U"where %x(%t) is the harmonicity (in dB) as a function of time, and %\\mu its mean. "
116 "For our discrete Harmonicity object, the standard deviation is approximated by")
117 EQUATION (U"1/(%n-1) \\su__%i=%m..%m+%n-1_ (%x__%i_ - %\\mu)^2")
118 NORMAL (U"where %n is the number of frame centres between %t__1_ and %t__2_. Note the \"minus 1\".")
119 MAN_END
120
121 MAN_BEGIN (U"Harmonicity: Get time of maximum...", U"ppgb", 20200912)
122 INTRO (U"A @@Query submenu|query@ to the selected @Harmonicity object for the time associated with its maximum value.")
123 ENTRY (U"Return value")
124 NORMAL (U"the time (in seconds) associated with the maximum HNR value.")
125 ENTRY (U"Settings")
126 TERM (U"##Time range (s)")
127 DEFINITION (U"the time range (%t__1_, %t__2_). Values outside this range are ignored, except for purposes of interpolation. "
128 "If %t__1_ is not less than %t__2_, the entire time domain of the Harmonicity is considered.")
129 TERM (U"##Interpolation")
130 DEFINITION (U"the interpolation method (#none, #parabolic, #cubic, #sinc70, #sinc700) of the @@vector peak interpolation@. "
131 "The standard is Parabolic because of the usual nonlinearity (logarithm) in the computation of harmonicity; "
132 "sinc interpolation would be too stiff and may give unexpected results.")
133 MAN_END
134
135 MAN_BEGIN (U"Harmonicity: Get time of minimum...", U"ppgb", 20200912)
136 INTRO (U"A @@Query submenu|query@ to the selected @Harmonicity object.")
137 ENTRY (U"Return value")
138 NORMAL (U"the time (in seconds) associated with the minimum HNR value.")
139 ENTRY (U"Settings")
140 TERM (U"##Time range (s)")
141 DEFINITION (U"the time range (%t__1_, %t__2_). Values outside this range are ignored, except for purposes of interpolation. "
142 "If %t__1_ is not less than %t__2_, the entire time domain of the Harmonicity is considered.")
143 TERM (U"##Interpolation")
144 DEFINITION (U"the interpolation method (#none, #parabolic, #cubic, #sinc70, #sinc700) of the @@vector peak interpolation@. "
145 "The standard is Parabolic because of the usual nonlinearity (logarithm) in the computation of harmonicity; "
146 "sinc interpolation would be too stiff and may give unexpected results.")
147 MAN_END
148
149 MAN_BEGIN (U"Harmonicity: Get value at time...", U"ppgb", 20041107)
150 INTRO (U"A @@Query submenu|query@ to the selected @Harmonicity object to .")
151 ENTRY (U"Return value")
152 NORMAL (U"an estimate (in dB) of the value at a specified time. "
153 "If this time is outside the time domain or outside the samples of the Harmonicity, the result is @undefined.")
154 ENTRY (U"Settings")
155 TERM (U"##Time (s)")
156 DEFINITION (U"the time at which the value is to be evaluated.")
157 TERM (U"##Interpolation")
158 DEFINITION (U"the interpolation method, see @@vector value interpolation@. "
159 "The standard is “cubic” because of the usual nonlinearity (logarithm) in the computation of harmonicity; "
160 "sinc interpolation would be too stiff and may give unexpected results.")
161 MAN_END
162
163 MAN_BEGIN (U"Harmonicity: Get value in frame...", U"ppgb", 20041107)
164 INTRO (U"A @@Query submenu|query@ to the selected @Harmonicity object.")
165 ENTRY (U"Return value")
166 NORMAL (U"the value in a specified frame, expressed in dB. "
167 "If the index is less than 1 or greater than the number of frames, the result is @undefined.")
168 ENTRY (U"Setting")
169 TERM (U"##Frame number")
170 DEFINITION (U"the frame whose value is to be looked up.")
171 MAN_END
172
173 MAN_BEGIN (U"Pitch", U"ppgb", 20240722) // 20101230, 20231115
174 INTRO (U"One of the @@types of objects@ in Praat. For tutorial information, see @@Intro 4. Pitch analysis@.")
175 NORMAL (U"A Pitch object represents periodicity candidates as a function of time. "
176 "It does not mind whether this periodicity refers to acoustics, "
177 "perception, or vocal-cord vibration. "
178 "It is sampled into a number of %frames centred around equally spaced times.")
179 ENTRY (U"Pitch commands")
180 NORMAL (U"Creation:")
181 LIST_ITEM (U"\\bu @@Sound: To Pitch (filtered autocorrelation)...@: for intonation and vocal-fold vibration")
182 LIST_ITEM (U"\\bu @@Sound: To Pitch (raw cross-correlation)...@: for voice analysis")
183 LIST_ITEM (U"\\bu @@Sound: To Pitch (raw autocorrelation)...@: for raw periodicity")
184 LIST_ITEM (U"\\bu @@Sound: To Pitch (filtered cross-correlation)...@")
185 NORMAL (U"Drawing:")
186 LIST_ITEM (U"\\bu @@Pitch: Draw...@")
187 NORMAL (U"Viewing and editing:")
188 LIST_ITEM (U"\\bu @PitchEditor")
189 NORMAL (U"Synthesis:")
190 LIST_ITEM (U"\\bu @@Pitch: To PointProcess@: create points in voiced intervals.")
191 LIST_ITEM (U"\\bu @@Sound & Pitch: To PointProcess (cc)@: near locations of high amplitude.")
192 LIST_ITEM (U"\\bu @@Sound & Pitch: To PointProcess (peaks)...@: near locations of high amplitude.")
193 NORMAL (U"Conversion:")
194 LIST_ITEM (U"\\bu @@Pitch: To PitchTier@: time-stamp voiced intervals.")
195 LIST_ITEM (U"\\bu @@Pitch & PointProcess: To PitchTier...@: interpolate values at specified times.")
196 ENTRY (U"Inside a Pitch object")
197 NORMAL (U"With @Inspect, you will see the following attributes:")
198 TERM (U"%x__%min_")
199 DEFINITION (U"start time, in seconds.")
200 TERM (U"%x__%max_")
201 DEFINITION (U"end time, in seconds.")
202 TERM (U"%n__%x_")
203 DEFINITION (U"the number of frames (\\>_ 1).")
204 TERM (U"%dx")
205 DEFINITION (U"time step = frame length = frame duration, in seconds.")
206 TERM (U"%x__1_")
207 DEFINITION (U"the time associated with the first frame, in seconds. "
208 "This will usually be in the range [%xmin, %xmax]. "
209 "The time associated with the last frame (i.e., %x__1_ + (%n__%x_ \\-- 1) %dx)) "
210 "will also usually be in that range.")
211 TERM (U"%ceiling")
212 DEFINITION (U"a frequency above which a candidate is considered voiceless.")
213 TERM (U"%frame__%i_, %i = 1 ... %n__%x_")
214 DEFINITION (U"the frames (see below).")
215 ENTRY (U"Attributes of a pitch frame")
216 NORMAL (U"Each frame contains the following attributes:")
217 TERM (U"%nCandidates")
218 DEFINITION (U"the number of candidates in this frame (at least one: the “unvoiced” candidate).")
219 TERM (U"%candidate__%j_, %j = 1 ... %nCandidates")
220 DEFINITION (U"the information about each candidate (see below).")
221 ENTRY (U"Attributes of each candidate")
222 NORMAL (U"Each candidate contains the following attributes:")
223 TERM (U"%frequency")
224 DEFINITION (U"the candidate's frequency in Hz (for a voiced candidate), or 0 (for an unvoiced candidate).")
225 TERM (U"%strength")
226 DEFINITION (U"the degree of periodicity of this candidate (between 0 and 1).")
227 ENTRY (U"Interpretation")
228 NORMAL (U"The current pitch contour is determined by the path through all first candidates. "
229 "If the first candidate of a certain frame has a frequency of 0, "
230 "or a frequency above %ceiling, this frame is considered voiceless.")
231 MAN_END
232
233 MAN_BEGIN (U"Pitch: Draw...", U"ppgb", 19960910)
234 INTRO (U"A command for drawing the selected @Pitch objects into the @@Picture window@.")
235 ENTRY (U"Settings")
236 TERM (U"##From time (s)")
237 TERM (U"##To time (seconds)")
238 DEFINITION (U"the time domain along the horizontal axis. "
239 "If these are both zero, the time domain of the #Pitch itself is taken (autowindowing).")
240 TERM (U"##Minimum frequency (Hz)")
241 TERM (U"##Maximum frequency (Hz)")
242 DEFINITION (U"the frequency range along the vertical axis. "
243 "##Maximum frequency# must be greater than ##Minimum frequency#.")
244 ENTRY (U"Behaviour")
245 NORMAL (U"In unvoiced frames, nothing will be drawn.")
246 NORMAL (U"In voiced frames, the pitch frequency associated with the frame "
247 "is thought to represent the time midpoint of the frame, "
248 "but frequencies will be drawn at all time points in the frame, as follows:")
249 LIST_ITEM (U"\\bu If two adjacent frames are both voiced, the frequency of the time points between the midpoints "
250 "of the frames is linearly interpolated from both midpoints.")
251 LIST_ITEM (U"\\bu If a voiced frame is adjacent to another voiced frame on one side, "
252 "and to a voiceless frame on the other side, "
253 "the frequencies in the half-frame on the unvoiced side will be linearly extrapolated "
254 "from the midpoints of the two voiced frames involved.")
255 LIST_ITEM (U"\\bu If a voiced frame is adjacent to two unvoiced frames, "
256 "a horizontal line segment will be drawn at the frequency of the midpoint.")
257 MAN_END
258
259 /*
260 F0beg = Get value at time... tbeg Hertz Linear
261 while F0beg = undefined
262 tbeg = tbeg + 0.01
263 F0beg = Get value at time... tbeg Hertz Linear
264 endwhile
265 */
266
267 MAN_BEGIN (U"Pitch: Interpolate", U"ppgb", 19990811)
268 INTRO (U"A command that converts every selected @Pitch object.")
269 /*
270 myID = selected ("Pitch")
271 tmin = Get start time
272 tmax = Get end time
273 numberOfFrames = Get number of frames
274 timeStep = Get time step
275 t1 = Get time of frame... 1
276 ceiling = Get ceiling
277 Create Pitch... interpolated tmin tmax numberOfFrames timeStep t1 ceiling 2
278 for iframe to numberOfFrames
279 select 'myID'
280 f = Get frequency... iframe 1
281 if f > 0.0 and f < ceiling
282 # The frame is voiced? Copy the frequency.
283 select Pitch interpolated
284 Set frequency... iframe 1 f
285 else
286 # The frame is unvoiced? Interpolate the frequency.
287 fleft = 0.0
288 fright = 0.0
289 # Find nearest voiced frame to the left.
290 left = iframe - 1
291 while left >= 1 and fleft = 0.0
292 fleft = Get frequency... left 1
293 if fleft >= ceiling
294 fleft = 0.0
295 endif
296 left = left - 1
297 endwhile
298 # Find nearest voiced frame to the right.
299 right = iframe + 1
300 while right <= numberOfFrames and fright = 0.0
301 fright = Get frequency... right 1
302 if fright >= ceiling
303 fright = 0.0
304 endif
305 right = right + 1
306 endwhile
307 if fleft <> 0 and fright <> 0
308 select Pitch interpolated
309 Set frequency... iframe 1 ((iframe - left) * fright + (right - iframe) * fleft) / (right - left)
310 endif
311 endif
312 select Pitch interpolated
313 Set strength... iframe 1 0.9
314 endfor
315 select Pitch interpolated
316 */
317 MAN_END
318
319 MAN_BEGIN (U"Pitch: Smooth...", U"ppgb", 19990811)
320 INTRO (U"A command that converts every selected @Pitch object.")
321 MAN_END
322
323 MAN_BEGIN (U"Pitch: To PitchTier", U"ppgb", 19960915)
324 INTRO (U"A command that converts a @Pitch object into a @PitchTier object.")
325 ENTRY (U"Algorithm")
326 NORMAL (U"The #PitchTier object will contain as many points as there were voiced frames in the #Pitch.")
327 NORMAL (U"The %time of each point is the time associated with the centre of the corresponding %frame "
328 "of the #Pitch contour. The %frequency of the point is the pitch frequency associated in this frame "
329 "with the current path through the candidates.")
330 MAN_END
331
332 MAN_BEGIN (U"Pitch: To PointProcess", U"ppgb", 19960917)
333 INTRO (U"A command that uses a @Pitch object to generate a @PointProcess.")
334 ENTRY (U"Purpose")
335 NORMAL (U"to interpret an acoustic periodicity contour as the frequency of an underlying point process "
336 "(such as the sequence of glottal closures in vocal-fold vibration).")
337 ENTRY (U"Algorithm")
338 LIST_ITEM (U"1. A @PitchTier is created with @@Pitch: To PitchTier@.")
339 LIST_ITEM (U"2. The algorithm of @@PitchTier: To PointProcess@ generates points along the entire time domain "
340 "of the PitchTier.")
341 LIST_ITEM (U"3. The PitchTier is removed (it never appeared in the List of Objects).")
342 LIST_ITEM (U"4. The voiced/unvoiced information in the Pitch is used to remove all points "
343 "that lie within voiceless frames.")
344 MAN_END
345
346 MAN_BEGIN (U"Pitch & PointProcess: To PitchTier...", U"ppgb", 20101230)
347 INTRO (U"A command that creates a @PitchTier object from one selected @Pitch and one selected @PointProcess object.")
348 ENTRY (U"Purpose")
349 NORMAL (U"to return the frequencies in the Pitch contour at the times specified by the PointProcess.")
350 ENTRY (U"Setting")
351 TERM (U"##Check voicing# (standard: on)")
352 DEFINITION (U"determines whether, if the time of a mark is not within a voiced frame, you will get a message like "
353 "\"No periodicity at time %xxx.\", and no PitchTier is created. If this button is off, "
354 "the resulting pitch frequency will be 0.0 Hz.")
355 ENTRY (U"Normal behaviour")
356 NORMAL (U"For all the times in the PointProcess, a pitch frequency is computed from the "
357 "information in the Pitch, by linear interpolation.")
358 NORMAL (U"All the resulting time-frequency pairs are put in a new PitchTier object.")
359 NORMAL (U"The time domain of the resulting PitchTier is a union of the domains of the original Pitch "
360 "and PointProcess functions.")
361 MAN_END
362
363 MAN_BEGIN (U"PitchEditor", U"ppgb", /*20110808 20220814 20231115*/ 20240722)
364 INTRO (U"One of the @Editors in Praat, for viewing and modifying a @Pitch object.")
365 ENTRY (U"What the Pitch editor shows")
366 NORMAL (U"In the window of the PitchEditor, you will see the following features:")
367 LIST_ITEM (U"\\bu Digits between 0 and 9 scattered all over the drawing area. Their locations represent "
368 "the pitch %#candidates, of which there are several for every time frame. The digits themselves "
369 "represent the goodness of a candidate, multiplied by ten. For instance, if you see a \"9\" "
370 "at the location (1.23 seconds, 189 hertz), this means that in the time frame at 1.23 seconds, "
371 "there is a pitch candidate with a value of 189 hertz, and its goodness is 0.9. "
372 "The number 0.9 may be the relative height of an autocorrelation peak, a cross-correlation peak, "
373 "or a spectral peak, depending on the method by which the Pitch object was computed.")
374 LIST_ITEM (U"\\bu A %#path of red disks. These disks represent the best path through the candidates, "
375 "i.e. our best guess at what the pitch contour is. The path will usually have been determined "
376 "by the %%path finder%, which was called by the pitch-extraction algorithm, and you can change "
377 "the path manually. The path finder takes into account the goodness of each candidate, "
378 "the intensity of the sound in the frame, voiced-unvoiced transitions, and frequency jumps. "
379 "It also determines whether each frame is voiced or unvoiced.")
380 LIST_ITEM (U"\\bu A %%##voicelessness bar%# at the bottom of the drawing area. If there is no suitable "
381 "pitch candidate in a frame, the frame is considered voiceless, which is shown as a blue rectangle "
382 "in the voicelessness bar.")
383 LIST_ITEM (U"\\bu A line of digits between 0 and 9 along the top. These represent the relative intensity "
384 "of the sound in each frame.")
385 ENTRY (U"Moving the marks")
386 NORMAL (U"To move the cursor hair or the beginning or end of the selection, "
387 "use the @@time selection@ mechanism.")
388 ENTRY (U"Changing the path")
389 NORMAL (U"To change the path through the candidates manually, click on the candidates of your choice. "
390 "The changes will immediately affect the Pitch object that you are editing. To make a voiced frame "
391 "voiceless, click in the voicelessness bar.")
392 NORMAL (U"To change the path automatically, choose ##Path finder...# from the #Edit menu; "
393 "this will have the same effect as filling in different values in "
394 "the @@Sound: To Pitch (filtered autocorrelation)...@ or @@Sound: To Pitch (raw autocorrelation)...@ command window, "
395 "but is much faster because the candidates do not have to be determined again.")
396 ENTRY (U"Resynthesis")
397 NORMAL (U"To hum any part of the pitch contour, click one of the buttons "
398 "below or above the data area (there can be 1 to 8 of these buttons), or use a command from the #Play menu.")
399 ENTRY (U"Changing the ceiling")
400 NORMAL (U"To change the ceiling, but not the path, choose ##Change ceiling...# from the #Edit menu; "
401 "if the new ceiling is lower than the old ceiling, some formerly voiced frames may become unvoiced; "
402 "if the new ceiling is higher than the old ceiling, some formerly unvoiced frames may become voiced.")
403 MAN_END
404
405 MAN_BEGIN (U"PitchTier", U"ppgb", 20101230) // 20251229
406 INTRO (U"One of the @@types of objects@ in Praat. "
407 "A PitchTier object represents a time-stamped pitch contour, "
408 "i.e. it contains a number of (%time, %pitch) points, without voiced/unvoiced information. "
409 "For instance, if your PitchTier contains two points, namely 150 Hz at a time of 0.5 seconds and "
410 "200 Hz at a time of 1.5 seconds, then this is to be interpreted as a pitch contour that "
411 "is constant at 150 Hz for all times before 0.5 seconds, constant at 200 Hz for all times after 1.5 seconds, "
412 "and linearly interpolated for all times between 0.5 and 1.5 seconds (i.e. 160 Hz at 0.7 seconds, "
413 "180 Hz at 1.1 seconds, and so on).")
414 NORMAL (U"PitchTier objects are used for two purposes: "
415 "for manipulating the pitch curve of an existing sound "
416 "(see @@Intro 8.1. Manipulation of pitch@) "
417 "and for synthesizing a new sound "
418 "(see @@Source-filter synthesis 1. Creating a source from pitch targets@, "
419 "and for an example @@Source-filter synthesis 3. The ba-da continuum@).")
420 ENTRY (U"PitchTier commands")
421 NORMAL (U"Creation:")
422 LIST_ITEM (U"From scratch:")
423 LIST_ITEM (U"\\bu @@Create PitchTier...")
424 LIST_ITEM (U"\\bu @@PitchTier: Add point...")
425 LIST_ITEM (U"Copy from another object:")
426 LIST_ITEM (U"\\bu @@Pitch: To PitchTier@: trivial copying of voiced frames.")
427 LIST_ITEM (U"\\bu @@PointProcess: Up to PitchTier...@: single value at specified times.")
428 LIST_ITEM (U"\\bu @@Pitch & PointProcess: To PitchTier...@: copying interpolated values at specified points.")
429 LIST_ITEM (U"Synthesize from another object:")
430 LIST_ITEM (U"\\bu @@PointProcess: To PitchTier...@: periodicity analysis.")
431 LIST_ITEM (U"Extract from a @Manipulation object:")
432 LIST_ITEM (U"\\bu @@Manipulation: Extract pitch tier@")
433 NORMAL (U"Viewing and editing:")
434 LIST_ITEM (U"\\bu @PitchTierEditor: with or without a Sound.")
435 LIST_ITEM (U"\\bu @ManipulationEditor")
436 NORMAL (U"Conversion:")
437 LIST_ITEM (U"\\bu @@PitchTier: Down to PointProcess@: copy the times.")
438 NORMAL (U"Synthesis:")
439 LIST_ITEM (U"\\bu @@PitchTier: To PointProcess@: area-1 pulse generation (used in @@overlap-add@).")
440 LIST_ITEM (U"\\bu @@Manipulation: Replace pitch tier@")
441 NORMAL (U"Queries:")
442 LIST_ITEM (U"\\bu @@time domain")
443 LIST_ITEM (U"\\bu @@Get low index from time...")
444 LIST_ITEM (U"\\bu @@Get high index from time...")
445 LIST_ITEM (U"\\bu @@Get nearest index from time...")
446 LIST_ITEM (U"\\bu @@PitchTier: Get mean (curve)...")
447 LIST_ITEM (U"\\bu @@PitchTier: Get mean (points)...")
448 LIST_ITEM (U"\\bu @@PitchTier: Get standard deviation (curve)...")
449 LIST_ITEM (U"\\bu @@PitchTier: Get standard deviation (points)...")
450 LIST_ITEM (U"\\bu @@Get area...@: the number of periods")
451 NORMAL (U"Modification:")
452 LIST_ITEM (U"\\bu @@Remove point...")
453 LIST_ITEM (U"\\bu @@Remove point near...")
454 LIST_ITEM (U"\\bu @@Remove points between...")
455 LIST_ITEM (U"\\bu @@PitchTier: Add point...")
456 LIST_ITEM (U"\\bu @@PitchTier: Stylize...")
457 MAN_END
458
459 MAN_BEGIN (U"PitchTier: Add point...", U"ppgb", 20010410)
460 INTRO (U"A command to add a point to each selected @PitchTier.")
461 ENTRY (U"Settings")
462 TERM (U"##Time (s)")
463 DEFINITION (U"the time at which a point is to be added.")
464 TERM (U"##Pitch (Hz)")
465 DEFINITION (U"the pitch value of the requested new point.")
466 ENTRY (U"Behaviour")
467 NORMAL (U"The tier is modified so that it contains the new point. "
468 "If a point at the specified time was already present in the tier, nothing happens.")
469 MAN_END
470
471 MAN_BEGIN (U"PitchTier: Down to PointProcess", U"ppgb", 20010410)
472 INTRO (U"A command to degrade every selected @PitchTier to a @PointProcess.")
473 ENTRY (U"Behaviour")
474 NORMAL (U"The times of all the pitch points are trivially copied, and so is the time domain. The pitch information is lost.")
475 MAN_END
476
477 MAN_BEGIN (U"PitchTier: Get mean (curve)...", U"ppgb", 20170618)
478 INTRO (U"A @@Query submenu|query@ to the selected @PitchTier object.")
479 ENTRY (U"Return value")
480 NORMAL (U"the mean of the curve within a specified time window.")
481 ENTRY (U"Settings")
482 TERM (U"##From time (s)")
483 TERM (U"##To time (s)")
484 DEFINITION (U"the time window, in seconds. Values outside this window are ignored. "
485 "If ##To time# is not greater than ##From time#, the entire time domain of the tier is considered.")
486 ENTRY (U"Algorithm")
487 NORMAL (U"The curve consists of a sequence of line segments. The contribution of the line segment from "
488 "(%t__1_, %f__1_) to (%t__2_, %f__2_) to the area under the curve is")
489 EQUATION (U"1/2 (%f__1_ + %f__2_) (%t__2_ \\-- %t__1_)")
490 NORMAL (U"The mean is the sum of these values divided by %toTime \\-- %fromTime.")
491 NORMAL (U"For a PitchTier that was created from a @Pitch object, this command gives the same result as "
492 "##Get mean....# for the original Pitch object (but remember that the median, "
493 "as available for Pitch objects, is more robust).")
494 NORMAL (U"To get the mean of the pitch points, i.e. not weighted by the durations of the line pieces, "
495 "Use @@PitchTier: Get mean (points)...@ instead.")
496 MAN_END
497
498 MAN_BEGIN (U"PitchTier: Get mean (points)...", U"ppgb", 20010821)
499 INTRO (U"A @@Query submenu|query@ to the selected @PitchTier object.")
500 ENTRY (U"Return value")
501 NORMAL (U"the mean of the points within a specified time window.")
502 ENTRY (U"Settings")
503 TERM (U"##From time (s)")
504 TERM (U"##To time (s)")
505 DEFINITION (U"the time window, in seconds. Values outside this window are ignored. "
506 "If ##To time# is not greater than ##From time#, the entire time domain of the tier is considered.")
507 NORMAL (U"To get the mean in the entire curve, i.e. weighted by the durations of the line pieces, "
508 "Use @@PitchTier: Get mean (curve)...@ instead.")
509 MAN_END
510
511 MAN_BEGIN (U"PitchTier: Get standard deviation (curve)...", U"ppgb", 20010821)
512 INTRO (U"A @@Query submenu|query@ to the selected @PitchTier object.")
513 ENTRY (U"Return value")
514 NORMAL (U"the standard deviation in the curve within a specified time window.")
515 ENTRY (U"Settings")
516 TERM (U"##From time (s)")
517 TERM (U"##To time (s)")
518 DEFINITION (U"the selected time domain. Values outside this domain are ignored. "
519 "If ##To time# is not greater than ##From time#, the entire time domain of the tier is considered.")
520 ENTRY (U"Algorithm")
521 NORMAL (U"The curve consists of a sequence of line segments. The contribution of the line segment from "
522 "(%t__1_, %f__1_) to (%t__2_, %f__2_) to the variance-multiplied-by-time is")
523 EQUATION (U"[ 1/4 (%f__1_ + %f__2_)^2 + 1/12 (%f__1_ \\-- %f__2_)^2 ] (%t__2_ \\-- %t__1_)")
524 NORMAL (U"The standard deviation is the square root of: the sum of these values divided by %toTime \\-- %fromTime.")
525 NORMAL (U"To get the standard deviation in the points only, i.e. not weighted by the durations of the line pieces, "
526 "Use @@PitchTier: Get standard deviation (points)...@ instead.")
527 MAN_END
528
529 MAN_BEGIN (U"PitchTier: Get standard deviation (points)...", U"ppgb", 20010821)
530 INTRO (U"A @@Query submenu|query@ to the selected @PitchTier object.")
531 ENTRY (U"Return value")
532 NORMAL (U"the standard deviation in the points within a specified time window.")
533 ENTRY (U"Settings")
534 TERM (U"##From time (s)")
535 TERM (U"##To time (s)")
536 DEFINITION (U"the selected time domain. Values outside this domain are ignored. "
537 "If ##To time# is not greater than ##From time#, the entire time domain of the tier is considered.")
538 NORMAL (U"For a PitchTier that was created from a @Pitch object, this command gives the same result as "
539 "##Get standard deviation...# for the original Pitch object (but remember that variation measures "
540 "based on quantiles, as available for Pitch objects, are more robust).")
541 NORMAL (U"To get the standard deviation in the entire curve, i.e. weighted by the durations of the line pieces, "
542 "Use @@PitchTier: Get standard deviation (curve)...@ instead.")
543 MAN_END
544
545 MAN_BEGIN (U"PitchTier: Stylize...", U"ppgb", 20050831)
546 INTRO (U"A command that modifies the selected @PitchTier object "
547 "(or the pitch curve in the @ManipulationEditor).")
548 ENTRY (U"Purpose")
549 NORMAL (U"to end up with a much simplified pitch curve.")
550 ENTRY (U"Settings")
551 TERM (U"##Frequency resolution# (standard: 2.0 semitones)")
552 DEFINITION (U"the minimum amount by which every remaining pitch point will lie "
553 "above or below the line that connects its two neigbours.")
554 ENTRY (U"Algorithm")
555 LIST_ITEM (U"1. Look up the pitch point that is closest to the straight line "
556 "that connects its two neighbouring points.")
557 LIST_ITEM (U"2. If this pitch point is further away from that straight line "
558 "than ##Frequency resolution#, we are finished: the curve cannot be stylized any further.")
559 LIST_ITEM (U"3. If we are not finished, the pitch point we found in step 1 is removed.")
560 LIST_ITEM (U"4. Go back to step 1.")
561 MAN_END
562
563 MAN_BEGIN (U"PitchTier: To PointProcess", U"ppgb", 19960915)
564 INTRO (U"A command that uses a @PitchTier object to generate a @PointProcess.")
565 ENTRY (U"Purpose")
566 NORMAL (U"to interpret an acoustic periodicity contour as the frequency of an underlying point process "
567 "(such as the sequence of glottal closures in vocal-fold vibration).")
568 ENTRY (U"Algorithm")
569 NORMAL (U"Points are generated along the entire time domain of the #PitchTier, "
570 "because there is no voiced/unvoiced information. The area between two adjacent points "
571 "under the linearly interpolated pitch contour, is always 1.")
572 MAN_END
573
574 MAN_BEGIN (U"PitchTierEditor", U"ppgb", /*20110128 20220814*/ 20230608)
575 INTRO (U"One of the @Editors in Praat, for viewing and manipulating a @PitchTier object, "
576 "which is optionally shown together with a @Sound object.")
577 ENTRY (U"Objects")
578 NORMAL (U"The editor shows:")
579 LIST_ITEM (U"\\bu The @Sound, if you selected a Sound object together with the PitchTier object "
580 "before you clicked ##View & Edit#.")
581 LIST_ITEM (U"\\bu The @PitchTier: blue points connected with blue lines.")
582 ENTRY (U"Playing")
583 NORMAL (U"To play (a part of) the %resynthesized sound: "
584 "@click any of the 8 buttons below and above the drawing area, or choose a command from the Play menu.")
585 NORMAL (U"To play the %original sound instead, use @@Shift-click@.")
586 ENTRY (U"Adding a point")
587 NORMAL (U"@Click at the desired time location, and choose ##Add point at cursor# or type @@Keyboard shortcuts|Command-P@.")
588 ENTRY (U"Removing points")
589 NORMAL (U"To remove one or more pitch points, "
590 "make a @@time selection@ and choose ##Remove point(s)# from the ##Point# menu. "
591 "If there is no selection, the point nearest to the cursor is removed.")
592 MAN_END
593
594 MAN_BEGIN (U"PointProcess: To PitchTier...", U"ppgb", 19970402)
595 INTRO (U"A command to compute a @PitchTier from a @PointProcess.")
596 ENTRY (U"Setting")
597 TERM (U"##Maximum interval (s)")
598 DEFINITION (U"the maximum duration of a period; intervals longer than this are considered voiceless.")
599 ENTRY (U"Algorithm")
600 NORMAL (U"A pitch point is constructed between each consecutive pair of points in the #PointProcess, "
601 "if these are more than %maximumInterval apart. "
602 "The associated pitch value will be the inverse of the duration of the interval between the two points.")
603 MAN_END
604
605 MAN_BEGIN (U"Sound: To Harmonicity (ac)...", U"ppgb", 20030916)
606 INTRO (U"A command that creates a @Harmonicity object from every selected @Sound object.")
607 ENTRY (U"Purpose")
608 NORMAL (U"to perform a short-term HNR analysis.")
609 ENTRY (U"Algorithm")
610 NORMAL (U"The algorithm performs an acoustic periodicity detection on the basis of an "
611 "accurate autocorrelation method, as described in @@Boersma (1993)@.")
612 ENTRY (U"Settings")
613 TERM (U"%%Time step% (standard value: 0.01 s)")
614 DEFINITION (U"the measurement interval (frame duration), in seconds.")
615 TERM (U"%%Pitch floor% (standard value: 75 Hz)")
616 DEFINITION (U"determines the length of the analysis window.")
617 TERM (U"%%Silence threshold% (standard value: 0.1)")
618 DEFINITION (U"frames that do not contain amplitudes above this threshold (relative to the global maximum amplitude), "
619 "are considered silent.")
620 TERM (U"%%Number of periods per window% (standard value: 4.5)")
621 DEFINITION (U"4.5 is best for speech: "
622 "HNR values up to 37 dB are guaranteed to be detected reliably; "
623 "6 periods per window raises this figure to more than 60 dB, "
624 "but the algorithm becomes more sensitive to dynamic changes in the signal.")
625 ENTRY (U"Usage")
626 NORMAL (U"You will normally use @@Sound: To Harmonicity (cc)...@ instead of this command, "
627 "because that has a much better time resolution (though its sensitivity is 60, not 80 dB).") // TODO: check these values, because we say 60 dB above
628 MAN_END
629
630 MAN_BEGIN (U"Sound: To Harmonicity (cc)...", U"ppgb", 19961003)
631 INTRO (U"A command that creates a @Harmonicity object from every selected @Sound object.")
632 ENTRY (U"Purpose")
633 NORMAL (U"to perform a short-term HNR analysis.")
634 ENTRY (U"Algorithm")
635 NORMAL (U"The algorithm performs an acoustic periodicity detection on the basis of a "
636 "forward cross-correlation analysis. "
637 "For information on the settings, see @@Sound: To Harmonicity (ac)...@.")
638 MAN_END
639
640 MAN_PAGES_BEGIN
641 R"~~~(
642 ################################################################################
643 "how to choose a pitch analysis method"
644 © Paul Boersma 2023,2024
645
646 Pitch analysis is the determination of a pitch curve from a given sound.
647
648 In Praat you can choose from at least four methods for pitch analysis:
649 - @@pitch analysis by filtered autocorrelation
650 - @@pitch analysis by raw cross-correlation
651 - @@pitch analysis by raw autocorrelation
652 - @@pitch analysis by filtered cross-correlation
653
654 These method have been listed here in order of usefulness for the %average speech researcher:
655 for measuring vocal-fold vibration frequency or intonation,
656 you are advised to use @@pitch analysis by ||filtered autocorrelation@;
657 for voice analysis (such as is used in the area of voice pathology),
658 you are advised to use @@pitch analysis by ||raw cross-correlation@;
659 and for measuring pure periodicity,
660 you are advised to use @@pitch analysis by ||raw autocorrelation@.
661
662 Measuring intonation
663 ====================
664
665 From 1993 to 2023, Praat’s preferred method for measuring intonation
666 (and for most use cases involving vocal-fold vibration) was
667 @@pitch analysis by ||raw autocorrelation@, and this is still available if you
668 want to measure raw periodicity (see below). From 2023 on,
669 Praat’s preferred method for measuring intonation
670 (and for most use cases involving vocal-fold vibration) has been
671 @@pitch analysis by ||filtered autocorrelation@.
672
673 All these methods measure pitch in terms of the self-similarity of the waveform.
674 If the waveform is almost identical if you shift it by 10 milliseconds in time,
675 then 100 Hz will be a good candidate for being the F0. This idea has been used in Praat from 1993 on,
676 using the "autocorrelation" and "cross-correlation" methods,
677 which are nowadays called "raw autocorrelation" and "raw cross-correlation".
678 Both methods measure self-similarity as a number between -1.0 and +1.0.
679 From 2023 on, we also have "filtered autocorrelation" and "filtered cross-correlation",
680 which use low-pass filtering of the waveform (by a Gaussian filter)
681 prior to doing autocorrelation or cross-correlation.
682
683 The filtering comes with several benefits:
684
685 - ##Filtering leads to fewer unwanted octave drops.# An unwanted octave drop can occur,
686 for instance, if you set the pitch floor to 75 Hz (the standard value for raw AC)
687 but the F0 is 200 Hz and there is background noise.
688 The waveshape will be self-similar over time shifts of 5 ms,
689 but then necessarily also over time shifts of 10 ms and 15 ms, and so on.
690 Background noise can sometimes randomly make the degree of self-similarity higher
691 over 10 ms than over 5 ms, leading to an octave drop in the measured pitch, from 200 to 100 Hz.
692 In raw AC and raw CC, this problem is alleviated a bit by applying an "octave cost",
693 whose standard setting is 0.01 per octave (on a self-similarity scale from 0.0 to 1.0).
694 However, low-pass filtering reduces the problem more strongly,
695 by taking away the higher-frequency parts of the background noise.
696 - ##Filtering leads to fewer unwanted octave rises.# If you set the pitch ceiling to 600 Hz
697 (the standard value), and the F0 is 150 Hz, and the F1 is 450 Hz,
698 then the harmonic relation between F0 and F1 (F1 is exactly three times F0)
699 will lead to a very strong F1 in the waveform, sometimes causing the pitch to be analysed
700 as 450 instead of 150 Hz. This problem is exacerbated by the existence of the “octave cost”,
701 which favours higher pitch candidates. Low-pass filtering reduces this problem,
702 because the 450-Hz component of the waveform is weakened with respect to the 150-Hz component
703 by a factor of 0.373 (if the pitch top is 800 Hz, and the “attenuation at top” is set to 0.03).
704 This effect is so strong that the standard “octave cost” can be much higher for filtered pitch analysis
705 (the standard value is 0.055 per octave) than for raw pitch analysis (where the standard value is 0.01 per octave):
706 this still reduces the formant problem heavily, and it reduces the unwanted octave drops
707 by making the analysis more resistent to %lower-frequency parts of the background noise.
708 - ##Filtering leads to better tracking of formant transitions.# Fast formant movements
709 in transitions between consonants and vowels cause waveforms to change their shape strongly in time.
710 This reduces the self-similarity of the waveform, leading to the “raw AC” method judging
711 some of these transitions as “unvoiced”. With low-pass filtering, the transitions become
712 more sine-like, which leads “filtered AC” being more likely to judge these transitions as “voiced”.
713
714 On a database containing EGG recordings as a gold standard (AtakeDB),
715 the incidence of unwanted big frequency drops falls from 0.54% (of voiced frames) for raw AC to 0.15% for filtered AC,
716 and the number of unwanted big frequency rises falls from 0.25% to 0.10% (of voiced frames);
717 together, these numbers indicate that the incidence of gross frequency errors is better
718 for filtered AC than for raw AC by a factor of more than 3.
719
720 On the other hand, low-pass filtering also produces potentially unwanted side effects:
721
722 - The reduction of higher frequency components causes voicing decisions to be based on smoother curves.
723 As this influences especially the loud parts (the vowels),
724 this reduction may have to lead to a higher optimal “silence threshold” setting.
725 Indeed, in testing the algorithm on AtakeDB,
726 the best silence threshold for filtered AC seems to be 0.18,
727 whereas for raw AC it seems to be 0.06. Accounting for recordings with a larger dynamic range than AtakeDB,
728 the current standard silence threshold is half that: 0.03 for raw AC, and 0.09 for filtered AC.
729 This can lead to more difficulty measuring plosive voicing (during prevoiced [b] or [d]);
730 if you want to measure those, then you are advised to lower the silence threshold
731 from the standard of 0.09 to e.g. 0.01 (this is also somewhat true for raw AC,
732 where the standard value is 0.03 but one should probably use 0.01 for prevoicing).
733 - Generalizingly, voicing decisions seem to be less predictable for filtered AC than for raw AC,
734 i.e. it is possible that the incidence of unvoiced-to-voiced errors and voiced-to-unvoiced errors is greater.
735 This may have to be shown in practice. In the future, voicing decisions may have to be relegated
736 to a trained neural network, rather than to the current simple “costs” and “thresholds”.
737
738 All in all, it seems likely that filtered AC works better in practice than raw AC
739 (your feedback is invited, though), which is why filtered AC is the preferred pitch analysis method
740 for vocal-fold vibration and intonation, as is shown in the Periodicity menu in the Objects window,
741 in the Pitch menu of the Sound window, and in many places in this manual.
742 While the standard pitch range for raw AC runs from 75 to 600 Hz,
743 filtered AC has less trouble discarding very low or very high pitch candidates,
744 so the standard pitch range for filtered AC is wider, running from 50 Hz to 800 Hz,
745 and may not have to be adapted to the speaker’s gender.
746
747 Voice analysis
748 ==============
749
750 For voice analysis, we probably shouldn’t filter away noise, so @@pitch analysis by ||raw cross-correlation@ is the preferred method.
751
752 Measuring prevoicing
753 ====================
754
755 The high standard “silence threshold” of 0.09 for filtered AC (or, to a lesser extent, 0.03 for raw AC)
756 probably leads to trouble measuring voicing during the closure phase of prevoiced plosives such as [b] or [d].
757 You are still advised to use filtered AC, but to lower the silence threshold to 0.01 or so.
758
759 Raw periodicity
760 ===============
761
762 Mathematically generated periodic signals aren’t necessarily speechlike. For instance:
763 {
764 sine = Create Sound from formula: "sine", 1, 0, 0.1, 44100, "0.4*sin(2*pi*200*x)"
765 tricky = Create Sound from formula: "tricky", 1, 0, 0.1, 44100, "0.001*sin(2*pi*400*x)
766 ... + 0.001*sin(2*pi*600*x) - 0.2*cos(2*pi*800*x+1.5) - 0.2*cos(2*pi*1000*x+1.5)"
767 selectObject: sine, tricky
768 Concatenate
769 Erase all
770 Draw: 0.08, 0.12, 0, 0, "yes", "curve"
771 }
772 Both the left part of this sound and the right part have a period of 5 ms,
773 and therefore an F0 of 200 Hz. The @@pitch analysis by ||raw autocorrelation@ method measures an equally
774 strong pitch of 200 Hz throughout this signal, while @@pitch analysis by ||filtered autocorrelation@
775 considers the right part voiceless. This is because the right part contains
776 only components at 800 and 1000 Hz, which will be filtered out by the low-pass filter,
777 and only very small components at 200, 400 or 600 Hz.
778 This problem of the %%missing fundamental% was the reason why low-pass filtering
779 was not included in @@pitch analysis by ||raw autocorrelation@ in 1993. However,
780 this situation is %very rare in speech, so for speech we do nowadays recommend @@pitch analysis by ||filtered autocorrelation@,
781 while we recommend @@pitch analysis by ||raw autocorrelation@ only if you want to measure %raw periodicity.
782
783 ################################################################################
784 "Sound: To Pitch..."
785 © Paul Boersma 1996,2003,2023,2024
786
787 A @@hidden commands|hidden command@ that creates a @Pitch object from every selected @Sound object.
788
789 Purpose
790 =======
791
792 to perform a pitch analysis, optimized for speech.
793
794 Settings
795 ========
796
797 The settings that control the recruitment of the candidates are:
798
799 ##Time step (s)# (standard value: 0.0)
800 : the measurement interval (frame duration), in seconds. If you supply 0.0,
801 Praat will use a time step of 0.75 / (%%pitch floor%), e.g. 0.01 seconds if the pitch floor is 75 Hz;
802 in this example, Praat computes 100 pitch values per second.
803
804 ##Pitch floor (Hz)# (standard value: 75 Hz)
805 : candidates below this frequency will not be recruited.
806 This parameter determines the length of the analysis window: it will be 3 longest periods long,
807 i.e., if the pitch floor is 75 Hz, the window will be 3/75 = 0.04 seconds long.
808
809 Note that if you set the time step to zero, the analysis windows for consecutive measurements
810 will overlap appreciably: Praat will always compute 4 pitch values
811 within one window length, i.e., the degree of %oversampling is 4.
812
813 ##Pitch ceiling (Hz)# (standard value: 600 Hz)
814 : candidates above this frequency will be ignored.
815
816 Algorithm
817 =========
818
819 This is the algorithm described at @@Sound: To Pitch (raw autocorrelation)...@,
820 with all the parameters not mentioned above set to their standard values.
821
822 ################################################################################
823 "Sound: To Pitch (ac)..."
824 © Paul Boersma 1996,2001–2003,2022–2024
825
826 A @@hidden commands|hidden command@ that creates a @Pitch object from every selected @Sound object.
827
828 The parameters are in the following order:
829 - ##Time step (s)# (standard value: 0.0)
830 - ##Pitch floor (Hz)# (standard value: 75 Hz)
831 - ##Max. number of candidates# (standard value: 15)
832 - ##Very accurate# (standard value: %off)
833 - ##Silence threshold# (standard value: 0.03)
834 - ##Voicing threshold# (standard value: 0.45)
835 - ##Octave cost# (standard value: 0.01 per octave)
836 - ##Octave-jump cost# (standard value: 0.35)
837 - ##Voiced / unvoiced cost# (standard value: 0.14)
838 - ##Pitch ceiling (Hz)# (standard value: 600 Hz)
839
840 With the advent of @@Sound: To Pitch (filtered autocorrelation)...@ in 2023,
841 this command was replaced with @@Sound: To Pitch (raw autocorrelation)...@.
842
843 Transitioning
844 =============
845
846 While ##Sound: To Pitch (ac)...# will still work in scripts,
847 you make like to transition to @@Sound: To Pitch (raw autocorrelation)...@.
848 Please note that the %%Pitch ceiling% parameter was moved immediately after %%Pitch floor%,
849 where it fits more logically.
850 For example, you can replace the line
851 {;
852 \#{To Pitch (ac):} 0.0, 75, 15, “off”, 0.03, 0.45, 0.01, 0.35, 0.14, 600
853 }
854 with the entirely equivalent line
855 {;
856 \#@{Sound: ||To Pitch (raw autocorrelation):} 0.0, 75, 600, 15, “off”, 0.03, 0.45, 0.01, 0.35, 0.14
857 }
858
859 ################################################################################
860 "Sound: To Pitch (cc)..."
861 © Paul Boersma 1996,2003,2023,2024
862
863 A @@hidden commands|hidden command@ that creates a @Pitch object from every selected @Sound object.
864
865 The parameters are in the following order:
866 - ##Time step (s)# (standard value: 0.0)
867 - ##Pitch floor (Hz)# (standard value: 75 Hz)
868 - ##Max. number of candidates# (standard value: 15)
869 - ##Very accurate# (standard value: %off)
870 - ##Silence threshold# (standard value: 0.03)
871 - ##Voicing threshold# (standard value: 0.45)
872 - ##Octave cost# (standard value: 0.01 per octave)
873 - ##Octave-jump cost# (standard value: 0.35)
874 - ##Voiced / unvoiced cost# (standard value: 0.14)
875 - ##Pitch ceiling (Hz)# (standard value: 600 Hz)
876
877 With the advent of @@Sound: To Pitch (filtered cross-correlation)...@ in 2023,
878 this command was replaced with @@Sound: To Pitch (raw cross-correlation)...@.
879
880 Transitioning
881 =============
882
883 While ##Sound: To Pitch (cc)...# will still work in scripts,
884 you may like to transition to @@Sound: To Pitch (raw cross-correlation)...@.
885 Please note that the %%Pitch ceiling% parameter was moved immediately after %%Pitch floor%,
886 where it fits more logically.
887 For example, you can replace the line
888 {;
889 \#{To Pitch (cc):} 0.0, 75, 15, “off”, 0.03, 0.45, 0.01, 0.35, 0.14, 600
890 }
891 with the entirely equivalent line
892 {;
893 \#@{Sound: ||To Pitch (raw cross-correlation):} 0.0, 75, 600, 15, “off”, 0.03, 0.45, 0.01, 0.35, 0.14
894 }
895
896 ################################################################################
897 "Sound: To Pitch (raw ac)..."
898 © Paul Boersma 1996,2001–2003,2022-2024
899
900 A @@hidden commands|hidden command@ that creates a @Pitch object from every selected @Sound object.
901
902 This command is a precise synonym of @@Sound: To Pitch (raw autocorrelation)...@.
903
904 ################################################################################
905 "Sound: To Pitch (raw autocorrelation)..."
906 © Paul Boersma 1996,2001–2003,2022-2024
907
908 A command that creates a @Pitch object from every selected @Sound object.
909
910 For purpose, algorithm and settings, see @@pitch analysis by raw autocorrelation@.
911
912 For usage, see @@how to choose a pitch analysis method@.
913
914 Synonyms
915 ========
916
917 In older scripts you may find:
918 - @@Sound: To Pitch (raw ac)...@, a precise synonym with an identical list of parameters.
919 - @@Sound: To Pitch (ac)...@, a command with the same meaning, with parameters in a different order.
920
921 ################################################################################
922 "Pitch settings..."
923 © Paul Boersma 2003,2024
924
925 Four commands in the Pitch menu of the @SoundEditor and @TextGridEditor windows:
926
927 - ##Pitch settings (filtered autocorrelation)...#: see @@pitch analysis by filtered autocorrelation@
928 - ##Pitch settings (raw cross-correlation)...#: see @@pitch analysis by raw cross-correlation@
929 - ##Pitch settings (raw autocorrelation)...#: see @@pitch analysis by raw autocorrelation@
930 - ##Pitch settings (filtered cross-correlation)...#: see @@pitch analysis by filtered cross-correlation@
931
932 Also see @@Intro 4.2. Configuring the pitch contour@ and @@how to choose a pitch analysis method@.
933
934 ################################################################################
935 "pitch analysis by raw autocorrelation"
936 © Paul Boersma 1996,2001–2003,2022-2024
937
938 Purpose
939 =======
940
941 to perform a pitch analysis based on an autocorrelation method.
942
943 Usage
944 =====
945
946 Raw autocorrelation is the pitch analysis method of choice if you want measure the raw periodicity of a signal.
947
948 Note that the preferred method for speech (intonation, vocal fold vibration) is @@pitch analysis by filtered autocorrelation@.
949 See @@how to choose a pitch analysis method@ for details.
950
951 Algorithm
952 =========
953
954 The algorithm performs an acoustic periodicity detection on the basis of an
955 accurate autocorrelation method, as described in @@Boersma (1993)@.
956 This method is more accurate, noise-resistant, and robust, than methods based on cepstrum or combs,
957 or the original autocorrelation methods. The reason why other methods were invented,
958 was the failure to recognize the fact that if you want to estimate a signal's short-term autocorrelation
959 function on the basis of a windowed signal, you should divide the autocorrelation function of the
960 windowed signal by the autocorrelation function of the window:
961
962 ~ %r_%x (%\ta) \~~ %r__%xw_ (%\ta) / %r_%w (%\ta)
963
964 The pitch is basically determined as the inverse of the time (%lag) where the autocorrelation function %r
965 has its maximum. However, there are likely to be multiple peaks in %r,
966 and all of these can be %%pitch candidates%. For each moment in time (e.g. every 10 ms),
967 the algorithm determines the (typically) 15 highest peaks in %r,
968 regards these as %candidates, and then tracks an optimal path through the candidates over time.
969
970 Settings
971 ========
972
973 Several settings are already described in @@Intro 4.2. Configuring the pitch contour@.
974 The explanations below assume that you have gone through that part of the Intro.
975
976 The settings that control the recruitment of the candidates are:
977
978 ##Time step (s)# (standard value: 0.0)
979 : the measurement interval (frame duration), in seconds. If you supply 0,
980 Praat will use a time step of 0.75 / (%%pitch floor%), e.g. 0.01 seconds if the pitch floor is 75 Hz;
981 in this example, Praat computes 100 pitch values per second.
982
983 ##Pitch floor (Hz)# (standard value: 75 Hz)
984 : candidates below this frequency will not be recruited.
985 This parameter determines the effective length of the analysis window: it will be 3 longest periods long,
986 i.e., if the pitch floor is 75 Hz, the window will be effectively 3/75 = 0.04 seconds long.
987
988 Note that if you set the time step to zero, the analysis windows for consecutive measurements
989 will overlap appreciably: Praat will always compute 4 pitch values
990 within one window length, i.e., the degree of %oversampling is 4.
991
992 ##Pitch ceiling (Hz)# (standard value: 600 Hz)
993 : candidates above this frequency will be ignored.
994
995 ##Max. number of candidates# (standard value: 15)
996 : each frame will contain at least this many pitch candidates.
997 One of them is the “unvoiced candidate”; the others correspond to
998 time lags over which the signal is more or less similar to itself.
999
1000 ##Very accurate# (standard value: %off)
1001 : if %off, the window is a Hanning window with a physical length of 3 / (%%pitch floor%).
1002 If %on, the window is a Gaussian window with a physical length of 6 / (%%pitch floor%),
1003 i.e. twice the effective length.
1004
1005 A post-processing algorithm seeks the cheapest path through the candidates.
1006 The settings that determine the cheapest path are:
1007
1008 ##Silence threshold# (standard value: 0.03)
1009 : frames that do not contain amplitudes above this threshold (relative to the global maximum amplitude),
1010 are probably silent.
1011
1012 ##Voicing threshold# (standard value: 0.45)
1013 : the strength of the unvoiced candidate, relative to the maximum possible autocorrelation.
1014 If the amount of periodic energy in a frame is more than this fraction of the total energy (the remainder being noise),
1015 then Praat will prefer to regard this frame as voiced; otherwise as unvoiced.
1016 To increase the number of unvoiced decisions, increase the voicing threshold.
1017
1018 ##Octave cost# (standard value: 0.01 per octave)
1019 : degree of favouring of high-frequency candidates, relative to the maximum possible autocorrelation.
1020 This is necessary because even (or: especially) in the case of a perfectly periodic signal,
1021 all undertones of %F_0 are equally strong candidates as %F_0 itself.
1022 To more strongly favour recruitment of high-frequency candidates, increase this value.
1023
1024 ##Octave-jump cost# (standard value: 0.35)
1025 : degree of disfavouring of pitch changes, relative to the maximum possible autocorrelation.
1026 To decrease the number of large frequency jumps, increase this value. In contrast with what is described
1027 in the article, this value will be corrected for the time step: multiply by 0.01 s / %TimeStep to get
1028 the value in the way it is used in the formulas in the article.
1029
1030 ##Voiced / unvoiced cost# (standard value: 0.14)
1031 : degree of disfavouring of voiced/unvoiced transitions, relative to the maximum possible autocorrelation.
1032 To decrease the number of voiced/unvoiced transitions, increase this value. In contrast with what is described
1033 in the article, this value will be corrected for the time step: multiply by 0.01 s / %TimeStep to get
1034 the value in the way it is used in the formulas in the article.
1035
1036 The standard settings are best in most cases.
1037 For some pathological voices, you will want to set the voicing threshold to much less than the standard of 0.45,
1038 in order to get pitch values even in irregular parts of the signal.
1039 For prevoiced plosives, you may want to lower the silence threshold from 0.03 to 0.01 or so.
1040
1041 Availability in Praat
1042 =====================
1043
1044 Pitch analysis by raw autocorrelation is available in two ways in Praat:
1045
1046 - via @@Sound: To Pitch (raw autocorrelation)...@
1047 from the ##Analyse periodicity# menu in the Objects window when you select a Sound object;
1048 - via ##Show Pitch# and ##Pitch analysis method is raw autocorrelation#
1049 from the #Pitch menu when you are viewing a Sound or TextGrid object (@SoundEditor, @TextGridEditor).
1050
1051 ################################################################################
1052 "Sound: To Pitch (raw cc)..."
1053 © Paul Boersma 1996,2003,2023,2024
1054
1055 A @@hidden commands|hidden command@ that creates a @Pitch object from every selected @Sound object.
1056
1057 This command is a precise synonym of @@Sound: To Pitch (raw cross-correlation)...@.
1058
1059 ################################################################################
1060 "Sound: To Pitch (raw cross-correlation)..."
1061 © Paul Boersma 1996,2003,2023,2024
1062
1063 A command that creates a @Pitch object from every selected @Sound object.
1064
1065 For purpose, algorithm and settings, see @@pitch analysis by raw cross-correlation@.
1066
1067 For usage, see @@how to choose a pitch analysis method@.
1068
1069 Synonyms
1070 ========
1071
1072 In older scripts you may find:
1073 - @@Sound: To Pitch (raw cc)...@, a precise synonym with an identical list of parameters.
1074 - @@Sound: To Pitch (cc)...@, a command with the same meaning, with parameters in a different order.
1075
1076 ################################################################################
1077 "pitch analysis by raw cross-correlation"
1078 © Paul Boersma 1996,2003,2023,2024
1079
1080 Purpose
1081 =======
1082
1083 to perform a pitch analysis based on a cross-correlation method.
1084
1085 Usage
1086 =====
1087
1088 Raw cross-correlation is the pitch analysis method of choice if you want to do voice analysis (e.g. jitter, shimmer).
1089
1090 Note that the preferred method for speech (intonation, vocal fold vibration) is @@pitch analysis by filtered autocorrelation@.
1091 Raw cross-correlation is mainly for experimenting,
1092 or for applications where you need short time windows;
1093 for this latter reason, it is also the standard method for voice analysis.
1094
1095 See @@how to choose a pitch analysis method@ for details.
1096
1097 Algorithm
1098 =========
1099
1100 The algorithm performs an acoustic periodicity detection on the basis of a
1101 forward cross-correlation analysis.
1102
1103 Settings
1104 ========
1105
1106 Several settings are already described in @@Intro 4.2. Configuring the pitch contour@.
1107 The explanations below assume that you have gone through that part of the Intro.
1108
1109 ##Time step (s)# (standard value: 0.0)
1110 : the measurement interval (frame duration), in seconds. If you supply 0,
1111 Praat will use a time step of 0.25 / (%%pitch floor%), e.g. 0.00333333 seconds if the pitch floor is 75 Hz;
1112 in this example, Praat computes 300 pitch values per second.
1113
1114 ##Pitch floor (Hz)# (standard value: 75 Hz)
1115 : candidates below this frequency will not be recruited.
1116 This parameter determines the length of the analysis window: it will be 1 longest period long,
1117 i.e., if the pitch floor is 75 Hz, the window will be 1/75 = 0.01333333 seconds long.
1118
1119 Note that if you set the time step to zero, the analysis windows for consecutive measurements
1120 will overlap appreciably: Praat will always compute 4 pitch values
1121 within one window length, i.e., the degree of %oversampling is 4.
1122
1123 The other settings are the same as for @@pitch analysis by raw autocorrelation@.
1124
1125 Availability in Praat
1126 =====================
1127
1128 Pitch analysis by raw cross-correlation is available in two ways in Praat:
1129
1130 - via @@Sound: To Pitch (raw cross-correlation)...@
1131 from the ##Analyse periodicity# menu in the Objects window when you select a Sound object;
1132 - via ##Show Pitch# and ##Pitch analysis method is raw cross-correlation#
1133 from the #Pitch menu when you are viewing a Sound or TextGrid object (@SoundEditor, @TextGridEditor).
1134
1135 ################################################################################
1136 "Sound: To Pitch (filtered ac)..."
1137 © Paul Boersma 2023,2024
1138
1139 A @@hidden commands|hidden command@ that creates a @Pitch object from every selected @Sound object.
1140
1141 This command is a precise synonym of @@Sound: To Pitch (filtered autocorrelation)...@.
1142
1143 ################################################################################
1144 "Sound: To Pitch (filtered autocorrelation)..."
1145 © Paul Boersma 2023,2024
1146
1147 A command that creates a @Pitch object from every selected @Sound object.
1148
1149 For purpose, algorithm and settings, see @@pitch analysis by filtered autocorrelation@.
1150
1151 For usage, see @@how to choose a pitch analysis method@.
1152
1153 Synonyms
1154 ========
1155
1156 In older scripts you may find:
1157 - @@Sound: To Pitch (filtered ac)...@, a precise synonym with an identical list of parameters.
1158
1159 ################################################################################
1160 "pitch analysis by filtered autocorrelation"
1161 © Paul Boersma 2023,2024
1162
1163 A command that creates a @Pitch object from every selected @Sound object.
1164
1165 Purpose
1166 =======
1167
1168 to perform a pitch analysis based on the autocorrelation of the low-pass filtered signal.
1169
1170 Usage
1171 =====
1172
1173 Filtered autocorrelation is the pitch analysis method of choice if you want to measure intonation or vocal-fold vibration frequency.
1174 See @@how to choose a pitch analysis method@ for details.
1175
1176 Algorithm
1177 =========
1178
1179 This command will first low-pass filter the signal, then apply @@pitch analysis by raw autocorrelation@
1180 on the filtered signal.
1181
1182 The low-pass filter is Gaussian in the frequency domain. If, for instance,
1183 you set the %%pitch top% to 800 Hz, and the %%attenuation at top% to 0.03,
1184 then the attenuation at 400 Hz is the fourth root of 0.03, i.e. about 42\% .
1185 As a function of frequency %f, the attenuation is 0.03^^(%f/800)²^.
1186 Here’s a table of attenuation factors, also in dB (in this logarithmic domain, the shape is parabolic):
1187
1188 | frequency | attenuation | logarithmic
1189 | 100 Hz | 0.95 | -0.5 dB
1190 | 200 Hz | 0.80 | -1.9 dB
1191 | 300 Hz | 0.61 | -4.3 dB
1192 | 400 Hz | 0.42 | -7.6 dB
1193 | 500 Hz | 0.25 | -11.9 dB
1194 | 600 Hz | 0.14 | -17.1 dB
1195 | 700 Hz | 0.07 | -23.3 dB
1196 | 800 Hz | 0.03 | -30.5 dB
1197
1198 Note: the attenuation curve will be identical to the curve shown here if you use a pitch top of 500 Hz
1199 and an %%attenuation at top% of 0.25; however, this is not advised, because the example table
1200 provides a more gradual suppression of higher pitches, almost as if there were no pitch top at all.
1201
1202 Settings
1203 ========
1204
1205 Several settings are already described in @@Intro 4.2. Configuring the pitch contour@.
1206 The explanations below assume that you have gone through that part of the Intro.
1207
1208 The settings that control the recruitment of the candidates are:
1209
1210 ##Time step (s)# (standard value: 0.0)
1211 : the measurement interval (frame duration), in seconds. If you supply 0,
1212 Praat will use a time step of 0.75 / (%%pitch floor%), e.g. 0.015 seconds if the pitch floor is 50 Hz;
1213 in this example, Praat computes 66.7 pitch values per second.
1214
1215 ##Pitch floor (Hz)# (standard value: 50 Hz)
1216 : candidates below this frequency will not be recruited.
1217 This parameter determines the effective length of the analysis window: it will be 3 longest periods long,
1218 i.e., if the pitch floor is 50 Hz, the window will be effectively 3/50 = 0.06 seconds long.
1219
1220 Note that if you set the time step to zero, the analysis windows for consecutive measurements
1221 will overlap appreciably: Praat will always compute 4 pitch values
1222 within one window length, i.e., the degree of %oversampling is 4.
1223
1224 ##Pitch top (Hz)# (standard value: 800 Hz)
1225 : candidates above this frequency will be ignored. Note, however, that candidates around one half of this (i.e. 400 Hz)
1226 will already be reduced by 7.6 dB, i.e. they are already moderately disfavoured,
1227 and that candidates around three-quarters of this (i.e. 600 Hz) will already be reduced by 17.1 dB,
1228 i.e. they are strongly disfavoured. Hence, the %%pitch top%
1229 needs to be be set much higher than the %%pitch ceiling% of @@pitch analysis by ||raw autocorrelation@,
1230 which is why the standard is 800 Hz whereas the standard for raw autocorrelation can be 500 or 600 Hz.
1231 To illustrate this, consider the search space for raw autocorrelation on the right (with a ceiling of 600 Hz)
1232 and the search space for filtered autocorrelation on the right (with a top of 800 Hz):
1233 {- 6x3
1234 colour# = { 1.0, 0.5, 0.5 }
1235 attenuationAtFloor = 0.03 ^ (50/800)^2
1236 info$ = Picture info
1237 fontSize = extractNumber: info$, "Font size:"
1238
1239 Axes: 0, 1, 0, 1000
1240 Select outer viewport: 0, 3, 0, 3
1241 Draw inner box
1242 Marks bottom every: 1.0, 1.0, "yes", "yes", "no"
1243 One mark left: 50, "yes", "yes", "yes", ""
1244 One mark right: 50, "no", "yes", "no", "floor"
1245 One mark left: 600, "yes", "yes", "yes", ""
1246 One mark right: 600, "no", "yes", "no", "ceiling"
1247 Text bottom: "no", "attenuation"
1248 Text left: "yes", "Pitch (Hz)"
1249 Colour: colour#
1250 Line width: 3
1251 Draw line: 0, 1000, 0, 600
1252 Draw line: 0, 600, 1, 600
1253 Draw line: 1, 600, 1, 50
1254 Draw line: 1, 50, 0, 50
1255 Draw line: 0, 50, 0, 0
1256 Red
1257 Text: 0.5, "centre", 50, "bottom", "%%floor"
1258 Text: 0.5, "centre", 600, "bottom", "%%ceiling"
1259 Line width: 1
1260 Black
1261
1262 Select outer viewport: 3, 6, 0, 3
1263 Draw inner box
1264 Marks bottom every: 1.0, 1.0, "yes", "yes", "no"
1265 One mark left: 50, "yes", "yes", "yes", ""
1266 One mark right: 50, "no", "yes", "no", "floor"
1267 One mark left: 100, "yes", "yes", "yes", ""
1268 One mark left: 200, "yes", "yes", "yes", ""
1269 One mark left: 400, "yes", "yes", "yes", ""
1270 One mark left: 800, "yes", "yes", "yes", ""
1271 One mark right: 800, "no", "yes", "no", "top"
1272 Text bottom: "no", "attenuation"
1273 Text left: "yes", "Pitch (Hz)"
1274 Colour: colour#
1275 Line width: 3
1276 Draw function: 0, attenuationAtFloor, 300, ~ min (800, 800 * sqrt (ln (x) / ln (0.03)))
1277 Draw line: 0, 800, 0, 1000
1278 Draw line: attenuationAtFloor, 50, 0, 50
1279 Draw line: 0, 50, 0, 0
1280 Red
1281 Text: 0.5, "centre", 50, "bottom", "%%floor"
1282 Text special: 0.5, "centre", 360, "bottom", "Times", fontSize, "-35", "%%ceiling"
1283 Line width: 1
1284 Black
1285 }
1286 : Because of the reduction in strength of high pitch candidates, it may be preferable
1287 to view pitch on a logarithmic pitch scale, so that the suppressed top octave (from 400 to 800 Hz)
1288 occupies less space:
1289 {- 3x3
1290 Axes: 0, 1, log10 (40), log10(1000)
1291 Draw inner box
1292 Marks bottom every: 1.0, 1.0, "yes", "yes", "no"
1293 One logarithmic mark left: 50, "yes", "yes", "yes", ""
1294 One logarithmic mark right: 50, "no", "yes", "no", "floor"
1295 One logarithmic mark left: 100, "yes", "yes", "yes", ""
1296 One logarithmic mark left: 200, "yes", "yes", "yes", ""
1297 One logarithmic mark left: 400, "yes", "yes", "yes", ""
1298 One logarithmic mark left: 800, "yes", "yes", "yes", ""
1299 One logarithmic mark right: 800, "no", "yes", "no", "top"
1300 Text bottom: "no", "attenuation"
1301 Text left: "yes", "pitch (Hz)"
1302 Colour: colour#
1303 Line width: 3
1304 Draw function: 0, attenuationAtFloor, 300, ~ log10 (min (800, 800 * sqrt (ln (x) / ln (0.03))))
1305 Draw line: 0, log10(800), 0, log10(1000)
1306 Draw line: attenuationAtFloor, log10(50), 0, log10(50)
1307 Draw line: 0, log10(50), 0, log10(40)
1308 Red
1309 Text: 0.5, "centre", log10(50), "bottom", "%%floor"
1310 Text special: 0.5, "centre", log10(360), "bottom", "Times", fontSize, "-30", "%%ceiling"
1311 Line width: 1
1312 Black
1313 }
1314 We could say that the whole range from 300 to 800 Hz can be regarded as a skewed “ceiling”.
1315 This is why we distinguish between the terms “ceiling” and “top”. If you have a speaker
1316 with an especially high F0, then you can raise the top to e.g. 1200 Hz;
1317 the attenuation of higher candidates will then have the exact same shape:
1318 {- 3x3
1319 Axes: 0, 1, log10 (40), log10(1500)
1320 Draw inner box
1321 Marks bottom every: 1.0, 1.0, "yes", "yes", "no"
1322 One logarithmic mark left: 50, "yes", "yes", "yes", ""
1323 One logarithmic mark right: 50, "no", "yes", "no", "floor"
1324 One logarithmic mark left: 75, "yes", "yes", "yes", ""
1325 One logarithmic mark left: 150, "yes", "yes", "yes", ""
1326 One logarithmic mark left: 300, "yes", "yes", "yes", ""
1327 One logarithmic mark left: 600, "yes", "yes", "yes", ""
1328 One logarithmic mark left: 1200, "yes", "yes", "yes", ""
1329 One logarithmic mark right: 1200, "no", "yes", "no", "top"
1330 Text bottom: "no", "attenuation"
1331 Text left: "yes", "pitch (Hz)"
1332 Colour: colour#
1333 Line width: 3
1334 attenuationAtFloor = 0.03 ^ (50/1200)^2
1335 Draw function: 0, attenuationAtFloor, 300, ~ log10 (min (1200, 1200 * sqrt (ln (x) / ln (0.03))))
1336 Draw line: 0, log10(1200), 0, log10(1500)
1337 Draw line: attenuationAtFloor, log10(50), 0, log10(50)
1338 Draw line: 0, log10(50), 0, log10(40)
1339 Red
1340 Text: 0.5, "centre", log10(50), "bottom", "%%floor"
1341 Text special: 0.5, "centre", log10(540), "bottom", "Times", fontSize, "-30", "%%ceiling"
1342 Line width: 1
1343 Black
1344 }
1345
1346 ##Max. number of candidates# (standard value: 15)
1347 : each frame will contain at least this many pitch candidates.
1348 One of them is the “unvoiced candidate”; the others correspond to
1349 time lags over which the signal is more or less similar to itself.
1350
1351 ##Very accurate# (standard value: %off)
1352 : if %off, the window is a Hanning window with a physical length of 3 / (%%pitch floor%).
1353 If %on, the window is a Gaussian window with a physical length of 6 / (%%pitch floor%),
1354 i.e. twice the effective length.
1355
1356 A pre-processing algorithm filters the sound before the @@pitch analysis by raw autocorrelation@ begins.
1357 The shape of the attenutation curve is determined not only by the height of the %pitch top% (in hertz),
1358 but also by how wide it is (in the pictures above, it’s the tiny horizontal linepiece at the top):
1359
1360 ##Attenuation at top# (standard value: 0.03)
1361 : this is how much the frequency components of the original sound have been attenuated at the top.
1362 In the example table above, you can see that at the top (800 Hz) the sounds was attenuated by a factor of 0.03.
1363 We known of no reasons to change this value, except for experimenting.
1364
1365 A post-processing algorithm seeks the cheapest path through the candidates.
1366 The settings that determine the cheapest path are:
1367
1368 ##Silence threshold# (standard value: 0.09)
1369 : frames that do not contain amplitudes above this threshold (relative to the global maximum amplitude),
1370 are probably silent.
1371
1372 ##Voicing threshold# (standard value: 0.50)
1373 : the strength of the unvoiced candidate, relative to the maximum possible autocorrelation.
1374 If the amount of periodic energy in a frame is more than this fraction of the total energy (the remainder being noise),
1375 then Praat will prefer to regard this frame as voiced; otherwise as unvoiced.
1376 To increase the number of unvoiced decisions, increase the voicing threshold.
1377
1378 ##Octave cost# (standard value: 0.055 per octave)
1379 : degree of favouring of high-frequency candidates, relative to the maximum possible autocorrelation.
1380 This is necessary because even (or: especially) in the case of a perfectly periodic signal,
1381 all undertones of %F_0 are equally strong candidates as %F_0 itself.
1382 To more strongly favour recruitment of high-frequency candidates, increase this value.
1383
1384 ##Octave-jump cost# (standard value: 0.35)
1385 : degree of disfavouring of pitch changes, relative to the maximum possible autocorrelation.
1386 To decrease the number of large frequency jumps, increase this value. In contrast with what is described
1387 in the article (@@Boersma (1993)@), this value will be corrected for the time step: multiply by 0.01 s / %TimeStep to get
1388 the value in the way it is used in the formulas in the article.
1389
1390 ##Voiced / unvoiced cost# (standard value: 0.14)
1391 : degree of disfavouring of voiced/unvoiced transitions, relative to the maximum possible autocorrelation.
1392 To decrease the number of voiced/unvoiced transitions, increase this value. In contrast with what is described
1393 in the article, this value will be corrected for the time step: multiply by 0.01 s / %TimeStep to get
1394 the value in the way it is used in the formulas in the article.
1395
1396 The standard settings are best in most cases.
1397 For some pathological voices, you will want to set the voicing threshold to much less than the standard of 0.50,
1398 in order to get pitch values even in irregular parts of the signal.
1399 For prevoiced plosives, you may want to lower the silence threshold from 0.09 to 0.01 or so.
1400
1401 Availability in Praat
1402 =====================
1403
1404 Pitch analysis by filtered autocorrelation is available in two ways in Praat:
1405
1406 - via @@Sound: To Pitch (filtered autocorrelation)...@
1407 from the ##Analyse periodicity# menu in the Objects window when you select a Sound object;
1408 - via ##Show Pitch# and ##Pitch analysis method is filtered autocorrelation#
1409 from the #Pitch menu when you are viewing a Sound or TextGrid object (@SoundEditor, @TextGridEditor).
1410
1411 ################################################################################
1412 "Sound: To Pitch (filtered cc)..."
1413 © Paul Boersma 2023,2024
1414
1415 A @@hidden commands|hidden command@ that creates a @Pitch object from every selected @Sound object.
1416
1417 This command is a precise synonym of @@Sound: To Pitch (filtered cross-correlation)...@.
1418
1419 ################################################################################
1420 "Sound: To Pitch (filtered cross-correlation)..."
1421 © Paul Boersma 2023,2024
1422
1423 A command that creates a @Pitch object from every selected @Sound object.
1424
1425 For purpose, algorithm and settings, see @@pitch analysis by filtered cross-correlation@.
1426
1427 For usage, see @@how to choose a pitch analysis method@.
1428
1429 Synonyms
1430 ========
1431
1432 In older scripts you may find:
1433 - @@Sound: To Pitch (filtered cc)...@, a precise synonym with an identical list of parameters.
1434
1435 ################################################################################
1436 "pitch analysis by filtered cross-correlation"
1437 © Paul Boersma 2023,2024
1438
1439 A command that creates a @Pitch object from every selected @Sound object.
1440
1441 Purpose
1442 =======
1443
1444 to perform a pitch analysis based on the forward cross-correlation of the low-pass filtered signal.
1445
1446 Usage
1447 =====
1448
1449 We know of no situation yet in which this method is preferred over @@pitch analysis by filtered autocorrelation@
1450 (which seems better for measuring intonation and vocal-fold vibration frequency),
1451 @@pitch analysis by raw cross-correlation@ (which is definitely better for voice analysis, such as jitter and shimmer),
1452 or @@pitch analysis by raw autocorrelation@ (which is better for determining raw periodicity).
1453 It is possible that filtered cross-correlation can play a role in voice analysis in the future,
1454 in combination with one of the other methods; this is yet to be determined.
1455
1456 Algorithm
1457 =========
1458
1459 This command will first low-pass filter the signal, then apply @@pitch analysis by raw cross-correlation@
1460 on the filtered signal. For the filter function, see @@pitch analysis by filtered autocorrelation@.
1461
1462 Settings
1463 ========
1464
1465 The settings are the same as for @@pitch analysis by filtered autocorrelation@.
1466
1467 Availability in Praat
1468 =====================
1469
1470 Pitch analysis by raw cross-correlation is available in two ways in Praat:
1471
1472 - via @@Sound: To Pitch (raw cross-correlation)...@
1473 from the ##Analyse periodicity# menu in the Objects window when you select a Sound object;
1474 - via ##Show Pitch# and ##Pitch analysis method is raw cross-correlation#
1475 from the #Pitch menu when you are viewing a Sound or TextGrid object (@SoundEditor, @TextGridEditor).
1476
1477 ################################################################################
1478 )~~~"
1479 MAN_PAGES_END
1480
1481 MAN_BEGIN (U"Sound: To PointProcess (periodic, cc)...", U"ppgb", 20231115) // 20030309
1482 INTRO (U"A command that analyses the selected @Sound objects, and creates @PointProcess objects.")
1483 NORMAL (U"This command combines the actions of @@Sound: To Pitch (raw autocorrelation)...@ and @@Sound & Pitch: To PointProcess (cc)@.")
1484 MAN_END
1485
1486 MAN_BEGIN (U"Sound: To PointProcess (periodic, peaks)...", U"ppgb", 20231115) // 20030309
1487 INTRO (U"A command that analyses the selected @Sound objects, and creates @PointProcess objects.")
1488 NORMAL (U"This command combines the actions of @@Sound: To Pitch (raw autocorrelation)...@ and @@Sound & Pitch: To PointProcess (peaks)...@.")
1489 MAN_END
1490
1491 MAN_BEGIN (U"Sound & Pitch: To PointProcess (cc)", U"ppgb", 19980322)
1492 INTRO (U"A command to create a @PointProcess from the selected @Sound and @Pitch objects.")
1493 ENTRY (U"Purpose")
1494 NORMAL (U"to interpret an acoustic periodicity contour as the frequency of an underlying point process "
1495 "(such as the sequence of glottal closures in vocal-fold vibration).")
1496 ENTRY (U"Algorithm")
1497 NORMAL (U"The voiced intervals are determined on the basis of the voiced/unvoiced decisions in the @Pitch object. "
1498 "For every voiced interval, a number of %points (or glottal pulses) is found as follows:")
1499 LIST_ITEM (U"1. The first point %t__1_ is the absolute extremum of the amplitude of the #Sound, "
1500 "between %t__%mid_ \\-- %T__0_ / 2 and %t__%mid_ + %T__0_ / 2, where %t__%mid_ is the midpoint of the interval, "
1501 "and %T__0_ is the period at %t__%mid_, as can be interpolated from the #Pitch contour.")
1502 LIST_ITEM (U"2. From this point, we recursively search for points %t__%i_ to the left "
1503 "until we reach the left edge of the interval. These points must be located between "
1504 "%t__%i\\--1_ \\-- 1.2 %T__0_(%t__%i\\--1_) and %t__%i\\--1_ \\-- 0.8 %T__0_(%t__%i\\--1_), "
1505 "and the cross-correlation of the amplitude "
1506 "in its environment [%t__%i_ \\-- %T__0_(%t__%i_) / 2; %t__%i_ + %T__0_(%t__%i_) / 2] "
1507 "with the amplitude of the environment of the existing point %t__%i\\--1_ must be maximal "
1508 "(we use parabolic interpolation between samples of the correlation function).")
1509 LIST_ITEM (U"3. The same is done to the right of %t__1_.")
1510 LIST_ITEM (U"4. Though the voiced/unvoiced decision is initially taken by the #Pitch contour, "
1511 "points are removed if their correlation value is less than 0.3; "
1512 "furthermore, one extra point may be added at the edge of the voiced interval "
1513 "if its correlation value is greater than 0.7.")
1514 MAN_END
1515
1516 MAN_BEGIN (U"Sound & Pitch: To PointProcess (peaks)...", U"ppgb", 20070722)
1517 INTRO (U"A command to create a @PointProcess from the selected @Sound and @Pitch objects.")
1518 ENTRY (U"Purpose")
1519 NORMAL (U"to interpret an acoustic periodicity contour as the frequency of an underlying point process "
1520 "(such as the sequence of glottal closures in vocal-fold vibration).")
1521 ENTRY (U"Algorithm")
1522 NORMAL (U"The voiced intervals are determined on the basis of the voiced/unvoiced decisions in the @Pitch object. "
1523 "For every voiced interval, a number of %points (or glottal pulses) is found as follows:")
1524 LIST_ITEM (U"1. The first point %t__1_ is the absolute extremum (or the maximum, or the minimum, depending on "
1525 "your %%Include maxima% and %%Include minima% settings) of the amplitude of the #Sound, "
1526 "between %t__%mid_ \\-- %T__0_ / 2 and %t__%mid_ + %T__0_ / 2, where %t__%mid_ is the midpoint of the interval, "
1527 "and %T__0_ is the period at %t__%mid_, as can be interpolated from the #Pitch contour.")
1528 LIST_ITEM (U"2. From this point, we recursively search for points %t__%i_ to the left "
1529 "until we reach the left edge of the interval. These points are the absolute extrema (or the maxima, or the minima) "
1530 "between the times "
1531 "%t__%i\\--1_ \\-- 1.2 %T__0_(%t__%i\\--1_) and %t__%i\\--1_ \\-- 0.8 %T__0_(%t__%i\\--1_).")
1532 LIST_ITEM (U"3. The same is done to the right of %t__1_.")
1533 NORMAL (U"The periods that are found in this way are much more variable than those found by "
1534 "@@Sound & Pitch: To PointProcess (cc)@, and therefore less useful for analysis and subsequent @@overlap-add@ synthesis.")
1535 MAN_END
1536
1537 }
1538
1539 /* End of file manual_pitch.cpp */