Debian Codegraph @

fon/manual_formant.cpp

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