Debian Codegraph @

fon/manual_glossary.cpp

raw symbols SCIP
1 /* manual_glossary.cpp
2 *
3 * Copyright (C) 1992-2008,2010,2011,2014-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 #include "manual_exampleSound.h"
22
23 static void draw_TimeDomain_Sound (Graphics g) {
24 Sound_draw (manual_exampleSound (), g, 0, 0, 0, 0, true, U"curve");
25 }
26 static void draw_TimeDomain_Pitch (Graphics g) {
27 Pitch_draw (manual_examplePitch (), g, 0, 0, 200.0, 500.0, true, Pitch_speckle_NO, kPitch_unit::HERTZ);
28 }
29
30 void manual_glossary_init (ManPages me);
31 void manual_glossary_init (ManPages me) {
32
33 MAN_BEGIN (U"aliasing", U"ppgb", 20040331)
34 INTRO (U"Aliasing (Du. %vouwvervorming) is the phenomenon of the ambiguity "
35 "of a sampled signal.")
36 ENTRY (U"Example")
37 NORMAL (U"With a sampling frequency of 10 kHz, a sine wave with a frequency of 3 kHz "
38 "receives the same representation as a sine wave with a frequency of 7 kHz, "
39 "13 kHz, or 17 kHz, and so on. If the sampled signal is meant to represent a "
40 "continuous spectral range starting at 0 Hz "
41 "(which is the most common case for speech recordings), "
42 "all these tones are likely to be interpreted as 3 kHz tones after sampling.")
43 NORMAL (U"To remedy this unwanted situation, the signal is usually low-pass filtered "
44 "with a cut-off frequency just below 5 kHz, prior to sampling.")
45 MAN_END
46
47 MAN_BEGIN (U"Click", U"ppgb", 19960913)
48 INTRO (U"One of the ways to control @Editors.")
49 ENTRY (U"How to click")
50 LIST_ITEM (U"1. Position the mouse above the object that you want to click.")
51 LIST_ITEM (U"2. Press and release the (left) mouse button.")
52 NORMAL (U"See also @@Shift-click@.")
53 ENTRY (U"Usage in the Praat program")
54 NORMAL (U"Clicking on an object is used for selecting this object while deselecting "
55 "all previously selected objects; clicking is also used for moving a cursor hair.")
56 MAN_END
57
58 MAN_BEGIN (U"constant extrapolation", U"ppgb", 20080425)
59 INTRO (U"- the interpretation of values in tiers before the first point or after the last point.")
60 ENTRY (U"Example")
61 NORMAL (U"The following is a @PitchTier with three points:")
62 SCRIPT (4, 3, U""
63 "Create PitchTier: \"tier\", 0, 0.5\n"
64 "Add point: 0.10, 170\n"
65 "Add point: 0.20, 180\n"
66 "Add point: 0.45, 110\n"
67 "Draw: 0, 0, 50, 250, \"yes\"\n"
68 "Remove\n"
69 "One mark left: 100, \"yes\", \"yes\", \"yes\", \"\"\n"
70 "One mark left: 150, \"yes\", \"yes\", \"yes\", \"\"\n"
71 "One mark left: 200, \"yes\", \"yes\", \"yes\", \"\"\n"
72 "One mark bottom: 0.1, \"yes\", \"yes\", \"yes\", \"\"\n"
73 "One mark bottom: 0.2, \"yes\", \"yes\", \"yes\", \"\"\n"
74 "One mark bottom: 0.3, \"yes\", \"yes\", \"yes\", \"\"\n"
75 "One mark bottom: 0.4, \"yes\", \"yes\", \"yes\", \"\"\n"
76 )
77 NORMAL (U"Between 0.10 and 0.20 seconds, the pitch rises from 170 to 180 Hz, "
78 "and between 0.20 and 0.45 seconds it falls from 180 to 110 Hz. "
79 "This is @@linear interpolation@.")
80 NORMAL (U"But what happens before 0.10 seconds? There, the pitch is just 170 Hz, "
81 "i.e. the value of the first pitch point. This is %%constant extrapolation% to the left.")
82 NORMAL (U"Likewise, after 0.45 seconds the pitch is just 110 Hz, "
83 "i.e. the value of the last pitch point. This is constant extrapolation to the right.")
84 ENTRY (U"Constant extrapolation in Praat")
85 NORMAL (U"Praat uses constant extrapolation in all tiers and grids with values at time points "
86 "(@PitchTier, @IntensityTier, @DurationTier, @AmplitudeTier, @FormantGrid).")
87 MAN_END
88
89 MAN_BEGIN (U"Drag", U"ppgb", 19960913)
90 INTRO (U"Dragging is one of the ways to control @Editors.")
91 ENTRY (U"How to drag")
92 LIST_ITEM (U"1. Position the mouse above the object that you want to drag.")
93 LIST_ITEM (U"2. Press the (left) mouse button.")
94 LIST_ITEM (U"3. Keeping the mouse button pressed, move the mouse across the window. "
95 "A shadow of the object will follow.")
96 LIST_ITEM (U"4. Release the mouse button when it is above the location where you want your object "
97 "to be moved (the %drop %site). If the drop site makes any sense, "
98 "the object will move there.")
99 NORMAL (U"See also @@Shift-drag@.")
100 ENTRY (U"Usage in the Praat program")
101 NORMAL (U"Dragging is used for manipulating the time and value of one or more marks, targets, or boundaries:")
102 MAN_END
103
104 MAN_BEGIN (U"end time", U"ppgb", 20060714)
105 INTRO (U"- the end of the @@time domain@ (see there).")
106 MAN_END
107
108 MAN_BEGIN (U"Fast Fourier Transform", U"ppgb", 20231115) // 20041123, 2024
109 INTRO (U"An algorithm for fast computation of the Fourier transform of a sampled signal. "
110 "It involves increasing the number of samples %N to the next-highest power of two, "
111 "and the computation time scales as %N log %N.")
112 NORMAL (U"In Praat, the Fast Fourier Transform is used:")
113 LIST_ITEM (U"1. For the Fourier transform of an entire sound: @@Sound: To Spectrum...@ with #yes for the #Fast setting, "
114 "and @@Spectrum: To Sound@.")
115 LIST_ITEM (U"2. For the Fourier transform of consecutive frames in a sound. See @@Sound: To Spectrogram...@.")
116 LIST_ITEM (U"3. For the fast computation of correlations, e.g. in @@Sound: To Pitch (raw autocorrelation)...@.")
117 MAN_END
118
119 MAN_BEGIN (U"FFT", U"ppgb", 20011121)
120 INTRO (U"An abbreviation for @@Fast Fourier Transform@.")
121 MAN_END
122
123 MAN_BEGIN (U"frequency", U"ppgb", 20030314)
124 INTRO (U"Frequency is how often something happens in a certain time, for instance "
125 "the number of times the Praat home page `praat.org` is visited every day.")
126 NORMAL (U"In Praat, frequency is the number of vibration cycles per second. "
127 "Although one can sometimes see the abbreviation %cps, Praat always uses Hz (short for %hertz), "
128 "which means the same.")
129 NORMAL (U"Unfortunately, there are two very distinct kinds of vibrations in speech analysis. "
130 "For pitch, frequency is the number of glottal cycles per second, and for spectral analysis, "
131 "frequency is the number of sine wave cycles per second. Quite some bit of the training of an "
132 "acoustic phonetician goes into the understanding of the difference between the ideas behind F0 and F1, "
133 "and many years can be spent on understanding the influence they have on each other in production, "
134 "acoustics, perception, or measurement...")
135 NORMAL (U"In order to prevent confusion, Praat always requires frequency to be expressed in Hz. "
136 "So if you want to supply a sampling frequency of 20 kiloHertz (20 kHz), you fill in 20000 or 2e4 or 20e3. "
137 "If you want to switch off pre-emphasis in some spectral analysis, you supply 1 GigaHertz (GHz) "
138 "for its \"from-frequency\", by typing 1e9.")
139 NORMAL (U"In Praat editor windows, frequency usually runs from bottom to top, since time already has to run "
140 "from left to right. This goes for spectrograms, pitch contours, and formant contours. "
141 "In spectral slices, frequency runs from left to right, since these have no time axis.")
142 MAN_END
143
144 MAN_BEGIN (U"linear interpolation", U"ppgb", 20080426)
145 INTRO (U"- the interpretation of values in tiers between the first point and the last point.")
146 ENTRY (U"Example")
147 NORMAL (U"The following is a @PitchTier with three points:")
148 SCRIPT (4, 3, U""
149 "Create PitchTier: \"tier\", 0, 0.5\n"
150 "Add point: 0.10, 170\n"
151 "Add point: 0.20, 180\n"
152 "Add point: 0.45, 110\n"
153 "Draw: 0, 0, 50, 250, \"yes\"\n"
154 "Remove\n"
155 "One mark left: 100, \"yes\", \"yes\", \"yes\", \"\"\n"
156 "One mark left: 150, \"yes\", \"yes\", \"yes\", \"\"\n"
157 "One mark left: 200, \"yes\", \"yes\", \"yes\", \"\"\n"
158 "One mark bottom: 0.1, \"yes\", \"yes\", \"yes\", \"\"\n"
159 "One mark bottom: 0.2, \"yes\", \"yes\", \"yes\", \"\"\n"
160 "One mark bottom: 0.3, \"yes\", \"yes\", \"yes\", \"\"\n"
161 "One mark bottom: 0.4, \"yes\", \"yes\", \"yes\", \"\"\n"
162 )
163 NORMAL (U"Between 0.10 and 0.20 seconds, the pitch rises linearly from 170 to 180 Hz, "
164 "and between 0.20 and 0.45 seconds it falls linearly from 180 to 110 Hz. "
165 "This is %%linear interpolation%: at all times between two adjacent points, "
166 "the pitch values follow the straight line that connects the two points.")
167 NORMAL (U"(Before 0.10 seconds and after 0.45 seconds there is @@constant extrapolation@.)")
168 ENTRY (U"Linear interpolation in Praat")
169 NORMAL (U"Praat uses linear interpolation in all tiers and grids with values at time points "
170 "(@PitchTier, @IntensityTier, @DurationTier, @AmplitudeTier, @FormantGrid).")
171 MAN_END
172
173 MAN_BEGIN (U"Nyquist frequency", U"ppgb", 20040331)
174 INTRO (U"The %%Nyquist frequency% is the bandwidth of a sampled signal, "
175 "and is equal to half the sampling frequency of that signal. "
176 "If the sampled signal should represent a continuous spectral range starting "
177 "at 0 Hz (which is the most common case for speech recordings), "
178 "the Nyquist frequency is the highest frequency that the sampled signal "
179 "can unambiguously represent.")
180 ENTRY (U"Example")
181 NORMAL (U"If a speech signal is sampled at 22050 Hz, the highest frequency that we can "
182 "expect to be present in the sampled signal is 11025 Hz. "
183 "This means that to heed this expectation, we should run the continuous signal "
184 "through a low-pass filter with a cut-off frequency below 11025 Hz; "
185 "otherwise, we would experience the phenomenon of @aliasing.")
186 NORMAL (U"Of course, with a sampling frequency of 22050 Hz we could also represent a signal "
187 "band-limited between, say, 40000 Hz and 51025 Hz, but this seems less useful "
188 "in speech research.")
189 MAN_END
190
191 MAN_BEGIN (U"objects", U"ppgb", 20030528)
192 INTRO (U"The things that contain the data in the Praat program.")
193 NORMAL (U"The objects are visible in the @@List of Objects@ in the @@Objects window@.")
194 NORMAL (U"Most objects are contained in memory: they are %not files! "
195 "Therefore, you may want to save them with one of the commands from the @@Save menu@ "
196 "before you @Quit. "
197 "Exceptions are the LongSound objects in the Praat program and the file-based dictionaries "
198 "in the ALS program.")
199 NORMAL (U"You can create an object by choosing a command from the @@New menu@ "
200 "or from the @@Open menu@.")
201 NORMAL (U"When you select one or more objects, you can perform on them the actions that are shown "
202 "in the @@dynamic menu@, on the ##fixed buttons# below the list of objects, "
203 "or in the @@Save menu@. You can choose hidden actions with the help of the @ButtonEditor.")
204 MAN_END
205
206 MAN_BEGIN (U"overlap-add", U"ppgb", 20070816)
207 INTRO (U"A method for manipulating the pitch and duration of an acoustic speech signal. "
208 "This method was realized by @@Moulines & Charpentier (1990)@, "
209 "who called it Time-Domain Pitch-Synchronous Overlap-and-Add (TD-PSOLA). "
210 "Nowadays, PSOLA™ and TD-PSOLA™ are trademarks owned by France Telecom^®.")
211 ENTRY (U"Overlap-add synthesis")
212 NORMAL (U"When a @Sound is created from a @Manipulation object, the following steps are performed:")
213 LIST_ITEM (U"1. From the @PitchTier, new points are generated along the entire time domain, "
214 "with the method of @@PitchTier: To PointProcess@.")
215 LIST_ITEM (U"2. The period information in the original pulses (available in the Manipulation object) "
216 "is used to remove from the new pulses all points that lie within voiceless intervals "
217 "(i.e., places where the distance between adjacent points in the original pulses is greater than 20 ms).")
218 LIST_ITEM (U"3. The voiceless parts are copied from the source Sound to the target Sound, "
219 "re-using some parts if the local duration is greater than 1.")
220 LIST_ITEM (U"4. For each target point, we look up the nearest source point. A piece of the source Sound, "
221 "centred around the source point, is copied to the target Sound at a location determined by "
222 "the target point, using a bell-shaped window whose left-hand half-length is the minimum "
223 "of the left-hand periods adjacent to the source and target points "
224 "(and analogously for the right-hand half-length).")
225 MAN_END
226
227 MAN_BEGIN (U"pitch floor", U"ppgb", 20060914)
228 INTRO (U"The pitch floor is the bottom of the pitch range in the Sound window (see the @Intro). "
229 "The standard setting is 75 hertz; pitch values below this pitch floor will not be computed or shown by Praat.")
230 NORMAL (U"To change the pitch floor, choose @@Pitch settings...@.")
231 MAN_END
232
233 MAN_BEGIN (U"power spectral density", U"ppgb", 20101026)
234 INTRO (U"The average power in a sound during a certain time range and in a certain frequency range, expressed in Pa^2/Hz.")
235 ENTRY (U"Mathematical definition")
236 NORMAL (U"The %%complex spectrum% of a sound %x(%t) in the time range (%t__1_, %t__2_) is")
237 EQUATION (U"%X(%f) ≡ ∫__%%t%1_^^%%t%2^ %x(%t) e^^-2%π%ift^ %dt")
238 NORMAL (U"for any frequency %f in the two-sided frequency domain (-%F, +%F). "
239 "If %x(%t) is expressed in units of Pascal, %X(%f) is expressed in units of Pa/Hz. "
240 "In Praat, this complex spectrum is the quantity stored in a @Spectrum.")
241 NORMAL (U"From the complex spectrum we can compute the %%one-sided power spectral density% in Pa^2/Hz as")
242 EQUATION (U"PSD(%f) ≡ 2|%X(%f)|^2 / (%t__2_ - %t__1_)")
243 NORMAL (U"where the factor 2 is due to adding the contributions from positive and negative frequencies. "
244 "In Praat, this power spectral density is the quantity stored in a @Spectrogram.")
245 NORMAL (U"The PSD divides up the total power of the sound. "
246 "To see this, we integrate it over its entire one-sided frequency domain (0, %F):")
247 EQUATION (U"∫__0_^^%F^ PSD(%f) %df = ∫__0_^^%F^ 2|%X(%f)|^2/(%t__2_-%t__1_) %df =")
248 EQUATION (U"= 1/(%t__2_-%t__1_) ∫__-%F_^^+%F^ |%X(%f)|^2 %df = 1/(%t__2_-%t__1_) ∫__%%t%1_^^%%t%2^ |%x(%t)|^2 %dt")
249 NORMAL (U"where the last step uses %%Parceval's theorem%. "
250 "The result is precisely the average power of the sound in the time range (%t__1_, %t__2_).")
251 ENTRY (U"The logarithmic power spectral density")
252 NORMAL (U"It is often useful to express the power spectral density in dB relative to %%P__ref_% = 2·10^^-5^ Pa:")
253 EQUATION (U"PSD__dB_(%f) = 10 log__10_ { PSD(%f) / %%P__ref_%^2 }")
254 NORMAL (U"Since the argument of the logarithm is in units of Hz^^-1^, this spectral measure can loosely be said "
255 "to be in units of “dB/Hz”. In Praat, this logarithmic power spectral density is the quantity stored in an @Ltas; "
256 "it is also the quantity shown in pictures of a @Spectrum and a @Spectrogram.")
257 MAN_END
258
259 MAN_BEGIN (U"quantile algorithm", U"ppgb", 19980101)
260 INTRO (U"An algorithm to compute the specified quantile of a sorted array of real numbers.")
261 NORMAL (U"The %n\\% %quantile of a continuous real-valued distribution is the value below which %n\\% of the values "
262 "is expected to lie. If we are given an array of real numbers that we want to interpret as having been drawn from a "
263 "distribution, we can %estimate the quantiles of the underlying distribution.")
264 ENTRY (U"1. The median")
265 NORMAL (U"The %median is a special case of a quantile: it is the 50\\% quantile. It is usually estimated as follows: "
266 "from an odd number of values, take the middle value; form an even number, take the average of "
267 "the two midmost values. For instance, if our values are 15, 20, and 32, the median is 20; "
268 "if our values are 15, 20, 32, and 60, the median is 26.")
269 NORMAL (U"This estimate is direction-independent: if we multiply all values by -1 (i.e., they become -60, -32, -20, and -15), "
270 "the median is also multiplied by -1 (it becomes -26).")
271 ENTRY (U"2. Percentiles?")
272 NORMAL (U"The %%n%th %percentile of a set of values is usually defined as the highest attested value "
273 "for which at most %n\\% of all attested values are less or equal. "
274 "For instance, if our values are 15, 20, 32, and 60, the 30th percentile is 15. Here is an extensive list:")
275 LIST_ITEM (U"\tPercentile number\tValue")
276 LIST_ITEM (U"\t0\t-")
277 LIST_ITEM (U"\t10\t-")
278 LIST_ITEM (U"\t20\t-")
279 LIST_ITEM (U"\t30\t15")
280 LIST_ITEM (U"\t40\t15")
281 LIST_ITEM (U"\t50\t20")
282 LIST_ITEM (U"\t60\t20")
283 LIST_ITEM (U"\t70\t20")
284 LIST_ITEM (U"\t80\t32")
285 LIST_ITEM (U"\t90\t32")
286 LIST_ITEM (U"\t100\t60")
287 NORMAL (U"However, this procedure does not yield an estimate of the quantiles of the underlying distribution. "
288 "For instance, the estimate is direction-dependent: if we multiply all values by -1, the 50th percentile "
289 "becomes -32 instead of -20, and the 70th percentile becomes -32 instead of the expected -15, "
290 "which is minus the 30th percentile of the original data set.")
291 ENTRY (U"3. Unbiased quantiles")
292 NORMAL (U"To get a better estimate of the quantiles of the underlying distribution, the interpolation that we used "
293 "to determine the median, is generalized to %any quantile.")
294 NORMAL (U"We assume that the attested values 15, 20, 32, and 60 each take up one quarter of the \"quantile space\". "
295 "These four values are in the middles of those quarters, so they are at the 0.125, 0.375, 0.625, and 0.875 quantiles.")
296 NORMAL (U"Quantiles in between 0.125 and 0.875 are evaluated by linear interpolation: the 0.25, 0.50, and 0.75 quantiles "
297 "are 17.5, 26, and 46, respectively. Note that the 0.50 quantile is the median. The 0.40 quantile, for example, "
298 "is estimated as 20 + (32 - 20)·(0.40 - 0.375)/(0.625 - 0.375) = 21.2.")
299 NORMAL (U"Quantiles between 0 and 0.125 or between 0.875 and 1 are evaluated by linear extrapolation from the "
300 "lowest or highest pair of values: the 0\\% quantile is estimated as 15 - 1/2 (20 - 15) = 12.5, "
301 "and the 100\\% quantile is estimated as 60 + 1/2 (60 – 32) = 74. The 0.10 quantile is estimated as "
302 "12.5 + (15 – 12.5)·(0.10 – 0.0)/(0.125 – 0.0) = 14.5.")
303 NORMAL (U"Note that the estimated values for the very low or high quantiles can lie outside the range of attested values. "
304 "In fact, the computed 0\\% and 100\\% quantiles are thought to be estimates of the minimum and maximum values "
305 "of the distribution. For uniform distributions, these estimates are reasonable; for a normal distribution, of course, "
306 "the 0\\% and 100\\% quantiles are meaningless.")
307 MAN_END
308
309 MAN_BEGIN (U"sampling frequency", U"ppgb", 20220102)
310 INTRO (U"The sampling frequency (or %%sample rate%) is the number of samples per second in a @Sound. "
311 "For example: if the sampling frequency is 44100 hertz, a recording with a duration of 60 seconds "
312 "will contain 2,646,000 samples.")
313 NORMAL (U"Usual values for the sampling frequency are 44100 Hz (Compact Disc) and 48000 Hz (much modern audio equipment) "
314 "(both enough for the human auditory system, since humans cannot hear frequencies above 20000 Hz; see @aliasing).")
315 NORMAL (U"To get the sampling frequency of a selected #Sound, click #Info or choose @@Get sampling frequency@.")
316 MAN_END
317
318 MAN_BEGIN (U"sampling period", U"ppgb", 20040415)
319 INTRO (U"The sampling period is the time difference between two consecutive samples in a @Sound. "
320 "It is the inverse of the @@sampling frequency@. For example: if the sampling frequency "
321 "is 44100 Hz, the sampling period is 1/44100 = 2.2675736961451248e-05 seconds: "
322 "the samples are spaced approximately 23 microseconds apart.")
323 NORMAL (U"To get the sampling period of a selected #Sound, click #Info or choose @@Get sampling period@.")
324 MAN_END
325
326 MAN_BEGIN (U"Shift-drag", U"ppgb", 19980823)
327 INTRO (U"Shift-dragging is one of the ways to control @Editors.")
328 ENTRY (U"How to Shift-drag")
329 LIST_ITEM (U"1. Position the mouse above any of the objects that you want to drag "
330 "(the objects were probably selected first).")
331 LIST_ITEM (U"2. Press a Shift key.")
332 LIST_ITEM (U"3. Press the (left) mouse button.")
333 LIST_ITEM (U"4. Keeping the mouse button pressed, move the mouse across the window. "
334 "A shadow of the objects will follow.")
335 LIST_ITEM (U"5. Release the mouse button when it is above the location where you want your objects "
336 "to be moved. If this %%drop site% makes any sense, the objects will move there.")
337 ENTRY (U"Usage in the Praat program")
338 NORMAL (U"While plain @@drag@ging is used for moving objects that were selected first by clicking, "
339 "##Shift-dragging# is used for manipulating the times and values of more marks, targets, "
340 "or boundaries simultaneously:")
341 MAN_END
342
343 MAN_BEGIN (U"Shift-click", U"ppgb", 19960913)
344 INTRO (U"One of the ways to control @Editors.")
345 ENTRY (U"How to Shift-click")
346 LIST_ITEM (U"1. Position the mouse above the object that you want to Shift-click.")
347 LIST_ITEM (U"2. Press a Shift key.")
348 LIST_ITEM (U"3. Press and release the (left) mouse button.")
349 ENTRY (U"Usage in the Praat program")
350 NORMAL (U"Whereas plain @@click@ing is used for selecting only one object while deselecting "
351 "all previously selected objects, ##Shift-click# is used for selecting a mark, target, "
352 "or boundary, %without deselecting the previously selected objects:")
353 MAN_END
354
355 MAN_BEGIN (U"sound pressure calibration", U"ppgb", 20041119)
356 NORMAL (U"Your computer's sound-recording software returns integer values between -32768 and 32767. "
357 "Praat divides them by 32768 before putting them into a Sound object, "
358 "so that the values in the Sound objects are always between -1 and +1.")
359 NORMAL (U"The Praat program considers these numbers to be air pressures in units of Pascal.")
360 NORMAL (U"These values in Pascal are probably not the actual true air pressures that went into the microphone. "
361 "To determine what the actual air pressures were, you have to record an extra sound with a known air pressure, "
362 "with the same recording gain as the rest of your recordings. It is best if this extra sound is something "
363 "like a white noise, so that its @@sound pressure level@ can be determined reliably. A sine wave of 400 Hz, "
364 "for instance, is less suitable, since its sound pressure level at your microphone can depend very strongly "
365 "on the precise position and direction of the loudspeaker and on the position of other objects (like you, "
366 "the experimenter) in the room (differences of 10 dB are no exception).")
367 NORMAL (U"For example, suppose that you record some speech on a CD recorder or with Praat's SoundRecorder. "
368 "Immediately before or after this recording, you also record a white noise produced by a noise generator. "
369 "With a dB meter (Linear or C setting), located at the same position as the microphone of the recording, "
370 "you measure that the Sound Pressure Level of this noise is 76.5 dB. "
371 "When you later open the recorded noise in Praat's sound window, Praat tells you that its average intensity "
372 "(switch on ##Show intensity#) is 68.6 dB. You then know that you have to add 7.9 dB to intensities measured in Praat "
373 "to get at the true sound pressure level. Thus, if your speech contains a long [a:] whose average intensity "
374 "is measured in the Sound window as 71.1 dB, its true sound pressure level must be 79.0 dB.")
375 NORMAL (U"In this example, you can make Praat's sound window show the true sound pressures in Pascal "
376 "and true sound pressure levels in dB, if you multiply the sound with a factor of 10^^(7.9/20)^, "
377 "which you can do by selecting the Sound and choosing ##Multiply...# from the #Modify menu, "
378 "then supplying `10^(7.9/20)` as the multiplication factor.")
379 MAN_END
380
381 MAN_BEGIN (U"sound pressure level", U"ppgb", 20041124)
382 NORMAL (U"Air pressures are measured in Pascal (Pa), which are Newtons per square metre (N/m^2). "
383 "The ambient air pressure is about 100,000 Pa, and the lungs modify this in phonation "
384 "only by a small amount, namely 200 to 1000 Pa (= 2 to 10 cm H__2_O). "
385 "Outside your body, the air pressures caused by your speech are much smaller again, "
386 "namely 0.01 to 1 Pa at 1 metre from your lips. These are comparable to the values that you "
387 "see for a typical speech recording in Praat's sound window, "
388 "although these numbers in Praat can be interpreted as true air pressures only if you perform "
389 "a @@sound pressure calibration@ (including the multiplication).")
390 NORMAL (U"A normative human ear can detect a root-mean-squared air pressure "
391 "as small as 0.00002 Pa, for a sine wave with a frequency of 1000 Hz. "
392 "The %%sound pressure level% can be expressed in dB relative to this normative threshold:")
393 EQUATION (U"SPL = 10 log__10_ { 1/(%t__2_-%t__1_) ∫__t1_^^t2^ %x^2(%t) %dt / (2·10^^-5^ Pa)^2 }")
394 NORMAL (U"where %x(%t) is the sound pressure in Pa as a function of time, "
395 "and %t__1_ and %t__2_ are the times between which the energy (squared air pressure) is averaged. "
396 "For a calibrated sound, Praat's sound window will show you the SPL as a function of time, "
397 "if you switch on ##Show intensity# and set its ##averaging method# to #energy (with ##Intensity settings...#).")
398 MAN_END
399
400 MAN_BEGIN (U"spectro-temporal representation", U"ppgb", 20030314)
401 INTRO (U"A representation (of a sound signal, for instance) as some sort of intensity as a function "
402 "of @time and @frequency. In Praat, we have the @Spectrogram, which is acoustic energy density as a "
403 "function of time in seconds and frequency in Hz, and the @Cochleagram, which is basilar membrane "
404 "excitation as a function of time in seconds and frequency in Bark.")
405 NORMAL (U"For tutorial information, see @@Intro 3.1. Viewing a spectrogram@.")
406 MAN_END
407
408 MAN_BEGIN (U"start time", U"ppgb", 20060714)
409 INTRO (U"- the beginning of the @@time domain@ (see there).")
410 MAN_END
411
412 MAN_BEGIN (U"stereo", U"ppgb", 20110131) // 2023
413 INTRO (U"A stereo sound is a sound consisting of a left and a right channel. "
414 "Praat can read and write both mono and stereo sounds.")
415 ENTRY (U"Reading a stereo sound from disk")
416 NORMAL (U"If you read a @Sound into Praat from disk with @@Read from file...@, "
417 "and that sound file is a stereo file, the resulting Sound object will be a stereo Sound.")
418 NORMAL (U"If you want to look at the left or right channel separately, "
419 "you can use @@Extract one channel...@.")
420 ENTRY (U"Saving a stereo sound to disk")
421 NORMAL (U"If you choose @@Save as WAV file...@, and the sound is a stereo sound, "
422 "then the sound file will be a stereo file. "
423 "If you have two or more mono sounds and you want to combine them into one stereo sound, "
424 "you can use @@Sounds: Combine to stereo@.")
425 MAN_END
426
427 MAN_BEGIN (U"time", U"ppgb", 20110128)
428 INTRO (U"In normal life, time is how late the watch says it is.")
429 NORMAL (U"In Praat, this definition is largely irrelevant. "
430 "Sound files rarely tell us the absolute time of recording. "
431 "So when you read a sound file into Praat and click ##View & Edit#, you will see "
432 "that the Sound starts at a time of 0 seconds, and if its duration is 3.5 seconds, "
433 "you will see that the Sound finishes at a time of 3.5 seconds.")
434 NORMAL (U"Besides sounds, many other types of objects in Praat have a time scale as well: "
435 "spectrograms, pitch contours, formant contours, point processes, and so on. None of these "
436 "are required to have a time domain that starts at 0 seconds. In the Sound editor window, for example, "
437 "you can select the part that runs from 1.4. to 1.7 seconds, and \"extract\" it to the Objects window "
438 "while \"preserving the times\". The resulting Sound object will have a start time of 1.4 seconds "
439 "and an end time of 1.7 seconds, as you can see when you click ##View & Edit#. "
440 "Spectrograms and pitch contours that you create from this sound will also have a time domain "
441 "from 1.4 to 1.7 seconds. This time domain is preserved if you save these objects to a text file "
442 "or to a binary file and read them into Praat again later. Only if you save the Sound object "
443 "to an audio file (WAV, AIFF), the time information is not preserved in that file; "
444 "if you read such an audio file into Praat again, the time domain of the new Sound object "
445 "will run from 0 to 0.3 seconds.")
446 NORMAL (U"In order to prevent confusion, Praat always requires times to be expressed in seconds. "
447 "So if you want to supply a window length of 5 milliseconds (5 ms), you fill in 0.005 or 5e-3. "
448 "For 83.2 microseconds (83.2 μs), you say 0.0000832, or better 83.2e-6 or 8.32e-5.")
449 NORMAL (U"On a clock, time runs around in circles. In Praat's editor windows, time runs from left to right. "
450 "You can often see only a part of the time scale in the window. "
451 "To see another part, you %scroll backward or forward.")
452 MAN_END
453
454 MAN_BEGIN (U"time domain", U"ppgb", 20221202)
455 INTRO (U"This manual page assumes that you have read the @Intro.")
456 NORMAL (U"Many objects in Praat are %%functions of time%. Examples are: "
457 "@Sound, @Pitch, @Spectrogram, @Formant, @Intensity, @TextGrid, "
458 "@PitchTier, @DurationTier, @Harmonicity, @PointProcess.")
459 NORMAL (U"In Praat, these functions have a contiguous ##time domain#, i.e. "
460 "a single time stretch with a @@start time@ and an @@end time@. "
461 "The @@total duration@ of such a function is the difference between the start time "
462 "and the end time. There are up to five ways to see the time domain "
463 "of an object.")
464 ENTRY (U"The time domain in editor windows")
465 NORMAL (U"If you select an object that is a function of time and click ##View & Edit#, an editor window "
466 "will appear on the screen. The rectangle at the bottom will show the start time, "
467 "the end time, and the total duration.")
468 ENTRY (U"The time domain in the picture window")
469 NORMAL (U"If you select an object that is a function of time and choose one of the #Draw commands, "
470 "the window that pops up will invite you to supply a time range. If you keep this time range "
471 "at its standard setting (from 0.0 to 0.0 seconds), Praat will draw the object for the whole time domain "
472 "and print the start time and the end time below the horizontal axis (if #Garnish is on):")
473 PICTURE (5, 2.5, draw_TimeDomain_Sound)
474 PICTURE (5, 2.5, draw_TimeDomain_Pitch)
475 ENTRY (U"The time domain in the Info window")
476 NORMAL (U"If you select an object that is a function of time and click #Info, "
477 "the Info window will tell you the start time, the end time, and the total duration (among other properties of the object).")
478 ENTRY (U"Time domain query commands")
479 NORMAL (U"If you select an object that is a function of time, "
480 "the following three commands will become available in the @@Query submenu@:")
481 LIST_ITEM (U"##Get start time")
482 LIST_ITEM (U"##Get end time")
483 LIST_ITEM (U"##Get total duration")
484 NORMAL (U"If you choose one of these commands, the Info window will tell you the result, "
485 "expressed in seconds. These commands are most useful in a Praat script. Example:")
486 CODE (U"selectObject: \"Pitch hello\"")
487 CODE (U"startTime = Get start time")
488 CODE (U"endTime = Get end time")
489 CODE (U"centreTime = (startTime + endTime) / 2")
490 CODE (U"writeInfoLine: \"This Pitch runs from \", startTime, \" to \", endTime, \" seconds,\"")
491 CODE (U"appendInfoLine: \"and the centre of its time domain is at \", centreTime, \" seconds.\"")
492 ENTRY (U"Details for hackers")
493 NORMAL (U"If you select an object that is a function of time and you click @Inspect, "
494 "you can see how the time domain information is stored in the object: "
495 "the start time is the object's #xmin attribute and the end time is its #xmax attribute. "
496 "The total duration is not stored in the object, "
497 "because it can easily be computed as #xmax minus #xmin.")
498 MAN_END
499
500 MAN_BEGIN (U"time selection", U"ppgb", 20220907)
501 INTRO (U"The ways to select a part of the time domain in some @editors in Praat, "
502 "namely those that contain a function of time.")
503 NORMAL (U"The ##time selection# is used for selecting the time interval that will be played, "
504 "copied, cut, modified, or questioned:")
505 ENTRY (U"1. How to make a selection")
506 NORMAL (U"The easiest way is to @drag the mouse across the part that you want to select. "
507 "This is analogous to how selection works in a text processor.")
508 ENTRY (U"2. How to extend or shrink a selection")
509 NORMAL (U"The easiest way is to click with the Shift key pressed. "
510 "The nearest edge of the selection will move to the time position where you clicked. "
511 "This is analogous to how extending a selection works in a text processor.")
512 NORMAL (U"For instance, if the currently selected time interval runs from 2 to 5 seconds, "
513 "and you shift-click at a time position of 4 seconds, the end of the selection will move "
514 "from 5 to 4 seconds, thus shrinking the selection.")
515 NORMAL (U"You can also shift-drag, i.e. hold the Shift key and the mouse button down while moving the mouse.")
516 ENTRY (U"3. Other tricks")
517 NORMAL (U"To select a specific time stretch or collapse the selection to its start or end, use the Time menu.")
518 MAN_END
519
520 MAN_BEGIN (U"total duration", U"ppgb", 20040505)
521 INTRO (U"- the extent of the @@time domain@ (see there).")
522 MAN_END
523
524 MAN_BEGIN (U"vector peak interpolation", U"ppgb", 20200912 20250418)
525 INTRO (U"An algorithm for finding a maximum or a minimum in a sampled signal.")
526 ENTRY (U"Overview")
527 NORMAL (U"The signal is described with the sequence %y__%i_, %i = 1...%n, where %n is the number of samples. "
528 "Each sample %i is associated with an %x value (typically, time) given by %x__%i_ = %x__1_ + (%i - 1) %dx, "
529 "where %dx is the sample period.")
530 NORMAL (U"The maximum is looked for in two kinds of locations:")
531 LIST_ITEM (U"1. At the left and right edge, i.e. at %i = 1 and at %i = %n.")
532 LIST_ITEM (U"2. At or %near all local maxima, i.e. at or %near those %i that satisfy %y__%i-1_ < %y__%i_ ≤ %y__%i+1_.")
533 NORMAL (U"The greatest of the following values, therefore, will be the maximum:")
534 LIST_ITEM (U"1. %y__1_.")
535 LIST_ITEM (U"2. The local maxima, which are at or %near %y__%i_, where %y__%i-1_ < %y__%i_ ≤ %y__%i+1_.")
536 LIST_ITEM (U"3. %y__%n_.")
537 NORMAL (U"We will now see what %near means. The precision of the result depends on the %%interpolation method% of this algorithm.")
538 ENTRY (U"1. Lowest precision: round to sample")
539 NORMAL (U"If the interpolation method is “none”, the local maxima are %at the samples %m that satisfy %y__%m-1_ < %y__%m_ ≤ %y__%m+1_. "
540 "Thus, their %x values are at %x__%m_ = %x__1_ + (%m - 1) %dx, and their %y values are %y__%m_.")
541 NORMAL (U"This kind of precision is appropriate for an unordered sequence of values %y__%i_: the result is simply the greatest available value.")
542 ENTRY (U"2. Middle precision: parabolic interpolation")
543 NORMAL (U"If the interpolation method is “parabolic”, the algorithm uses one point on each side of every local maximum %y__%m_ "
544 "to estimate the location and value of the local maximum. Because a Taylor expansion shows that any smooth curve "
545 "can be approximated as a parabola in the vicinity of any local maximum, the location %x__%max_ and value %y__%max_ can be found "
546 "with the following procedure:")
547 EQUATION (U"%dy ≡ 1/2 (%y__%m+1_ - %y__%m-1_)")
548 EQUATION (U"%d^2%y ≡ (%y__%m_ - %y__%m-1_) + (%y__%m_- %y__%m+1_)")
549 EQUATION (U"%m′ ≡ %m + %dy/%d^2%y")
550 EQUATION (U"%x__%max_ = %x__1_ + (%m′ - 1) %dx")
551 EQUATION (U"%y__%max_ = %y__%m_ + 1/2 %dy^2 / %d^2%y")
552 NORMAL (U"This kind of precision is appropriate if %y is considered a smooth function of %x, as in:")
553 LIST_ITEM (U"@@Formant: Get minimum...")
554 LIST_ITEM (U"@@Formant: Get time of minimum...")
555 LIST_ITEM (U"@@Formant: Get maximum...")
556 LIST_ITEM (U"@@Formant: Get time of maximum...")
557 LIST_ITEM (U"@@Intensity: Get minimum...")
558 LIST_ITEM (U"@@Intensity: Get time of minimum...")
559 LIST_ITEM (U"@@Intensity: Get maximum...")
560 LIST_ITEM (U"@@Intensity: Get time of maximum...")
561 ENTRY (U"3. Higher precision: cubic interpolation")
562 NORMAL (U"If the interpolation method is “cubic”, the interpolation is performed over four points (see @@vector value interpolation@). "
563 "The results are similar to those of the parabolic interpolation method, but you can use it (or sinc interpolation) if you want the result of a "
564 "command like ##Get maximum...# to be equal to the result of a sequence of commands like "
565 "##Get time of maximum...# and ##Get value at time...#.")
566 ENTRY (U"4. Highest precision: sinc interpolation")
567 NORMAL (U"If the interpolation method is “sinc70” or “sinc700”, the algorithm assumes that the signal "
568 "is a sum of sinc functions, so that a number of points (namely, 70 or 700) on each side of the initial guess %m must be taken into account "
569 "(see @@vector value interpolation@). The algorithm finds the maximum of this continuous function by Brent's method (see @@Press et al. (1992)@).")
570 NORMAL (U"This method is appropriate for signals that result from sampling a continuous signal after it has been low-pass filtered "
571 "at the @@Nyquist frequency@. See:")
572 LIST_ITEM (U"@@Sound: Get minimum...")
573 LIST_ITEM (U"@@Sound: Get time of minimum...")
574 LIST_ITEM (U"@@Sound: Get maximum...")
575 LIST_ITEM (U"@@Sound: Get time of maximum...")
576 LIST_ITEM (U"@@Sound: Get absolute extremum...")
577 MAN_END
578
579 MAN_BEGIN (U"vector value interpolation", U"ppgb", 20200912)
580 INTRO (U"An algorithm for estimating the value of a sampled signal at a specified location.")
581 ENTRY (U"Overview")
582 NORMAL (U"The signal is described with the sequence %y__%i_, %i = 1...%n, where %n is the number of samples. "
583 "Each sample %i is associated with an %x location (typically, time) given by %x__%i_ = %x__1_ + (%i - 1) %dx, "
584 "where %dx is the sample period, so that the real-valued sample number associated with a given time %x is")
585 EQUATION (U"%s = (%x - %x__1_) / %dx + 1")
586 NORMAL (U"If the resulting %s is an integer number, the %y value must be %y__%s_. Otherwise, the estimated %y value %y(%s) must be interpolated "
587 "from nearby values of %y. The precision of the result depends on the %%interpolation method% of this algorithm.")
588 ENTRY (U"1. Lowest precision: round to sample")
589 NORMAL (U"If the interpolation method is “nearest”, we take the value of the nearest point in either direction:")
590 EQUATION (U"%near ≡ round (%s)")
591 EQUATION (U"%y(%s) ≈ %y__%near_")
592 ENTRY (U"2. Middle precision: linear interpolation")
593 NORMAL (U"If you know or assume that the function that underlies your points is continuous, the \"rounding\" interpolation would be poor, "
594 "because the rounded value would abruptly change at the centres between the sample points.")
595 NORMAL (U"For a linear interpolation, therefore, we use the attested values on both sides (%left and %right) of %s:")
596 EQUATION (U"%s__%l_ ≡ floor (%s) ; %s__%r_ ≡ %s__%l_ + 1")
597 EQUATION (U"%y(%s) ≈ %y__%l_ + (%s - %s__%l_) · (%y__%r_ - %y__%l_)")
598 NORMAL (U"where #floor (%x) computes the greatest integer not greater than %x. This interpolation is continuous.")
599 ENTRY (U"3. Higher precision: cubic interpolation")
600 NORMAL (U"If you know or assume that the function that underlies your points is %smooth, i.e. its derivative is defined for every %x, "
601 "linear interpolation would probably be poor, because the derivative of the interpolated function would abruptly change at every "
602 "sample point.")
603 NORMAL (U"The next higher interpolation (“cubic”), therefore, is differentiable at sample points. To enforce this, we define the "
604 "derivatives %y′__%l_ and %y′__%r_ at the left and right sample points on the basis of %their immediate neighbours "
605 "(i.e., the algorithm needs four sample points), perhaps by a parabolic interpolation through these three points. "
606 "A parabolic interpolation has the advantage that the extrema will be computed correctly if "
607 "the underlying function can be approximated by a parabola near its extremes (see @@vector peak interpolation@).")
608 NORMAL (U"Because the derivative of a parabolic function is a linear function of %x, "
609 "the derivatives at the left and right sample points are simply estimated as")
610 EQUATION (U"%y′__%l_ ≈ (%y__%r_ - %y__%l-1_) / 2 ; %y′__%r_ ≈ (%y__%r+1_ - %y__%l_) / 2")
611 NORMAL (U"Now that we know %y__%l_, %y__%r_, %y′__%l_, and %y′__%r_, we can fit these values with a "
612 "third-degree (%cubic) polynomial:")
613 EQUATION (U"%As__%l_^3 + %Bs__%l_^2 + %Cs__%l_ + %D = %y__%l_")
614 EQUATION (U"%As__%r_^3 + %Bs__%r_^2 + %Cs__%r_ + %D = %y__%r_")
615 EQUATION (U"3%As__%l_^2 + 2%Bs__%l_ + %C = %y′__%l_")
616 EQUATION (U"3%As__%r_^2 + 2%Bs__%r_ + %C = %y′__%r_")
617 NORMAL (U"If we shift the %x axis to the left sample point, we can reduce the four equations to")
618 EQUATION (U"%D = %y__%l_")
619 EQUATION (U"%A + %B + %C + %D = %y__%r_")
620 EQUATION (U"%C = %y′__%l_")
621 EQUATION (U"3%A + 2%B + %C = %y′__%r_")
622 NORMAL (U"so that the interpolated value %y(%s) at any point %s between %s__%l_ and %s__%r_ is estimated as")
623 EQUATION (U"(%y′__%r_ + %y′__%l_ - 2%y__%r_ + 2%y__%l_) %φ__%l_^3 + "
624 "(3%y__%r_ - 3%y__%l_ - 2%y′__%l_ - %y′__%r_) %φ__%l_^2 + %y′__%l_ %φ__%l_ + %y__%l_")
625 NORMAL (U"where %φ__%l_ ≡ %s - %s__%l_. Some rearrangement gives")
626 EQUATION (U"%y(%s) ≈ %y__%l_ %φ__%r_ + %y__%r_ %φ__%l_ +")
627 EQUATION (U"- %φ__%l_ %φ__%r_ [1/2 (%y′__%r_ - %y′__%l_) + (%φ__%l_ - 1/2) "
628 "(%y′__%l_ + %y′__%r_ - 2(%y__%r_ - %y__%l_))]")
629 NORMAL (U"where %φ__%r_ ≡ 1 - %φ__%l_. From this formula we see:")
630 LIST_ITEM (U"1. The first two terms define the linear interpolation.")
631 LIST_ITEM (U"2. If the underlying function is linear, so that %y′__%l_ equals %y′__%r_ and both equal %y__%r_ - %y__%l_, "
632 "the higher-degree terms are zero.")
633 LIST_ITEM (U"3. If %y′__%l_ + %y′__%r_ equals 2(%y__%r_ - %y__%l_), the third-degree term is zero, "
634 "so that the interpolated function is parabolic.")
635 LIST_ITEM (U"4. At the left and right points, one of the %φ is 0 and the other is 1, so that at these boundary points, "
636 "%y is computed with exact precision.")
637 ENTRY (U"4. Highest precision: sinc interpolation")
638 NORMAL (U"If the interpolation method is “sinc70” or “sinc700”, the algorithm assumes that the signal "
639 "is a sum of sinc functions, so that a number of points (the %%interpolation depth%: 70 or 700) on each side of %s must be taken into account.")
640 NORMAL (U"Because the interpolation depth must be finite, the sum of sinc functions is multiplied by a Hanning window:")
641 EQUATION (U"%s__%l_ ≡ floor (%s); %s__%r_ ≡ %s__%l_ + 1")
642 EQUATION (U"%φ__%l_ ≡ %s - %s__%l_; %φ__%r_ ≡ 1 - %φ__%l_")
643 EQUATION (U"%y(%s) ≈ ∑__%i=1...%N_ %y__%r-%i_ sinc (%π(%φ__%l_+%i-1)) (1/2 + 1/2 cos (%π(%φ__%l_+%i-1)/(%φ__%l_+%N))) +")
644 EQUATION (U"+ ∑__%i=1...%N_ %y__%l+%i_ sinc (%π(%φ__%r_+%i-1)) (1/2 + 1/2 cos (%π(%φ__%r_+%i-1)/(%φ__%r_+%N)))")
645 NORMAL (U"where the sinc function is defined as")
646 EQUATION (U"sinc (0) ≡ 1; sinc (%x) ≡ sin %x / %x for %x ≠ 0")
647 NORMAL (U"If %s is less than the interpolation depth or greater than %n + 1 minus the interpolation depth, "
648 "the depth is reduced accordingly.")
649 NORMAL (U"This method is appropriate for signals that result from sampling a continuous signal after it has been low-pass filtered "
650 "at the @@Nyquist frequency@. See:")
651 LIST_ITEM (U"@@Sound: Get value at time...")
652 MAN_END
653
654 MAN_BEGIN (U"waveform", U"ppgb", 20060914)
655 INTRO (U"The waveform is the sound pressure as a function of time, or: the microphone output as a function of time. "
656 "In Praat, the waveform is shown in the top half of the Sound window (see the @Intro).")
657 MAN_END
658 }
659
660 /* End of file manual_glossary.cpp */