Debian Codegraph @

docs/manual/Formulas_5__Mathematical_functions.html

raw
1 <html><head><meta name="robots" content="index,follow"><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
2 <title>Formulas 5. Mathematical functions</title>
3 <style>
4 td { padding-left: 5pt; padding-right: 5pt; }
5 th { padding-left: 5pt; padding-right: 5pt; }
6 code { white-space: pre-wrap; }
7 dd { white-space: pre-wrap; }
8 </style>
9 </head><body bgcolor="#FFFFFF">
10
11 <table border=0 cellpadding=0 cellspacing=0><tr><td bgcolor="#CCCC00"><table border=4 cellpadding=9><tr><td align=middle bgcolor="#000000"><font face="Palatino,Times" size=6 color="#999900"><b>
12 Formulas 5. Mathematical functions
13 </b></font></table></table>
14 <dl>
15 <dt><b>abs (<i>x</i>)</b>
16 <dd>absolute value</dd>
17 <dt><b>round (<i>x</i>)</b>
18 <dd>nearest integer; round (1.5) = 2</dd>
19 <dt><b>floor (<i>x</i>)</b>
20 <dd>round down: highest integer value not greater than <i>x</i></dd>
21 <dt><b>ceiling (<i>x</i>)</b>
22 <dd>round up: lowest integer value not less than <i>x</i></dd>
23 <dt><b>sqrt (<i>x</i>)</b>
24 <dd>square root: &#8730;<i>x</i>, <i>x</i> &#8805; 0</dd>
25 <dt><b>min (<i>x</i>, ...)</b>
26 <dd>the minimum of a series of numbers, e.g. min (7.2, -5, 3) = -5</dd>
27 <dt><b>max (<i>x</i>, ...)</b>
28 <dd>the maximum of a series of numbers, e.g. max (7.2, -5, 3) = 7.2</dd>
29 <dt><b>imin (<i>x</i>, ...)</b>
30 <dd>the location of the minimum, e.g. imin (7.2, -5, 3) = 2</dd>
31 <dt><b>imax (<i>x</i>, ...)</b>
32 <dd>the location of the maximum, e.g. imax (7.2, -5, 3) = 1</dd>
33 <dt><b>sin (<i>x</i>)</b>
34 <dd>sine</dd>
35 <dt><b>cos (<i>x</i>)</b>
36 <dd>cosine</dd>
37 <dt><b>tan (<i>x</i>)</b>
38 <dd>tangent</dd>
39 <dt><b>arcsin (<i>x</i>)</b>
40 <dd>arcsine, -1 &#8804; <i>x</i> &#8804; 1</dd>
41 <dt><b>arccos (<i>x</i>)</b>
42 <dd>arccosine, -1 &#8804; <i>x</i> &#8804; 1</dd>
43 <dt><b>arctan (<i>x</i>)</b>
44 <dd>arctangent</dd>
45 <dt><b>arctan2 (<i>y</i>, <i>x</i>)</b>
46 <dd>argument angle</dd>
47 <dt><b>sinc (<i>x</i>)</b>
48 <dd>sinus cardinalis: sin (<i>x</i>) / <i>x</i></dd>
49 <dt><b>sincpi (<i>x</i>)</b>
50 <dd>sinc<sub><i>&#960;</i></sub>: sin (<i>&#960;</i><i>x</i>) / (<i>&#960;</i><i>x</i>)</dd>
51 <dt><b>exp (<i>x</i>)</b>
52 <dd>exponentiation: <i>e</i><sup><i>x</i></sup>; same as <b>e^<i>x</i></b></dd>
53 <dt><b>ln (<i>x</i>)</b>
54 <dd>natural logarithm, base <i>e</i></dd>
55 <dt><b>log10 (<i>x</i>)</b>
56 <dd>logarithm, base 10</dd>
57 <dt><b>log2 (<i>x</i>)</b>
58 <dd>logarithm, base 2</dd>
59 <dt><b>sinh (<i>x</i>)</b>
60 <dd>hyperbolic sine: (<i>e</i><sup><i>x</i></sup> - <i>e</i><sup>-<i>x</i></sup>) / 2</dd>
61 <dt><b>cosh (<i>x</i>)</b>
62 <dd>hyperbolic cosine: (<i>e</i><sup><i>x</i></sup> + <i>e</i><sup>-<i>x</i></sup>) / 2</dd>
63 <dt><b>tanh (<i>x</i>)</b>
64 <dd>hyperbolic tangent: sinh (<i>x</i>) / cosh (<i>x</i>)</dd>
65 <dt><b>arcsinh (<i>x</i>)</b>
66 <dd>inverse hyperbolic sine: ln (<i>x</i> + &#8730;(1+<i>x</i><sup>2</sup>))</dd>
67 <dt><b>arccosh (<i>x</i>)</b>
68 <dd>inverse hyperbolic cosine: ln (<i>x</i> + &#8730;(<i>x</i><sup>2</sup>&#8722;1))</dd>
69 <dt><b>arctanh (<i>x</i>)</b>
70 <dd>inverse hyperbolic tangent</dd>
71 <dt><b>sigmoid (<i>x</i>)</b>
72 <dd><b>R</b> &#8594; (0,1): 1 / (1 + <i>e</i><sup>&#8722;<i>x</i></sup>) or 1 &#8722; 1 / (1 + <i>e</i><sup><i>x</i></sup>)</dd>
73 <dt><b>invSigmoid (<i>x</i>)</b>
74 <dd>(0,1) &#8594; <b>R</b>: ln (<i>x</i> / (1 &#8722; <i>x</i>))</dd>
75 <dt><b>erf (<i>x</i>)</b>
76 <dd>the error function: 2/&#8730;<i>&#960;</i> <sub>0</sub>&#8747;<sup><i>x</i></sup> exp(-<i>t</i><sup>2</sup>) <i>dt</i></dd>
77 <dt><b>erfc (<i>x</i>)</b>
78 <dd>the complement of the error function: 1 - erf (<i>x</i>)</dd>
79 <dt><b>randomUniform (<i>min</i>, <i>max</i>)</b>
80 <dd>a uniform random real number between <i>min</i> (inclusive) and <i>max</i> (exclusive)</dd>
81 <dt><b>randomInteger (<i>min</i>, <i>max</i>)</b>
82 <dd>a uniform random integer number between <i>min</i> and <i>max</i> (inclusive)</dd>
83 <dt><b>randomGauss (<i>&#956;</i>, <i>&#963;</i>)</b>
84 <dd>a Gaussian random real number with mean <i>&#956;</i> and standard deviation <i>&#963;</i></dd>
85 <dt><b>randomPoisson (<i>mean</i>)</b>
86 <dd>a Poisson random real number</dd>
87 <dt><b>randomGamma (<i>shape</i>, <i>rate</i>)</b>
88 <dd>a random number drawn from a Gamma distribution with shape parameter <i>&#945;</i> and rate parameter <i>&#946;</i>, which is defined as <i>f</i>(<i>x</i>; <i>&#945;</i>, <i>&#946;</i>) = (1 / &#915; (<i>&#945;</i>)) <i>&#946;</i><i></i><sup><i>&#945;</i></sup> <i>x</i><sup><i>&#945;</i>&#8722;1</sup> <i>e</i><sup>&#8722;<i>&#946;</i> <i>x</i></sup>, for <i>x</i> &gt; 0, <i>&#945;</i> &gt; 0 and <i>&#946;</i> &gt; 0, following the method by <a href="Marsaglia___Tsang__2000_.html">Marsaglia & Tsang (2000)</a></dd>
89 <dt><b>random_initializeWithSeedUnsafelyButPredictably (<i>seed</i>)</b>
90 <dd>can be used in a script to create a reproducible sequence of random numbers (warning: this exceptional situation will continue to exist throughout Praat until you call the following function)</dd>
91 <dt><b>random_initializeSafelyAndUnpredictably ()</b>
92 <dd>undoes the exceptional situation caused by the previous function</dd>
93 <dt><b>lnGamma (<i>x</i>)</b>
94 <dd>logarithm of the &#915; function</dd>
95 <dt><b>gaussP (<i>z</i>)</b>
96 <dd>the area under the Gaussian distribution between &#8722;&#8734; and <i>z</i></dd>
97 <dt><b>gaussQ (<i>z</i>)</b>
98 <dd>the area under the Gaussian distribution between <i>z</i> and +&#8734;: the one-tailed "statistical significance <i>p</i>" of a value that is <i>z</i> standard deviations away from the mean of a Gaussian distribution</dd>
99 <dt><b>invGaussQ (<i>q</i>)</b>
100 <dd>the value of <i>z</i> for which <code><font size=+1>gaussQ</font></code> (<i>z</i>) = <i>q</i></dd>
101 <dt><b>chiSquareP (<i><code><font size=+1>chiSquare</font></code></i>, <i><code><font size=+1>df</font></code></i>)</b>
102 <dd>the area under the <i>&#967;</i><sup>2</sup> distribution between 0 and <i>chiSquare</i>, for <i><code><font size=+1>df</font></code></i> degrees of freedom</dd>
103 <dt><b>chiSquareQ (<i><code><font size=+1>chiSquare</font></code></i>, <i><code><font size=+1>df</font></code></i>)</b>
104 <dd>the area under the <i>&#967;</i><sup>2</sup> distribution between <i><code><font size=+1>chiSquare</font></code></i> and +&#8734;, for <i>df</i> degrees of freedom: the "statistical significance <i>p</i>" of the <i>&#967;</i><sup>2</sup> difference between two distributions in <i>df</i>+1 dimensions</dd>
105 <dt><b>invChiSquareQ (<i>q</i>, <i>df</i>)</b>
106 <dd>the value of <i>&#967;</i><sup>2</sup> for which <code><font size=+1>chiSquareQ</font></code> (<i>&#967;</i><sup>2</sup>, <i>df</i>) = <i>q</i></dd>
107 <dt><b>studentP (<i>t</i>, <i>df</i>)</b>
108 <dd>the area under the student T-distribution from -&#8734; to <i>t</i></dd>
109 <dt><b>studentQ (<i>t</i>, <i>df</i>)</b>
110 <dd>the area under the student T-distribution from <i>t</i> to +&#8734;</dd>
111 <dt><b>invStudentQ (<i>q</i>, <i>df</i>)</b>
112 <dd>the value of <i>t</i> for which <code><font size=+1>studentQ</font></code> (<i>t</i>, <i>df</i>) = <i>q</i></dd>
113 <dt><b>fisherP (<i>f</i>, <i>df1</i>, <i>df2</i>)</b>
114 <dd>the area under Fisher's F-distribution from 0 to <i>f</i></dd>
115 <dt><b>fisherQ (<i>f</i>, <i>df1</i>, <i>df2</i>)</b>
116 <dd>the area under Fisher's F-distribution from <i>f</i> to +&#8734;</dd>
117 <dt><b>invFisherQ (<i>q</i>, <i>df1</i>, <i>df2</i>)</b>
118 <dd>the value of <i>f</i> for which <code><font size=+1>fisherQ</font></code> (<i>f</i>, <i>df1</i>, <i>df2</i>) = <i>q</i></dd>
119 <dt><b>binomialP (<i>p</i>, <i>k</i>, <i>n</i>)</b>
120 <dd>the probability that in <i>n</i> experiments, an event with probability <i>p</i> will occur at most <i>k</i> times</dd>
121 <dt><a href="_binomialQ_.html"><b><code><font size=+1>binomialQ</font></code></b></a> (<i>p</i>, <i>k</i>, <i>n</i>)
122 <dd>the probability that in <i>n</i> experiments, an event with probability <i>p</i> will occur at least <i>k</i> times; equals 1 - <code><font size=+1>binomialP</font></code> (<i>p</i>, <i>k</i> - 1, <i>n</i>)</dd>
123 <dt><b>invBinomialP (<i>P</i>, <i>k</i>, <i>n</i>)</b>
124 <dd>the value of <i>p</i> for which <code><font size=+1>binomialP</font></code> (<i>p</i>, <i>k</i>, <i>n</i>) = <i>P</i></dd>
125 <dt><a href="_invBinomialQ_.html"><b><code><font size=+1>invBinomialQ</font></code></b></a> (<i>Q</i>, <i>k</i>, <i>n</i>)
126 <dd>the value of <i>p</i> for which <code><font size=+1>binomialQ</font></code> (<i>p</i>, <i>k</i>, <i>n</i>) = <i>Q</i></dd>
127 <dt><b>hertzToBark (<i>x</i>)</b>
128 <dd>from acoustic frequency to Bark-rate (perceptual spectral frequency; place on basilar membrane): 7 ln (<i>x</i>/650 + &#8730;(1 + (<i>x</i>/650)<sup>2</sup>))</dd>
129 <dt><b>barkToHertz (<i>x</i>)</b>
130 <dd>650 sinh (<i>x</i> / 7)</dd>
131 <dt><b>hertzToMel (<i>x</i>)</b>
132 <dd>from acoustic frequency to perceptual pitch: 550 ln (1 + <i>x</i> / 550)</dd>
133 <dt><b>melToHertz (<i>x</i>)</b>
134 <dd>550 (exp (<i>x</i> / 550) - 1)</dd>
135 <dt><b>hertzToSemitones (<i>x</i>)</b>
136 <dd>from acoustic frequency to a logarithmic musical scale, relative to 100 Hz: 12 ln (<i>x</i> / 100) / ln 2</dd>
137 <dt><b>semitonesToHertz (<i>x</i>)</b>
138 <dd>100 exp (<i>x</i> ln 2 / 12)</dd>
139 <dt><b>erb (<i>f</i>)</b>
140 <dd>the perceptual <i>equivalent rectangular bandwidth</i> (ERB) in hertz, for a specified acoustic frequency (also in hertz): 6.23&#183;10<sup>-6</sup> <i>f</i><sup>2</sup> + 0.09339 <i>f</i> + 28.52</dd>
141 <dt><b>hertzToErb (<i>x</i>)</b>
142 <dd>from acoustic frequency to ERB-rate: 11.17 ln ((<i>x</i> + 312) / (<i>x</i> + 14680)) + 43</dd>
143 <dt><b>erbToHertz (<i>x</i>)</b>
144 <dd>(14680 <i>d</i> - 312) / (1 - <i>d</i>) where <i>d</i> = exp ((<i>x</i> - 43) / 11.17)</dd>
145 <dt><a href="_phonToDifferenceLimens_.html"><b><code><font size=+1>phonToDifferenceLimens</font></code></b></a> (<i>x</i>)
146 <dd>from perceptual loudness (intensity sensation) level in phon, to the number of intensity difference limens above threshold: 30 &#183; ((61/60)<sup> <i>x</i></sup> &#8722; 1).</dd>
147 <dt><a href="_differenceLimensToPhon_.html"><b><code><font size=+1>differenceLimensToPhon</font></code></b></a> (<i>x</i>)
148 <dd>the inverse of the previous: ln (1 + <i>x</i> / 30) / ln (61 / 60).</dd>
149 <dt><b>beta (<i>x</i>, <i>y</i>)</b>
150 <dt><b>besselI (<i>n</i>, <i>x</i>)</b>
151 <dt><b>besselK (<i>n</i>, <i>x</i>)</b>
152 </dl>
153 <p>For functions with arrays, see <a href="Scripting_5_7__Vectors_and_matrices.html">Scripting 5.7. Vectors and matrices</a>.</p>
154 <h3>Links to this page</h3>
155 <ul>
156 <li><a href="Formulas.html">Formulas</a>
157 <li><a href="What_was_new_in_3_7_.html">What was new in 3.7?</a>
158 <li><a href="What_was_new_in_3_9_.html">What was new in 3.9?</a>
159 </ul>
160 <hr>
161 <address>
162 <p>© ppgb 20200801</p>
163 </address>
164 </body>
165 </html>