| 1 |
/* manual_pointProcess.cpp |
| 2 |
* |
| 3 |
* Copyright (C) 1992-2008,2010,2011,2014-2017,2019-2023,2025,2026 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_pointProcess_init (ManPages me); |
| 22 |
void manual_pointProcess_init (ManPages me) { |
| 23 |
|
| 24 |
MAN_PAGES_BEGIN |
| 25 |
R"~~~( |
| 26 |
################################################################################ |
| 27 |
"Create empty PointProcess..." |
| 28 |
© Paul Boersma 2002-12-04 |
| 29 |
|
| 30 |
A command in the @@New menu@ to create an empty @PointProcess. The newly created object is put in the list of objects. |
| 31 |
|
| 32 |
################################################################################ |
| 33 |
"Create Poisson process..." |
| 34 |
© Paul Boersma 2004-10-05, 2023-05-31 |
| 35 |
|
| 36 |
A command to create a @PointProcess object that represents a Poisson process. |
| 37 |
A Poisson process is a stationary point process with a fixed density %λ, |
| 38 |
which means that there are, on the average, %λ events per second. |
| 39 |
|
| 40 |
Settings |
| 41 |
======== |
| 42 |
|
| 43 |
##Start time (s) |
| 44 |
: %t__%min_, the beginning of the time domain, in seconds. |
| 45 |
|
| 46 |
##End time (s) |
| 47 |
: %t__%max_, the end of the time domain, in seconds. |
| 48 |
|
| 49 |
##Density (Hz) |
| 50 |
: the average number of points per second (%\la). |
| 51 |
|
| 52 |
Algorithm |
| 53 |
========= |
| 54 |
|
| 55 |
First, the number of points %N in the time domain is determined. Its expectation value is |
| 56 |
~ %Λ = (%t__%max_ – %t__%min_) · %density |
| 57 |
|
| 58 |
but its actual value is taken from the Poisson distribution: |
| 59 |
~ %P(\# points=%N) = (%Λ^%N / %N!) %e^^–%Λ |
| 60 |
|
| 61 |
Then, %N points are computed throughout the time domain, according to a uniform distribution: |
| 62 |
~ %p(%t) = 1 / (%t__%max_ – %t__%min_) for %t ∈ [%t__%min_, %t__%max_] |
| 63 |
~ %p(%t) = 0 outside [%t__%min_, %t__%max_] |
| 64 |
|
| 65 |
Example |
| 66 |
======= |
| 67 |
|
| 68 |
Suppose that it rains between %t__%min_ = 2.0 seconds and %t__%max_ = 5.0 seconds, |
| 69 |
with an average of 4.0 drops per second expected to fall on my head. |
| 70 |
To simulate this process, you can click (or script) the following commands: |
| 71 |
{ |
| 72 |
\#{Create Poisson process:} "rain", 2.0, 5.0, 4.0 |
| 73 |
\@{PointProcess: ||Draw:} 0.0, 6.0, "no" |
| 74 |
\@{Draw inner box} |
| 75 |
\@{Marks bottom every:} 1, 1, "yes", "yes", "no" |
| 76 |
\@{Text bottom:} "yes", "Time (s)" |
| 77 |
\@{Text top:} "no", "##Three seconds of rain" |
| 78 |
} |
| 79 |
When you refresh this picture, e.g. by clicking on the “> 1” button and then on the “1 <” button, |
| 80 |
you will see that the points lie at different time points each time. |
| 81 |
This variation is due to the %stochasticity of the Poisson process: |
| 82 |
the points occur at random places. |
| 83 |
|
| 84 |
Also, the %number of points varies: on average, there will be 12 points, |
| 85 |
but there can just as easily be 10 or 15 points. |
| 86 |
As the rain shower lasts 3.0 seconds, the expected total number of drops on my head |
| 87 |
is %λ = 3.0 seconds · 4.0 drops/second = 12.0 drops, but the actual number |
| 88 |
of points is just as stochastic as their locations in time are. |
| 89 |
|
| 90 |
Fast implementation |
| 91 |
=================== |
| 92 |
|
| 93 |
One can simulate the number of points and their times as follows. |
| 94 |
To show that our fast implementation does exactly the same as ##Create Poisson process...# does, |
| 95 |
we first make sure that the points lie at reproducible time points: |
| 96 |
{ |
| 97 |
\#`{random_initializeWithSeedUnsafelyButPredictably} (1234567654321) |
| 98 |
\#{Create Poisson process:} "rain", 2.0, 5.0, 4.0 |
| 99 |
\@{PointProcess: ||Draw:} 0.0, 6.0, "yes" |
| 100 |
\@{Text top:} "no", "##Three reproducible seconds of rain" |
| 101 |
\#`{random_initializeSafelyAndUnpredictably} () |
| 102 |
} |
| 103 |
These are only 8 points, and their times will not change when you click “> 1” followed by “1 <”, |
| 104 |
because Praat’s random generator is initialized to a fixed state, |
| 105 |
determined by the arbitrary number 1234567654321 (you can use any number you like, |
| 106 |
with different results depending on that number) in the first line of the script. |
| 107 |
|
| 108 |
To replicate how these 8 numbers were created, we first replicate their count: |
| 109 |
{ |
| 110 |
\`{random_initializeWithSeedUnsafelyButPredictably} (1234567654321) |
| 111 |
n = \#`{randomPoisson} (12.0) |
| 112 |
\`{writeInfoLine}: n |
| 113 |
} |
| 114 |
We then replicate the actual times according to the algorithm above: |
| 115 |
{ |
| 116 |
times# = \#`{randomUniform#} (n, 2.0, 5.0) |
| 117 |
\`{writeInfoLine}: times# |
| 118 |
} |
| 119 |
In a PointProcess, these 8 points will be in sorted order: |
| 120 |
{ |
| 121 |
times# = \#`{sort#} (times#) |
| 122 |
\`{writeInfoLine}: times# |
| 123 |
} |
| 124 |
Here you can see, as in the picture, that the interval between the 4th and 5th point |
| 125 |
is the largest, and the interval between the 5th and 6th point is the smallest. |
| 126 |
|
| 127 |
We can add these eight points at one stroke to an empty PointProcess: |
| 128 |
{ |
| 129 |
\#@{Create empty PointProcess:} "rain3", 2.0, 5.0 |
| 130 |
\#@{PointProcess: ||Add points:} times# |
| 131 |
\@{PointProcess: ||Draw:} 0.0, 6.0, "yes" |
| 132 |
\@{Text top:} "no", "##Three reproducible seconds of rain, |
| 133 |
... fast implementation" |
| 134 |
} |
| 135 |
|
| 136 |
Slow implementation |
| 137 |
=================== |
| 138 |
|
| 139 |
We could also have generated the eight points one by one, |
| 140 |
and added them immediately to an empty PointProcess: |
| 141 |
{ |
| 142 |
\`{random_initializeWithSeedUnsafelyButPredictably} (1234567654321) |
| 143 |
n = \`{randomPoisson} (12.0) |
| 144 |
\@{Create empty PointProcess:} "rain4", 2.0, 5.0 |
| 145 |
for i to n |
| 146 |
time = \#`{randomUniform} (2.0, 5.0) |
| 147 |
\#@{PointProcess: ||Add point:} time |
| 148 |
endfor |
| 149 |
\`{random_initializeSafelyAndUnpredictably} () |
| 150 |
\@{PointProcess: ||Draw:} 0.0, 6.0, "yes" |
| 151 |
\@{Text top:} "no", "##Three reproducible seconds of rain, |
| 152 |
... slow implementation" |
| 153 |
} |
| 154 |
This is slower than the fast implementation, because of two causes: |
| 155 |
(1) the for-loop shown in the Praat script above |
| 156 |
is slower than the for-loop in the C++ implementation of ##Add points...#. |
| 157 |
(2) every call to ##Add point...# causes the new point to be inserted |
| 158 |
into an existing array of points, so the complexity of the whole procedure |
| 159 |
is %O(%N^2) (as the complexity of insertion is %O(%N)), while ##Add points...# |
| 160 |
adds all new points to the end of the existing array (%O(%N · log %N)), |
| 161 |
then sorts the new array just once, which is again %O(%N · log %N). |
| 162 |
|
| 163 |
################################################################################ |
| 164 |
)~~~" |
| 165 |
MAN_PAGES_END |
| 166 |
|
| 167 |
MAN_BEGIN (U"PointEditor", U"ppgb", /*20110128 20220814*/ 20230608) |
| 168 |
INTRO (U"One of the @Editors in Praat, for viewing and manipulating a @PointProcess object, " |
| 169 |
"which is optionally shown together with a @Sound object.") |
| 170 |
ENTRY (U"Objects") |
| 171 |
NORMAL (U"The editor shows:") |
| 172 |
LIST_ITEM (U"• The @Sound, if you selected a Sound object together with the PointProcess object " |
| 173 |
"before you clicked ##View & Edit#.") |
| 174 |
LIST_ITEM (U"• The @PointProcess; vertical blue lines represent the points.") |
| 175 |
ENTRY (U"Playing") |
| 176 |
NORMAL (U"To play (a part of) the %resynthesized sound (pulse train): " |
| 177 |
"@click any of the 8 buttons below and above the drawing area, or choose a command from the Play menu.") |
| 178 |
NORMAL (U"To play the %original sound instead, use @@Shift-click@.") |
| 179 |
ENTRY (U"Adding a point") |
| 180 |
NORMAL (U"@Click at the desired time location, and choose \"Add point at cursor\" or type @@Keyboard shortcuts|Command-P@.") |
| 181 |
ENTRY (U"Removing points") |
| 182 |
NORMAL (U"To remove one or more points, " |
| 183 |
"make a @@time selection@ and choose ##Remove point(s)# from the ##Point# menu. " |
| 184 |
"If there is no selection, the point nearest to the cursor is removed.") |
| 185 |
MAN_END |
| 186 |
|
| 187 |
MAN_BEGIN (U"PointProcess", U"ppgb", 20110128) // 20230531 |
| 188 |
INTRO (U"One of the @@types of objects@ in Praat.") |
| 189 |
NORMAL (U"A PointProcess object represents a %%point process%, " |
| 190 |
"which is a sequence of %points %t__%i_ in time, defined on a domain [%t__%min_, %t__%max_]. " |
| 191 |
"The index %i runs from 1 to the number of points. The points are sorted by time, i.e. %t__%i+1_ > %t__%i_.") |
| 192 |
ENTRY (U"PointProcess commands") |
| 193 |
NORMAL (U"Creation from scratch:") |
| 194 |
LIST_ITEM (U"• @@Create empty PointProcess...@") |
| 195 |
LIST_ITEM (U"• @@Create Poisson process...@") |
| 196 |
NORMAL (U"Creation of a pulse train from a pitch contour:") |
| 197 |
LIST_ITEM (U"• @@PitchTier: To PointProcess@: area-1 along entire time domain.") |
| 198 |
LIST_ITEM (U"• @@Pitch: To PointProcess@: same, but excludes voiceless intervals.") |
| 199 |
LIST_ITEM (U"• @@Sound & Pitch: To PointProcess (cc)@: \"pitch-synchronous\": near locations of high amplitude.") |
| 200 |
LIST_ITEM (U"• @@Sound & Pitch: To PointProcess (peaks)...@: \"pitch-synchronous\": near locations of high amplitude.") |
| 201 |
LIST_ITEM (U"• @@Sound: To PointProcess (periodic, cc)...@: near locations of high amplitude.") |
| 202 |
LIST_ITEM (U"• @@Sound: To PointProcess (periodic, peaks)...@: near locations of high amplitude.") |
| 203 |
NORMAL (U"Creation from converting another object:") |
| 204 |
LIST_ITEM (U"• ##Matrix: To PointProcess") |
| 205 |
LIST_ITEM (U"• @@PitchTier: Down to PointProcess@") |
| 206 |
LIST_ITEM (U"• @@IntensityTier: Down to PointProcess@") |
| 207 |
NORMAL (U"Hearing:") |
| 208 |
LIST_ITEM (U"• @@PointProcess: Play@: pulse train.") |
| 209 |
LIST_ITEM (U"• @@PointProcess: Hum@: pulse train with formants.") |
| 210 |
NORMAL (U"Drawing:") |
| 211 |
LIST_ITEM (U"• @@PointProcess: Draw...@") |
| 212 |
NORMAL (U"Editing:") |
| 213 |
LIST_ITEM (U"• ##PointProcess: View & Edit#: invokes a @PointEditor.") |
| 214 |
LIST_ITEM (U"• ##PointProcess & Sound: View & Edit#: invokes a @PointEditor.") |
| 215 |
LIST_ITEM (U"• Inside a @ManipulationEditor.") |
| 216 |
NORMAL (U"Queries:") |
| 217 |
LIST_ITEM (U"• @@PointProcess: Get jitter (local)...@: periodic jitter.") |
| 218 |
LIST_ITEM (U"• @@PointProcess: Get jitter (local, absolute)...@: periodic jitter.") |
| 219 |
LIST_ITEM (U"• @@PointProcess: Get jitter (rap)...@: periodic jitter.") |
| 220 |
LIST_ITEM (U"• @@PointProcess: Get jitter (ppq5)...@: periodic jitter.") |
| 221 |
LIST_ITEM (U"• @@PointProcess: Get jitter (ddp)...@: periodic jitter.") |
| 222 |
LIST_ITEM (U"• @@PointProcess: Get low index...@: index of nearest point not after specified time.") |
| 223 |
LIST_ITEM (U"• @@PointProcess: Get high index...@: index of nearest point not before specified time.") |
| 224 |
LIST_ITEM (U"• @@PointProcess: Get nearest index...@: index of point nearest to specified time.") |
| 225 |
LIST_ITEM (U"• @@PointProcess: Get interval...@: duration of interval around specified time.") |
| 226 |
NORMAL (U"Set calculations:") |
| 227 |
LIST_ITEM (U"• @@PointProcesses: Union@: the union of two point processes.") |
| 228 |
LIST_ITEM (U"• @@PointProcesses: Intersection@: the intersection of two point processes.") |
| 229 |
LIST_ITEM (U"• @@PointProcesses: Difference@: the difference of two point processes.") |
| 230 |
NORMAL (U"Modification:") |
| 231 |
LIST_ITEM (U"• @@PointProcess: Add point...@: at a specified time.") |
| 232 |
LIST_ITEM (U"• @@PointProcess: Add points...@: at specified times.") |
| 233 |
LIST_ITEM (U"• @@PointProcess: Remove point...@: at specified index.") |
| 234 |
LIST_ITEM (U"• @@PointProcess: Remove point near...@: near specified time.") |
| 235 |
LIST_ITEM (U"• @@PointProcess: Remove points...@: between specified indices.") |
| 236 |
LIST_ITEM (U"• @@PointProcess: Remove points between...@: between specified times.") |
| 237 |
NORMAL (U"Analysis:") |
| 238 |
LIST_ITEM (U"• @@PointProcess: To PitchTier...@: pitch values in interval centres.") |
| 239 |
LIST_ITEM (U"• ##PointProcess & Sound: To Manipulation") |
| 240 |
NORMAL (U"Synthesis:") |
| 241 |
LIST_ITEM (U"• @@PointProcess: To Sound (pulse train)...@") |
| 242 |
LIST_ITEM (U"• @@PointProcess: To Sound (hum)...@") |
| 243 |
NORMAL (U"Conversion:") |
| 244 |
LIST_ITEM (U"• ##PointProcess: To Matrix") |
| 245 |
LIST_ITEM (U"• @@PointProcess: Up to TextGrid...") |
| 246 |
LIST_ITEM (U"• @@PointProcess: Up to PitchTier...") |
| 247 |
LIST_ITEM (U"• @@PointProcess: Up to IntensityTier...") |
| 248 |
MAN_END |
| 249 |
|
| 250 |
MAN_BEGIN (U"PointProcess: Add point...", U"ppgb", 20010410) |
| 251 |
INTRO (U"A command to add a point to each selected @PointProcess.") |
| 252 |
ENTRY (U"Setting") |
| 253 |
TERM (U"##Time (s)") |
| 254 |
DEFINITION (U"the time at which a point is to be added.") |
| 255 |
ENTRY (U"Behaviour") |
| 256 |
NORMAL (U"The point process is modified so that it contains the new point. " |
| 257 |
"If a point at the specified time was already present in the point process, nothing happens.") |
| 258 |
MAN_END |
| 259 |
|
| 260 |
MAN_BEGIN (U"PointProcess: Add points...", U"ppgb", 20230531) |
| 261 |
INTRO (U"A command to add multiple points to each selected @PointProcess.") |
| 262 |
ENTRY (U"Setting") |
| 263 |
TERM (U"##Times (s)") |
| 264 |
DEFINITION (U"the times at which points are to be added.") |
| 265 |
ENTRY (U"Behaviour") |
| 266 |
NORMAL (U"The point process is modified so that it contains the new points. " |
| 267 |
"If a point at any specified time was already present in the point process, that point is still added.") |
| 268 |
MAN_END |
| 269 |
|
| 270 |
MAN_BEGIN (U"PointProcesses: Difference", U"ppgb", 20021212) |
| 271 |
INTRO (U"A command to compute the difference of two selected @PointProcess objects.") |
| 272 |
ENTRY (U"Behaviour") |
| 273 |
NORMAL (U"The resulting #PointProcess will contain only those points of the first selected original point process " |
| 274 |
"that do not occur in the second.") |
| 275 |
NORMAL (U"The time domain of the resulting point process is equal to the time domain of the first original point process.") |
| 276 |
MAN_END |
| 277 |
|
| 278 |
MAN_BEGIN (U"PointProcess: Draw...", U"ppgb", 20021212) |
| 279 |
INTRO (U"A command to draw every selected @PointProcess into the @@Picture window@.") |
| 280 |
MAN_END |
| 281 |
|
| 282 |
MAN_BEGIN (U"PointProcess: Get high index...", U"ppgb", 20021212) |
| 283 |
INTRO (U"A @@Query submenu|query@ to the selected @PointProcess object.") |
| 284 |
ENTRY (U"Return value") |
| 285 |
NORMAL (U"the index of the nearest point at or after the specified time, " |
| 286 |
"0 if the point process contains no points, " |
| 287 |
"or a number higher than the number of points if the specified time is after the last point.") |
| 288 |
ENTRY (U"Setting") |
| 289 |
TERM (U"##Time (s)") |
| 290 |
DEFINITION (U"the time from which a point is looked for, in seconds.") |
| 291 |
MAN_END |
| 292 |
|
| 293 |
MAN_BEGIN (U"PointProcess: Get interval...", U"ppgb", 20021212) |
| 294 |
INTRO (U"A @@Query submenu|query@ to the selected @PointProcess object.") |
| 295 |
ENTRY (U"Return value") |
| 296 |
NORMAL (U"the duration of the interval around a specified time. " |
| 297 |
"if the point process contains no points or if the specified time falls before the first point " |
| 298 |
"or not before the last point, the value is @undefined. Otherwise, the result is the distance between " |
| 299 |
"the nearest points to the left and to the right of the specified time. " |
| 300 |
"If the point process happens to contain a point at exactly the specified time, " |
| 301 |
"the duration of the interval following this point is returned.") |
| 302 |
ENTRY (U"Setting") |
| 303 |
TERM (U"##Time (s)") |
| 304 |
DEFINITION (U"the time around which a point is looked for, in seconds.") |
| 305 |
MAN_END |
| 306 |
|
| 307 |
MAN_BEGIN (U"PointProcess: Get jitter (local)...", U"ppgb", 20221202) |
| 308 |
INTRO (U"A command that becomes available in the @@Query submenu@ when you select a @PointProcess object.") |
| 309 |
NORMAL (U"This command will write into the Info window " |
| 310 |
"the %%local jitter%, which is the average absolute difference between consecutive intervals, " |
| 311 |
"divided by the average interval (an interval is the time between two consecutive points).") |
| 312 |
NORMAL (U"As %jitter is often used as a measure of voice quality (see @@Voice 2. Jitter@), " |
| 313 |
"the intervals are often considered to be %%glottal periods%. " |
| 314 |
"For this reason, the command has settings that can limit the possible duration of the interval (or period) " |
| 315 |
"or the possible difference in the durations of consecutive intervals (periods).") |
| 316 |
ENTRY (U"1. The command window") |
| 317 |
SCRIPT (5.4, Manual_SETTINGS_WINDOW_HEIGHT (4), U"" |
| 318 |
Manual_DRAW_SETTINGS_WINDOW ("PointProcess: Get jitter (local)", 4) |
| 319 |
Manual_DRAW_SETTINGS_WINDOW_RANGE ("Time range (s)", "0.0", "0.0 (= all)") |
| 320 |
Manual_DRAW_SETTINGS_WINDOW_FIELD ("Period floor (s)", "0.0001") |
| 321 |
Manual_DRAW_SETTINGS_WINDOW_FIELD ("Period ceiling (s)", "0.02") |
| 322 |
Manual_DRAW_SETTINGS_WINDOW_FIELD ("Maximum period factor", "1.3") |
| 323 |
) |
| 324 |
TERM (U"##Time range (s)") |
| 325 |
DEFINITION (U"the start time and end time of the part of the PointProcess that will be measured. " |
| 326 |
"Points outside this range will be ignored.") |
| 327 |
TERM (U"##Period floor (s)") |
| 328 |
DEFINITION (U"the shortest possible interval that will be used in the computation of jitter, in seconds. " |
| 329 |
"If an interval is shorter than this, it will be ignored in the computation of jitter " |
| 330 |
"(and the previous and next intervals will not be regarded as consecutive). " |
| 331 |
"This setting will normally be very small, say 0.1 ms.") |
| 332 |
TERM (U"##Period ceiling (s)") |
| 333 |
DEFINITION (U"the longest possible interval that will be used in the computation of jitter, in seconds. " |
| 334 |
"If an interval is longer than this, it will be ignored in the computation of jitter " |
| 335 |
"(and the previous and next intervals will not be regarded as consecutive). " |
| 336 |
"For example, if the minimum frequency of periodicity is 50 Hz, set this setting to 0.02 seconds; " |
| 337 |
"intervals longer than that could be regarded as voiceless stretches and will be ignored in the computation.") |
| 338 |
TERM (U"##Maximum period factor") |
| 339 |
DEFINITION (U"the largest possible difference between consecutive intervals that will be used in the computation of jitter. " |
| 340 |
"If the ratio of the durations of two consecutive intervals is greater than this, " |
| 341 |
"this pair of intervals will be ignored in the computation of jitter " |
| 342 |
"(each of the intervals could still take part in the computation of jitter in a comparison with its neighbour on the other side).") |
| 343 |
ENTRY (U"2. Usage") |
| 344 |
NORMAL (U"The local jitter can be used as a measure of voice quality; " |
| 345 |
"it is the most common jitter measurement and is usually expressed as a percentage. See @@Voice 2. Jitter@.") |
| 346 |
ENTRY (U"3. Algorithm") |
| 347 |
NORMAL (U"(In the following the term %absolute means two different things: (1) the absolute (i.e. non-negative) value of a real number, " |
| 348 |
"and (2) the opposite of %relative.)") |
| 349 |
NORMAL (U"The local jitter is defined as the relative mean absolute " |
| 350 |
"second-order difference of the point process (= the first-order difference of the interval process), as follows.") |
| 351 |
NORMAL (U"First, we define the absolute (non-relative) local jitter (in seconds) as the mean absolute (non-negative) " |
| 352 |
"difference of consecutive intervals:") |
| 353 |
EQUATION (U"%jitter(seconds) = ∑__%i=2_^^%N^ |%T__%i_ - %T__%i-1_| / (%N - 1)") |
| 354 |
NORMAL (U"where %T__%i_ is the duration of the %%i%th interval and %N is the number of intervals. " |
| 355 |
"If an interval %T__%i-1_ or %T__%i_ is not between ##Period floor# and ##Period ceiling#, " |
| 356 |
"or if %T__%i-1_/%T__%i_ or %T__%i_/%T__%i-1_ is greater than ##Maximum period factor#, " |
| 357 |
"the term |%T__%i_ - %T__%i-1_| is not counted in the sum, and %N is lowered by 1 " |
| 358 |
"(if %N ends up being less than 2, the result of the command is @undefined).") |
| 359 |
NORMAL (U"Second, we define the mean period as") |
| 360 |
EQUATION (U"%meanPeriod(seconds) = ∑__%i=1_^^%N^ %T__%i_ / %N") |
| 361 |
NORMAL (U"where %T__%i_ is the duration of the %%i%th interval and %N is the number of intervals. " |
| 362 |
"If an interval %T__%i_ is not between ##Period floor# and ##Period ceiling#, " |
| 363 |
"or if %T__%i-1_/%T__%i_ or %T__%i_/%T__%i-1_ is greater than ##Maximum period factor# " |
| 364 |
"%and %T__%i+1_/%T__%i_ or %T__%i_/%T__%i+1_ is greater than ##Maximum period factor#, " |
| 365 |
"the term %T__%i_ is not counted in the sum, and %N is lowered by 1; " |
| 366 |
"this procedure ensures that in the computation of the mean period we use at least all the intervals " |
| 367 |
"that had taken part in the computation of the absolute local jitter.") |
| 368 |
NORMAL (U"Finally, we compute the (relative) local jitter as") |
| 369 |
EQUATION (U"%jitter = %jitter(seconds) / %meanPeriod(seconds)") |
| 370 |
NORMAL (U"The result is a value between 0 and 2, or between 0 and 200 percent.") |
| 371 |
MAN_END |
| 372 |
|
| 373 |
MAN_BEGIN (U"PointProcess: Get jitter (local, absolute)...", U"ppgb", 20221202) |
| 374 |
INTRO (U"A command that becomes available in the @@Query submenu@ when you select a @PointProcess object.") |
| 375 |
NORMAL (U"This command will write into the Info window " |
| 376 |
"the %%absolute local jitter%, which is the average absolute difference between consecutive intervals, " |
| 377 |
"in seconds (an interval is the time between two consecutive points).") |
| 378 |
NORMAL (U"As %jitter is often used as a measure of voice quality (see @@Voice 2. Jitter@), " |
| 379 |
"the intervals are often considered to be %%glottal periods%. " |
| 380 |
"For this reason, the command has settings that can limit the possible duration of the interval (or period) " |
| 381 |
"or the possible difference in the durations of consecutive intervals (periods).") |
| 382 |
ENTRY (U"1. The command window") |
| 383 |
SCRIPT (5.4, Manual_SETTINGS_WINDOW_HEIGHT (4), U"" |
| 384 |
Manual_DRAW_SETTINGS_WINDOW ("PointProcess: Get jitter (local, absolute)", 4) |
| 385 |
Manual_DRAW_SETTINGS_WINDOW_RANGE ("Time range (s)", "0.0", "0.0 (= all)") |
| 386 |
Manual_DRAW_SETTINGS_WINDOW_FIELD ("Period floor (s)", "0.0001") |
| 387 |
Manual_DRAW_SETTINGS_WINDOW_FIELD ("Period ceiling (s)", "0.02") |
| 388 |
Manual_DRAW_SETTINGS_WINDOW_FIELD ("Maximum period factor", "1.3") |
| 389 |
) |
| 390 |
TERM (U"##Time range (s)") |
| 391 |
DEFINITION (U"the start time and end time of the part of the PointProcess that will be measured. " |
| 392 |
"Points outside this range will be ignored.") |
| 393 |
TERM (U"##Period floor (s)") |
| 394 |
DEFINITION (U"the shortest possible interval that will be used in the computation of jitter, in seconds. " |
| 395 |
"If an interval is shorter than this, it will be ignored in the computation of jitter " |
| 396 |
"(and the previous and next intervals will not be regarded as consecutive). " |
| 397 |
"This setting will normally be very small, say 0.1 ms.") |
| 398 |
TERM (U"##Period ceiling (s)") |
| 399 |
DEFINITION (U"the longest possible interval that will be used in the computation of jitter, in seconds. " |
| 400 |
"If an interval is longer than this, it will be ignored in the computation of jitter " |
| 401 |
"(and the previous and next intervals will not be regarded as consecutive). " |
| 402 |
"For example, if the minimum frequency of periodicity is 50 Hz, set this argument to 0.02 seconds; " |
| 403 |
"intervals longer than that could be regarded as voiceless stretches and will be ignored in the computation.") |
| 404 |
TERM (U"##Maximum period factor") |
| 405 |
DEFINITION (U"the largest possible difference between consecutive intervals that will be used in the computation of jitter. " |
| 406 |
"If the ratio of the durations of two consecutive intervals is greater than this, " |
| 407 |
"this pair of intervals will be ignored in the computation of jitter " |
| 408 |
"(each of the intervals could still take part in the computation of jitter in a comparison with its neighbour on the other side).") |
| 409 |
ENTRY (U"2. Usage") |
| 410 |
NORMAL (U"The local jitter can be used as a measure of voice quality. See @@Voice 2. Jitter@.") |
| 411 |
ENTRY (U"3. Algorithm") |
| 412 |
NORMAL (U"The absolute local jitter is defined as the absolute (i.e. non-relative) mean absolute (i.e. non-negative) " |
| 413 |
"second-order difference of the point process (= the first-order difference of the interval process), as follows.") |
| 414 |
NORMAL (U"The absolute local jitter (in seconds) is the mean absolute (non-negative) " |
| 415 |
"difference of consecutive intervals:") |
| 416 |
EQUATION (U"%jitter(seconds) = ∑__%i=2_^^%N^ |%T__%i_ - %T__%i-1_| / (%N - 1)") |
| 417 |
NORMAL (U"where %T__%i_ is the duration of the %%i%th interval and %N is the number of intervals. " |
| 418 |
"If an interval %T__%i-1_ or %T__%i_ is not between ##Period floor# and ##Period ceiling#, " |
| 419 |
"or if %T__%i-1_/%T__%i_ or %T__%i_/%T__%i-1_ is greater than ##Maximum period factor#, " |
| 420 |
"the term |%T__%i_ - %T__%i-1_| is not counted in the sum, and %N is lowered by 1 " |
| 421 |
"(if %N ends up being less than 2, the result of the command is @undefined).") |
| 422 |
MAN_END |
| 423 |
|
| 424 |
MAN_BEGIN (U"PointProcess: Get jitter (rap)...", U"ppgb", 20221202) |
| 425 |
INTRO (U"A command that becomes available in the @@Query submenu@ when you select a @PointProcess object.") |
| 426 |
NORMAL (U"This command will write into the Info window the %%Relative Average Perturbation% (RAP), " |
| 427 |
"a jitter measure defined as the average absolute difference between an interval and the average of it and its two neighbours, " |
| 428 |
"divided by the average interval (an interval is the time between two consecutive points).") |
| 429 |
NORMAL (U"As jitter is often used as a measure of voice quality (see @@Voice 2. Jitter@), " |
| 430 |
"the intervals are often considered to be %%glottal periods%. " |
| 431 |
"For this reason, the command has settings that can limit the possible duration of the interval (or period) " |
| 432 |
"or the possible difference in the durations of consecutive intervals (periods).") |
| 433 |
ENTRY (U"1. The command window") |
| 434 |
SCRIPT (5.4, Manual_SETTINGS_WINDOW_HEIGHT (4), U"" |
| 435 |
Manual_DRAW_SETTINGS_WINDOW ("PointProcess: Get jitter (rap)", 4) |
| 436 |
Manual_DRAW_SETTINGS_WINDOW_RANGE ("Time range (s)", "0.0", "0.0 (= all)") |
| 437 |
Manual_DRAW_SETTINGS_WINDOW_FIELD ("Period floor (s)", "0.0001") |
| 438 |
Manual_DRAW_SETTINGS_WINDOW_FIELD ("Period ceiling (s)", "0.02") |
| 439 |
Manual_DRAW_SETTINGS_WINDOW_FIELD ("Maximum period factor", "1.3") |
| 440 |
) |
| 441 |
TERM (U"##Time range (s)") |
| 442 |
DEFINITION (U"the start time and end time of the part of the PointProcess that will be measured. " |
| 443 |
"Points outside this range will be ignored.") |
| 444 |
TERM (U"##Period floor (s)") |
| 445 |
DEFINITION (U"the shortest possible interval that will be used in the computation of jitter, in seconds. " |
| 446 |
"If an interval is shorter than this, it will be ignored in the computation of jitter " |
| 447 |
"(and the previous and next intervals will not be regarded as consecutive). " |
| 448 |
"This setting will normally be very small, say 0.1 ms.") |
| 449 |
TERM (U"##Period ceiling (s)") |
| 450 |
DEFINITION (U"the longest possible interval that will be used in the computation of jitter, in seconds. " |
| 451 |
"If an interval is longer than this, it will be ignored in the computation of jitter " |
| 452 |
"(and the previous and next intervals will not be regarded as consecutive). " |
| 453 |
"For example, if the minimum frequency of periodicity is 50 Hz, set this argument to 0.02 seconds; " |
| 454 |
"intervals longer than that could be regarded as voiceless stretches and will be ignored in the computation.") |
| 455 |
TERM (U"##Maximum period factor") |
| 456 |
DEFINITION (U"the largest possible difference between consecutive intervals that will be used in the computation of jitter. " |
| 457 |
"If the ratio of the durations of two consecutive intervals is greater than this, " |
| 458 |
"this pair of intervals will be ignored in the computation of jitter " |
| 459 |
"(each of the intervals could still take part in the computation of jitter in a comparison with its neighbour on the other side).") |
| 460 |
ENTRY (U"2. Usage") |
| 461 |
NORMAL (U"The RAP can be used as a measure of voice quality; " |
| 462 |
"it is the second most common jitter measurement (after @@PointProcess: Get jitter (local)...|local jitter@). See @@Voice 2. Jitter@.") |
| 463 |
ENTRY (U"3. Algorithm") |
| 464 |
NORMAL (U"Relative Average Perturbation is defined in terms of three consecutive intervals, as follows.") |
| 465 |
NORMAL (U"First, we define the absolute (i.e. non-relative) Average Perturbation (in seconds):") |
| 466 |
EQUATION (U"%absAP(seconds) = ∑__%i=2_^^%N-1^ |%T__%i_ - (%T__%i-1_ + %T__%i_ + %T__%i+1_) / 3| / (%N - 2)") |
| 467 |
NORMAL (U"where %T__%i_ is the duration of the %%i%th interval and %N is the number of intervals. " |
| 468 |
"If an interval %T__%i-1_ or %T__%i_ or %T__%i+1_ is not between ##Period floor# and ##Period ceiling#, " |
| 469 |
"or if %T__%i-1_/%T__%i_ or %T__%i_/%T__%i-1_ or %T__%i+1_/%T__%i_ or %T__%i_/%T__%i+1_ is greater than ##Maximum period factor#, " |
| 470 |
"the term |%T__%i_ - (%T__%i-1_ + %T__%i_ + %T__%i+1_) / 3| is not counted in the sum, and %N is lowered by 1 " |
| 471 |
"(if %N ends up being less than 3, the result of the command is @undefined).") |
| 472 |
NORMAL (U"Second, we define the mean period as") |
| 473 |
EQUATION (U"%meanPeriod(seconds) = ∑__%i=1_^^%N^ %T__%i_ / %N") |
| 474 |
NORMAL (U"where %T__%i_ is the duration of the %%i%th interval and %N is the number of intervals. " |
| 475 |
"If an interval %T__%i_ is not between ##Period floor# and ##Period ceiling#, " |
| 476 |
"or if %T__%i-1_/%T__%i_ or %T__%i_/%T__%i-1_ is greater than ##Maximum period factor# " |
| 477 |
"%and %T__%i+1_/%T__%i_ or %T__%i_/%T__%i+1_ is greater than ##Maximum period factor#, " |
| 478 |
"the term %T__%i_ is not counted in the sum, and %N is lowered by 1; " |
| 479 |
"this procedure ensures that in the computation of the mean period we use at least all the intervals " |
| 480 |
"that had taken part in the computation of the absolute average perturbation.") |
| 481 |
NORMAL (U"Finally, we compute the Relative Average Perturbation as") |
| 482 |
EQUATION (U"%RAP = %absAP(seconds) / %meanPeriod(seconds)") |
| 483 |
NORMAL (U"The result is a value between 0 and 2, or between 0 and 200 percent.") |
| 484 |
MAN_END |
| 485 |
|
| 486 |
MAN_BEGIN (U"PointProcess: Get jitter (ppq5)...", U"ppgb", 20221202) // 20260102 |
| 487 |
INTRO (U"A command that becomes available in the @@Query submenu@ when you select a @PointProcess object.") |
| 488 |
NORMAL (U"This command will write into the Info window the %%five-point Period Perturbation Quotient%, " |
| 489 |
"a jitter measure defined as the average absolute difference between an interval and the average of it and its four closest neighbours, " |
| 490 |
"divided by the average interval (an interval is the time between two consecutive points).") |
| 491 |
NORMAL (U"As jitter is often used as a measure of voice quality (see @@Voice 2. Jitter@), " |
| 492 |
"the intervals are often considered to be %%glottal periods%. " |
| 493 |
"For this reason, the command has settings that can limit the possible duration of the interval (or period) " |
| 494 |
"or the possible difference in the durations of consecutive intervals (periods).") |
| 495 |
ENTRY (U"1. The command window") |
| 496 |
SCRIPT (5.4, Manual_SETTINGS_WINDOW_HEIGHT (4), U"" |
| 497 |
Manual_DRAW_SETTINGS_WINDOW ("PointProcess: Get jitter (ppq5)", 4) |
| 498 |
Manual_DRAW_SETTINGS_WINDOW_RANGE ("Time range (s)", "0.0", "0.0 (= all)") |
| 499 |
Manual_DRAW_SETTINGS_WINDOW_FIELD ("Period floor (s)", "0.0001") |
| 500 |
Manual_DRAW_SETTINGS_WINDOW_FIELD ("Period ceiling (s)", "0.02") |
| 501 |
Manual_DRAW_SETTINGS_WINDOW_FIELD ("Maximum period factor", "1.3") |
| 502 |
) |
| 503 |
TERM (U"##Time range (s)") |
| 504 |
DEFINITION (U"the start time and end time of the part of the PointProcess that will be measured. " |
| 505 |
"Points outside this range will be ignored.") |
| 506 |
TERM (U"##Period floor (s)") |
| 507 |
DEFINITION (U"the shortest possible interval that will be used in the computation of jitter, in seconds. " |
| 508 |
"If an interval is shorter than this, it will be ignored in the computation of jitter " |
| 509 |
"(and the previous and next intervals will not be regarded as consecutive). " |
| 510 |
"This setting will normally be very small, say 0.1 ms.") |
| 511 |
TERM (U"##Period ceiling (s)") |
| 512 |
DEFINITION (U"the longest possible interval that will be used in the computation of jitter, in seconds. " |
| 513 |
"If an interval is longer than this, it will be ignored in the computation of jitter " |
| 514 |
"(and the previous and next intervals will not be regarded as consecutive). " |
| 515 |
"For example, if the minimum frequency of periodicity is 50 Hz, set this argument to 0.02 seconds; " |
| 516 |
"intervals longer than that could be regarded as voiceless stretches and will be ignored in the computation.") |
| 517 |
TERM (U"##Maximum period factor") |
| 518 |
DEFINITION (U"the largest possible difference between consecutive intervals that will be used in the computation of jitter. " |
| 519 |
"If the ratio of the durations of two consecutive intervals is greater than this, " |
| 520 |
"this pair of intervals will be ignored in the computation of jitter " |
| 521 |
"(each of the intervals could still take part in the computation of jitter in a comparison with its neighbour on the other side).") |
| 522 |
ENTRY (U"2. Usage") |
| 523 |
NORMAL (U"The jitter can be used as a measure of voice quality. See @@Voice 2. Jitter@.") |
| 524 |
ENTRY (U"3. Algorithm") |
| 525 |
NORMAL (U"The five-point Period Perturbation Quotient (PPQ5) is defined in terms of five consecutive intervals, as follows.") |
| 526 |
NORMAL (U"First, we define the absolute (i.e. non-relative) PPQ5 (in seconds):") |
| 527 |
EQUATION (U"%absPPQ5(seconds) = ∑__%i=3_^^%N-2^ |%T__%i_ - (%T__%i-2_ + %T__%i-1_ + %T__%i_ + %T__%i+1_ + %T__%i+2_) / 5| / (%N - 4)") |
| 528 |
NORMAL (U"where %T__%i_ is the duration of the %%i%th interval and %N is the number of intervals. " |
| 529 |
"If an interval %T__%i-2_ or %T__%i-1_ or %T__%i_ or %T__%i+1_ or %T__%i+2_ is not between ##Period floor# and ##Period ceiling#, " |
| 530 |
"or if %T__%i-2_/%T__%i-1_ or %T__%i-1_/%T__%i-2_ or %T__%i-1_/%T__%i_ or %T__%i_/%T__%i-1_ or %T__%i+1_/%T__%i_ or %T__%i_/%T__%i+1_ or %T__%i+2_/%T__%i+1_ or %T__%i+1_/%T__%i+2_ is greater than ##Maximum period factor#, " |
| 531 |
"the term |%T__%i_ - (%T__%i-2_ + %T__%i-1_ + %T__%i_ + %T__%i+1_ + %T__%i+2_) / 5| is not counted in the sum, and %N is lowered by 1 " |
| 532 |
"(if %N ends up being less than 5, the result of the command is @undefined).") |
| 533 |
NORMAL (U"Second, we define the mean period as") |
| 534 |
EQUATION (U"%meanPeriod(seconds) = ∑__%i=1_^^%N^ %T__%i_ / %N") |
| 535 |
NORMAL (U"where %T__%i_ is the duration of the %%i%th interval and %N is the number of intervals. " |
| 536 |
"If an interval %T__%i_ is not between ##Period floor# and ##Period ceiling#, " |
| 537 |
"or if %T__%i-1_/%T__%i_ or %T__%i_/%T__%i-1_ is greater than ##Maximum period factor# " |
| 538 |
"%and %T__%i+1_/%T__%i_ or %T__%i_/%T__%i+1_ is greater than ##Maximum period factor#, " |
| 539 |
"the term %T__%i_ is not counted in the sum, and %N is lowered by 1; " |
| 540 |
"this procedure ensures that in the computation of the mean period we use at least all the intervals " |
| 541 |
"that had taken part in the computation of the absolute PPQ5.") |
| 542 |
NORMAL (U"Finally, we compute the five-point Period Perturbation Quotient as") |
| 543 |
EQUATION (U"%PPQ5 = %PPQ5(seconds) / %meanPeriod(seconds)") |
| 544 |
NORMAL (U"The result is a value between 0 and 4, or between 0 and 400 percent.") |
| 545 |
MAN_END |
| 546 |
|
| 547 |
MAN_BEGIN (U"PointProcess: Get jitter (ddp)...", U"ppgb", 20221202) // 20260102 |
| 548 |
INTRO (U"A command that becomes available in the @@Query submenu@ when you select a @PointProcess object.") |
| 549 |
NORMAL (U"This command will write into the Info window the %%Difference of Differences of Periods%, " |
| 550 |
"a jitter measure defined as the average absolute difference between the consecutives differences between consecutive intervals, " |
| 551 |
"divided by the average interval (an interval is the time between two consecutive points).") |
| 552 |
NORMAL (U"As jitter is often used as a measure of voice quality (see @@Voice 2. Jitter@), " |
| 553 |
"the intervals are often considered to be %%glottal periods%. " |
| 554 |
"For this reason, the command has settings that can limit the possible duration of the interval (or period) " |
| 555 |
"or the possible difference in the durations of consecutive intervals (periods).") |
| 556 |
ENTRY (U"1. The command window") |
| 557 |
SCRIPT (5.4, Manual_SETTINGS_WINDOW_HEIGHT (4), U"" |
| 558 |
Manual_DRAW_SETTINGS_WINDOW ("PointProcess: Get jitter (ddp)", 4) |
| 559 |
Manual_DRAW_SETTINGS_WINDOW_RANGE ("Time range (s)", "0.0", "0.0 (= all)") |
| 560 |
Manual_DRAW_SETTINGS_WINDOW_FIELD ("Period floor (s)", "0.0001") |
| 561 |
Manual_DRAW_SETTINGS_WINDOW_FIELD ("Period ceiling (s)", "0.02") |
| 562 |
Manual_DRAW_SETTINGS_WINDOW_FIELD ("Maximum period factor", "1.3") |
| 563 |
) |
| 564 |
TERM (U"##Time range (s)") |
| 565 |
DEFINITION (U"the start time and end time of the part of the PointProcess that will be measured. " |
| 566 |
"Points outside this range will be ignored.") |
| 567 |
TERM (U"##Period floor (s)") |
| 568 |
DEFINITION (U"the shortest possible interval that will be used in the computation of jitter, in seconds. " |
| 569 |
"If an interval is shorter than this, it will be ignored in the computation of jitter " |
| 570 |
"(and the previous and next intervals will not be regarded as consecutive). " |
| 571 |
"This setting will normally be very small, say 0.1 ms.") |
| 572 |
TERM (U"##Period ceiling (s)") |
| 573 |
DEFINITION (U"the longest possible interval that will be used in the computation of jitter, in seconds. " |
| 574 |
"If an interval is longer than this, it will be ignored in the computation of jitter " |
| 575 |
"(and the previous and next intervals will not be regarded as consecutive). " |
| 576 |
"For example, if the minimum frequency of periodicity is 50 Hz, set this argument to 0.02 seconds; " |
| 577 |
"intervals longer than that could be regarded as voiceless stretches and will be ignored in the computation.") |
| 578 |
TERM (U"##Maximum period factor") |
| 579 |
DEFINITION (U"the largest possible difference between consecutive intervals that will be used in the computation of jitter. " |
| 580 |
"If the ratio of the durations of two consecutive intervals is greater than this, " |
| 581 |
"this pair of intervals will be ignored in the computation of jitter " |
| 582 |
"(each of the intervals could still take part in the computation of jitter in a comparison with its neighbour on the other side).") |
| 583 |
ENTRY (U"2. Usage") |
| 584 |
NORMAL (U"The jitter can be used as a measure of voice quality. See @@Voice 2. Jitter@.") |
| 585 |
ENTRY (U"3. Algorithm") |
| 586 |
NORMAL (U"(In the following the term %absolute means two different things: (1) the absolute (i.e. non-negative) value of a real number, " |
| 587 |
"and (2) the opposite of %relative.)") |
| 588 |
NORMAL (U"DDP is defined as the relative mean absolute (i.e. non-negative) " |
| 589 |
"third-order difference of the point process (= the second-order difference of the interval process), as follows.") |
| 590 |
NORMAL (U"First, we define the absolute (i.e. non-relative) Average Perturbation (in seconds) as one third of the mean absolute (non-negative) " |
| 591 |
"difference of difference of consecutive intervals:") |
| 592 |
EQUATION (U"%absDDP(seconds) = ∑__%i=2_^^%N-1^ |(%T__%i+1_ - %T__%i_) - (%T__%i_ - %T__%i-1_)| / (%N - 2)") |
| 593 |
NORMAL (U"where %T__%i_ is the duration of the %%i%th interval and %N is the number of intervals. " |
| 594 |
"If an interval %T__%i-1_ or %T__%i_ or %T__%i+1_ is not between ###Period floor# and ##Period ceiling#, " |
| 595 |
"or if %T__%i-1_/%T__%i_ or %T__%i_/%T__%i-1_ or %T__%i+1_/%T__%i_ or %T__%i_/%T__%i+1_ is greater than ##Maximum period factor#, " |
| 596 |
"the term |2%T__%i_ - %T__%i-1_ - %T__%i+1_| is not counted in the sum, and %N is lowered by 1 " |
| 597 |
"(if %N ends up being less than 3, the result of the command is @undefined).") |
| 598 |
NORMAL (U"Second, we define the mean period as") |
| 599 |
EQUATION (U"%meanPeriod(seconds) = ∑__%i=1_^^%N^ %T__%i_ / %N") |
| 600 |
NORMAL (U"where %T__%i_ is the duration of the %%i%th interval and %N is the number of intervals. " |
| 601 |
"If an interval %T__%i_ is not between ##Period floor# and ##Period ceiling#, " |
| 602 |
"or if %T__%i-1_/%T__%i_ or %T__%i_/%T__%i-1_ is greater than ##Maximum period factor# " |
| 603 |
"%and %T__%i+1_/%T__%i_ or %T__%i_/%T__%i+1_ is greater than ##Maximum period factor#, " |
| 604 |
"the term %T__%i_ is not counted in the sum, and %N is lowered by 1; " |
| 605 |
"this procedure ensures that in the computation of the mean period we use at least all the intervals " |
| 606 |
"that had taken part in the computation of DDP.") |
| 607 |
NORMAL (U"Finally, we compute DDP as") |
| 608 |
EQUATION (U"%DDP = %absDDP(seconds) / %meanPeriod(seconds)") |
| 609 |
NORMAL (U"The result is exactly 3 times the @@PointProcess: Get jitter (rap)...|RAP@ jitter measurement: " |
| 610 |
"a value between 0 and 6, or between 0 and 600 percent.") |
| 611 |
MAN_END |
| 612 |
|
| 613 |
MAN_BEGIN (U"PointProcess: Get low index...", U"ppgb", 20021212) |
| 614 |
INTRO (U"A @@Query submenu|query@ to the selected @PointProcess object.") |
| 615 |
ENTRY (U"Return value") |
| 616 |
NORMAL (U"the index of the nearest point before or at the specified time, " |
| 617 |
"or 0 if the point process contains no points or the specified time is before the first point.") |
| 618 |
ENTRY (U"Setting") |
| 619 |
TERM (U"##Time (s)") |
| 620 |
DEFINITION (U"the time from which a point is looked for, in seconds.") |
| 621 |
MAN_END |
| 622 |
|
| 623 |
MAN_BEGIN (U"PointProcess: Get nearest index...", U"ppgb", 20021212) |
| 624 |
INTRO (U"A @@Query submenu|query@ to the selected @PointProcess object.") |
| 625 |
ENTRY (U"Return value") |
| 626 |
NORMAL (U"the index of the point nearest to the specified time, " |
| 627 |
"or 0 if the point process contains no points.") |
| 628 |
ENTRY (U"Setting") |
| 629 |
TERM (U"##Time (s)") |
| 630 |
DEFINITION (U"the time around which a point is looked for, in seconds.") |
| 631 |
/* |
| 632 |
form Get nearest raising zero |
| 633 |
real Time_(s) 0.5 |
| 634 |
endform |
| 635 |
To PointProcess (zeroes)... yes no |
| 636 |
index = Get nearest index... Time |
| 637 |
if index = 0 |
| 638 |
# Geen punten gevonden: default-actie. |
| 639 |
time = 'Time' |
| 640 |
else |
| 641 |
time = Get time from index... index |
| 642 |
endif |
| 643 |
echo 'time' |
| 644 |
*/ |
| 645 |
MAN_END |
| 646 |
|
| 647 |
MAN_BEGIN (U"PointProcess: Hum", U"ppgb", 19970330) |
| 648 |
INTRO (U"A command to hear a @PointProcess.") |
| 649 |
ENTRY (U"Algorithm") |
| 650 |
NORMAL (U"A @Sound is created with the algorithm described at @@PointProcess: To Sound (hum)...@.") |
| 651 |
NORMAL (U"This sound is then played.") |
| 652 |
MAN_END |
| 653 |
|
| 654 |
MAN_BEGIN (U"PointProcesses: Intersection", U"ppgb", 20021212) |
| 655 |
INTRO (U"A command to merge two selected @PointProcess objects into one.") |
| 656 |
ENTRY (U"Behaviour") |
| 657 |
NORMAL (U"The resulting #PointProcess will contain only those points that occur in both original point processes.") |
| 658 |
NORMAL (U"The time domain of the resulting point process is the intersection of the time domains of the original point processes.") |
| 659 |
MAN_END |
| 660 |
|
| 661 |
MAN_BEGIN (U"PointProcess: Play", U"ppgb", 19970330) |
| 662 |
INTRO (U"A command to hear a @PointProcess.") |
| 663 |
ENTRY (U"Algorithm") |
| 664 |
NORMAL (U"A @Sound is created with the algorithm described at @@PointProcess: To Sound (pulse train)...@.") |
| 665 |
NORMAL (U"This sound is then played.") |
| 666 |
MAN_END |
| 667 |
|
| 668 |
MAN_BEGIN (U"PointProcess: Remove point...", U"ppgb", 20021212) |
| 669 |
INTRO (U"A command to remove a point from every selected @PointProcess.") |
| 670 |
ENTRY (U"Setting") |
| 671 |
TERM (U"##Index") |
| 672 |
DEFINITION (U"the index of the point that is to be removed.") |
| 673 |
ENTRY (U"Behaviour") |
| 674 |
NORMAL (U"Does nothing if %index is less than 1 or greater than the number of points %nt in the point process. " |
| 675 |
"Otherwise, one point is removed (e.g., if %index is 3, the third point is removed), and the other points stay the same.") |
| 676 |
MAN_END |
| 677 |
|
| 678 |
MAN_BEGIN (U"PointProcess: Remove point near...", U"ppgb", 20021212) |
| 679 |
INTRO (U"A command to remove a point from every selected @PointProcess.") |
| 680 |
ENTRY (U"Setting") |
| 681 |
TERM (U"##Time (s)") |
| 682 |
DEFINITION (U"the time (in seconds) around which a point is to be removed.") |
| 683 |
ENTRY (U"Behaviour") |
| 684 |
NORMAL (U"Does nothing if there are no points in the point process. " |
| 685 |
"Otherwise, the point nearest to %time is removed, and the other points stay the same.") |
| 686 |
MAN_END |
| 687 |
|
| 688 |
MAN_BEGIN (U"PointProcess: Remove points...", U"ppgb", 20021212) |
| 689 |
INTRO (U"A command to remove a range of points from every selected @PointProcess.") |
| 690 |
ENTRY (U"Settings") |
| 691 |
TERM (U"##From index (≥ 1)") |
| 692 |
DEFINITION (U"the first index of the range of points that are to be removed.") |
| 693 |
TERM (U"##To index") |
| 694 |
DEFINITION (U"the last index of the range of points that are to be removed.") |
| 695 |
ENTRY (U"Behaviour") |
| 696 |
NORMAL (U"All points that originally fell in the range [%fromIndex, %toIndex] are removed, and the other points stay the same.") |
| 697 |
MAN_END |
| 698 |
|
| 699 |
MAN_BEGIN (U"PointProcess: Remove points between...", U"ppgb", 20021212) |
| 700 |
INTRO (U"A command to remove a range of points from every selected @PointProcess.") |
| 701 |
ENTRY (U"Settings") |
| 702 |
TERM (U"##From time (s)") |
| 703 |
DEFINITION (U"the start of the domain from which all points are to be removed.") |
| 704 |
TERM (U"##To time (s)") |
| 705 |
DEFINITION (U"the end of the domain from which all points are to be removed.") |
| 706 |
ENTRY (U"Behaviour") |
| 707 |
NORMAL (U"All points that originally fell in the domain [%fromTime, %toTime], including the edges, are removed, " |
| 708 |
"and the other points stay the same.") |
| 709 |
MAN_END |
| 710 |
|
| 711 |
MAN_BEGIN (U"PointProcess: To Sound (hum)...", U"ppgb", 19970330) |
| 712 |
INTRO (U"A command to convert every selected @PointProcess into a @Sound.") |
| 713 |
ENTRY (U"Algorithm") |
| 714 |
NORMAL (U"A @Sound is created with the algorithm described at @@PointProcess: To Sound (pulse train)...@. " |
| 715 |
"This sound is then run through a sequence of second-order filters that represent five formants.") |
| 716 |
MAN_END |
| 717 |
|
| 718 |
MAN_BEGIN (U"PointProcess: To Sound (phonation)...", U"ppgb", 20070225) |
| 719 |
INTRO (U"A command to convert every selected @PointProcess into a @Sound.") |
| 720 |
ENTRY (U"Algorithm") |
| 721 |
NORMAL (U"A glottal waveform is generated at every point in the point process. " |
| 722 |
"Its shape depends on the settings %power1 and %power2 according to the formula") |
| 723 |
EQUATION (U"%U(%x) = %x^^%power1^ - %x^^%power2^") |
| 724 |
NORMAL (U"where %x is a normalized time that runs from 0 to 1 and %U(%x) is the normalized glottal flow in arbitrary units (the real unit is m^3/s). " |
| 725 |
"If %power1 = 2.0 and %power2 = 3.0, the glottal flow shape is that proposed by @@Rosenberg (1971)@, " |
| 726 |
"upon which for instance the Klatt synthesizer is based (@@Klatt & Klatt (1990)@):") |
| 727 |
SCRIPT (4.5, 3, |
| 728 |
U"Select outer viewport... 0 4.5 -0.4 3\n" |
| 729 |
"Axes... 0 1 -0.1 1\n" |
| 730 |
"One mark left... 0 yes yes yes\n" |
| 731 |
"One mark bottom... 0 yes yes no\n" |
| 732 |
"One mark bottom... 1 yes yes no\n" |
| 733 |
"Draw inner box\n" |
| 734 |
"Draw function... 0 1 1000 (x^2-x^3)*6\n" |
| 735 |
"Text bottom... yes Time (normalized)\n" |
| 736 |
"Text left... yes Glottal flow\n" |
| 737 |
) |
| 738 |
NORMAL (U"If %power1 = 3.0 and %power2 = 4.0, the glottal flow shape starts somewhat smoother, " |
| 739 |
"reflecting the idea that the glottis opens like a zipper:") |
| 740 |
SCRIPT (4.5, 3, |
| 741 |
U"Axes... 0 1 -0.1 1\n" |
| 742 |
"One mark left... 0 yes yes yes\n" |
| 743 |
"One mark bottom... 0 yes yes no\n" |
| 744 |
"One mark bottom... 1 yes yes no\n" |
| 745 |
"Draw inner box\n" |
| 746 |
"Draw function... 0 1 1000 (x^3-x^4)*8\n" |
| 747 |
"Text bottom... yes Time (normalized)\n" |
| 748 |
"Text left... yes Glottal flow\n" |
| 749 |
) |
| 750 |
NORMAL (U"For the generation of speech sounds, we do not take the glottal flow itself, " |
| 751 |
"but rather its derivative (this takes into account the influence of radiation at the lips). " |
| 752 |
"The glottal flow derivative is given by") |
| 753 |
EQUATION (U"%dU(%x)/%dx = %power1 %x^^(%power1-1)^ - %power2 %x^^(%power2-1)^") |
| 754 |
NORMAL (U"The flow derivative clearly shows the influence of the smoothing mentioned above. " |
| 755 |
"The unsmoothed curve, with %power1 = 2.0 and %power2 = 3.0, looks like:") |
| 756 |
SCRIPT (4.5, 4, |
| 757 |
U"Axes... 0 1 -9 3\n" |
| 758 |
"One mark left... 0 yes yes yes\n" |
| 759 |
"One mark bottom... 0 yes yes no\n" |
| 760 |
"One mark bottom... 1 yes yes no\n" |
| 761 |
"Draw inner box\n" |
| 762 |
"Draw function... 0 1 1000 (2*x-3*x^2)*6\n" |
| 763 |
"Text bottom... yes Time (normalized)\n" |
| 764 |
"Text left... yes Glottal flow derivative\n" |
| 765 |
) |
| 766 |
NORMAL (U"Unlike the unsmoothed curve, the smoothed curve, with %power1 = 3.0 and %power2 = 4.0, starts out horizontally:") |
| 767 |
SCRIPT (4.5, 4, |
| 768 |
U"Axes... 0 1 -9 3\n" |
| 769 |
"One mark left... 0 yes yes yes\n" |
| 770 |
"One mark bottom... 0 yes yes no\n" |
| 771 |
"One mark bottom... 1 yes yes no\n" |
| 772 |
"Draw inner box\n" |
| 773 |
"Draw function... 0 1 1000 (3*x^2-4*x^3)*8\n" |
| 774 |
"Text bottom... yes Time (normalized)\n" |
| 775 |
"Text left... yes Glottal flow derivative\n" |
| 776 |
) |
| 777 |
NORMAL (U"Another setting is the %%open phase%. If it is 0.70, the glottis will be open during 70 percent of a period. " |
| 778 |
"Suppose that the PointProcess has a pulse at time 0, at time 1, at time 2, and so on. The pulses at times 1 and 2 will then be turned " |
| 779 |
"into glottal flows starting at times 0.30 and 1.30:") |
| 780 |
SCRIPT (4.5, 2.5, |
| 781 |
U"Axes... 0 2 -0.1 1\n" |
| 782 |
"One mark left... 0 yes yes yes\n" |
| 783 |
"One mark bottom... 0 yes yes no\n" |
| 784 |
"One mark bottom... 1 yes yes yes\n" |
| 785 |
"One mark bottom... 2 yes yes no\n" |
| 786 |
"Draw inner box\n" |
| 787 |
"Draw function... 0 0.3 2 0\n" |
| 788 |
"Draw function... 0.3 1.3 300 if x<1 then (((x-0.3)/0.7)^3-((x-0.3)/0.7)^4)*8 else 0 fi\n" |
| 789 |
"Draw function... 1.3 2 300 (((x-1.3)/0.7)^3-((x-1.3)/0.7)^4)*8\n" |
| 790 |
"Text bottom... yes Time (normalized)\n" |
| 791 |
"Text left... yes Glottal flow\n" |
| 792 |
) |
| 793 |
SCRIPT (4.5, 2.5, |
| 794 |
U"Axes... 0 2 -9 3\n" |
| 795 |
"One mark left... 0 yes yes yes\n" |
| 796 |
"One mark bottom... 0 yes yes no\n" |
| 797 |
"One mark bottom... 1 yes yes yes\n" |
| 798 |
"One mark bottom... 2 yes yes no\n" |
| 799 |
"Draw inner box\n" |
| 800 |
"Draw function... 0 0.3 2 0\n" |
| 801 |
"Draw function... 0.3 1.3 300 if x<1 then (3*((x-0.3)/0.7)^2-4*((x-0.3)/0.7)^3)*8 else 0 fi\n" |
| 802 |
"Draw function... 1.3 2 300 (3*((x-1.3)/0.7)^2-4*((x-1.3)/0.7)^3)*8\n" |
| 803 |
"Text bottom... yes Time (normalized)\n" |
| 804 |
"Text left... yes Glottal flow derivative\n" |
| 805 |
) |
| 806 |
NORMAL (U"The final setting that influences the shape of the glottal flow is the %%collision phase%. " |
| 807 |
"If it is 0.03, for instance, the glottal flow derivative will not go abruptly to 0 at a pulse, " |
| 808 |
"but will instead decay by a factor of %e (≈ 2.7183) every 3 percent of a period. " |
| 809 |
"In order to keep the glottal flow curve smooth (and the derivative continuous), " |
| 810 |
"the basic shape discussed above has to be shifted slightly to the right and truncated " |
| 811 |
"at the time of the pulse, to be replaced there with the exponential decay curve; " |
| 812 |
"this also makes sure that the average of the derivative stays zero, as it was above " |
| 813 |
"(i.e. the area under the positive part of the curve equals the area above the negative part). " |
| 814 |
"This is what the curves look like if %power1 = 3.0, %power2 = 4.0, %openPhase = 0.70 and %collisionPhase = 0.03:") |
| 815 |
SCRIPT (4.5, 2.5, |
| 816 |
U"Axes... 0 2 -0.1 1\n" |
| 817 |
"One mark left... 0 yes yes yes\n" |
| 818 |
"One mark bottom... 0 yes yes no\n" |
| 819 |
"One mark bottom... 1 yes yes yes\n" |
| 820 |
"One mark bottom... 2 yes yes no\n" |
| 821 |
"Draw inner box\n" |
| 822 |
"xo = 0.32646\n" |
| 823 |
"g1 = 0.269422\n" |
| 824 |
"Draw function... 0 xo 300 g1 * exp(-x/0.03)\n" |
| 825 |
"Draw function... xo 1 300 (((x-xo)/0.7)^3-((x-xo)/0.7)^4)*8 + g1 * exp(-x/0.03)\n" |
| 826 |
"Draw function... 1 1+xo 300 g1 * exp(-(x-1)/0.03)\n" |
| 827 |
"Draw function... 1+xo 2 300 (((x-1-xo)/0.7)^3-((x-1-xo)/0.7)^4)*8 + g1 * exp(-(x-1)/0.03)\n" |
| 828 |
"Text bottom... yes Time (normalized)\n" |
| 829 |
"Text left... yes Glottal flow\n" |
| 830 |
) |
| 831 |
SCRIPT (4.5, 2.5, |
| 832 |
U"Axes... 0 2 -9 3\n" |
| 833 |
"One mark left... 0 yes yes yes\n" |
| 834 |
"One mark bottom... 0 yes yes no\n" |
| 835 |
"One mark bottom... 1 yes yes yes\n" |
| 836 |
"One mark bottom... 2 yes yes no\n" |
| 837 |
"Draw inner box\n" |
| 838 |
"xo = 0.32646\n" |
| 839 |
"g1 = -8.980736 * 0.7\n" |
| 840 |
"Draw function... 0 xo 300 g1 * exp(-x/0.03)\n" |
| 841 |
"Draw function... xo 1 300 (3*((x-xo)/0.7)^2-4*((x-xo)/0.7)^3)*8 + g1 * exp(-x/0.03)\n" |
| 842 |
"Draw function... 1 1+xo 300 g1 * exp(-(x-1)/0.03)\n" |
| 843 |
"Draw function... 1+xo 2 300 (3*((x-1-xo)/0.7)^2-4*((x-1-xo)/0.7)^3)*8 + g1 * exp(-(x-1)/0.03)\n" |
| 844 |
"Text bottom... yes Time (normalized)\n" |
| 845 |
"Text left... yes Glottal flow derivative\n" |
| 846 |
) |
| 847 |
NORMAL (U"These curves have moved 2.646 percent of a period to the right. At time 1, " |
| 848 |
"the glottal flow curve turns from a convex polynomial into a concave exponential, " |
| 849 |
"and the derivative still has its minimum there.") |
| 850 |
ENTRY (U"Settings") |
| 851 |
TERM (U"##Sampling frequency (Hz)") |
| 852 |
DEFINITION (U"the sampling frequency of the resulting Sound object, e.g. 44100 hertz.") |
| 853 |
TERM (U"##Adaptation factor") |
| 854 |
DEFINITION (U"the factor by which a pulse height will be multiplied if the pulse time is not within " |
| 855 |
"##Maximum period# from the previous pulse, and by which a pulse height will again be multiplied " |
| 856 |
"if the previous pulse time is not within ##Maximum period# from the pre-previous pulse. This factor is against " |
| 857 |
"abrupt starts of the pulse train after silences, and is 1.0 if you do want abrupt starts after silences.") |
| 858 |
TERM (U"##Maximum period (s)") |
| 859 |
DEFINITION (U"the minimal period that will be considered a silence, e.g. 0.05 seconds. " |
| 860 |
"Example: if ##Adaptation factor# is 0.6, and ##Adaptation time# is 0.02 s, " |
| 861 |
"then the heights of the first two pulses after silences of at least 20 ms " |
| 862 |
"will be multiplied by 0.36 and 0.6, respectively.") |
| 863 |
MAN_END |
| 864 |
|
| 865 |
MAN_BEGIN (U"PointProcess: To Sound (pulse train)...", U"ppgb", 20070225) |
| 866 |
INTRO (U"A command to convert every selected @PointProcess into a @Sound.") |
| 867 |
ENTRY (U"Algorithm") |
| 868 |
NORMAL (U"A pulse is generated at every point in the point process. This pulse is filtered at the Nyquist frequency " |
| 869 |
"of the resulting #Sound by converting it into a sampled #sinc function.") |
| 870 |
ENTRY (U"Settings") |
| 871 |
TERM (U"##Sampling frequency (Hz)") |
| 872 |
DEFINITION (U"the sampling frequency of the resulting Sound object, e.g. 44100 hertz.") |
| 873 |
TERM (U"##Adaptation factor") |
| 874 |
DEFINITION (U"the factor by which a pulse height will be multiplied if the pulse time is not within " |
| 875 |
"##Adaptation time# from the pre-previous pulse, and by which a pulse height will again be multiplied " |
| 876 |
"if the pulse time is not within ##Adaptation time# from the previous pulse. This factor is against " |
| 877 |
"abrupt starts of the pulse train after silences, and is 1.0 if you do want abrupt starts after silences.") |
| 878 |
TERM (U"##Adaptation time (s)") |
| 879 |
DEFINITION (U"the minimal period that will be considered a silence, e.g. 0.05 seconds.") |
| 880 |
TERM (U"##Interpolation depth") |
| 881 |
DEFINITION (U"the extent of the sinc function to the left and to the right of the peak, e.g. 2000 samples.") |
| 882 |
NORMAL (U"Example: if ##Adaptation factor# is 0.6, and ##Adaptation time# is 0.02 s, " |
| 883 |
"then the heights of the first two pulses after silences of at least 20 ms " |
| 884 |
"will be multiplied by 0.36 and 0.6, respectively.") |
| 885 |
MAN_END |
| 886 |
|
| 887 |
MAN_BEGIN (U"PointProcesses: Union", U"ppgb", 20021212) |
| 888 |
INTRO (U"A command to merge two selected @PointProcess objects into one.") |
| 889 |
ENTRY (U"Behaviour") |
| 890 |
NORMAL (U"The resulting #PointProcess will contain all the points of the two original point processes, sorted by time. " |
| 891 |
"Points that occur in both original point processes, will occur only once in the resulting point process.") |
| 892 |
NORMAL (U"The time domain of the resulting point process is the union of the time domains of the original point processes.") |
| 893 |
MAN_END |
| 894 |
|
| 895 |
MAN_BEGIN (U"PointProcess: Up to IntensityTier...", U"ppgb", 19970329) |
| 896 |
INTRO (U"A command to promote every selected @PointProcess to an @IntensityTier.") |
| 897 |
ENTRY (U"Setting") |
| 898 |
TERM (U"##Intensity (dB)") |
| 899 |
DEFINITION (U"the intensity that will be associated with every point.") |
| 900 |
ENTRY (U"Behaviour") |
| 901 |
NORMAL (U"The times of all the points are trivially copied, and so is the time domain. " |
| 902 |
"The intensity information will be the same for every point.") |
| 903 |
MAN_END |
| 904 |
|
| 905 |
MAN_BEGIN (U"PointProcess: Up to PitchTier...", U"ppgb", 19970329) |
| 906 |
INTRO (U"A command to promote every selected @PointProcess to a @PitchTier.") |
| 907 |
ENTRY (U"Setting") |
| 908 |
TERM (U"##Frequency (Hz)") |
| 909 |
DEFINITION (U"the pitch frequency that will be associated with every point.") |
| 910 |
ENTRY (U"Behaviour") |
| 911 |
NORMAL (U"The times of all the points are trivially copied, and so is the time domain. " |
| 912 |
"The pitch information will be the same for every point.") |
| 913 |
MAN_END |
| 914 |
|
| 915 |
|
| 916 |
} |
| 917 |
|
| 918 |
/* End of file manual_pointProcess.cpp */ |