diff options
| author | Stefan Monnier | 2011-03-21 12:42:16 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2011-03-21 12:42:16 -0400 |
| commit | cafdcef32d55cbb44389d7e322e7f973cbb72dfd (patch) | |
| tree | 7ee0c41ea8a589650ce6f4311fb10e61a63807b9 /doc/misc/calc.texi | |
| parent | a08a25d7aaf251aa18f2ef747be53734bc55cae9 (diff) | |
| parent | 4e05e67e4cd0bc1b0a4ef3176a4d0d91c6b3738e (diff) | |
| download | emacs-cafdcef32d55cbb44389d7e322e7f973cbb72dfd.tar.gz emacs-cafdcef32d55cbb44389d7e322e7f973cbb72dfd.zip | |
Merge from trunk
Diffstat (limited to 'doc/misc/calc.texi')
| -rw-r--r-- | doc/misc/calc.texi | 235 |
1 files changed, 116 insertions, 119 deletions
diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi index 88103fc0034..f732eff5690 100644 --- a/doc/misc/calc.texi +++ b/doc/misc/calc.texi | |||
| @@ -28126,47 +28126,15 @@ tell Calc to use a different file for the Calc init file.) | |||
| 28126 | @section Logarithmic Units | 28126 | @section Logarithmic Units |
| 28127 | 28127 | ||
| 28128 | The units @code{dB} (decibels) and @code{Np} (nepers) are logarithmic | 28128 | The units @code{dB} (decibels) and @code{Np} (nepers) are logarithmic |
| 28129 | units which are typically manipulated differently than standard units. | 28129 | units which are manipulated differently than standard units. Calc |
| 28130 | Calc provides commands to work with these logarithmic units. | 28130 | provides commands to work with these logarithmic units. |
| 28131 | 28131 | ||
| 28132 | Decibels and nepers are used to measure power quantities as well as | 28132 | Decibels and nepers are used to measure power quantities as well as |
| 28133 | field quantities (quantities whose squares are proportional to power). | 28133 | field quantities (quantities whose squares are proportional to power); |
| 28134 | The decibel and neper values of a quantity are relative to | 28134 | these two types of quantities are handled slightly different from each |
| 28135 | a reference quantity; for example, the decibel value of a sound | 28135 | other. By default the Calc commands work as if power quantities are |
| 28136 | pressure level of | 28136 | being used; with the @kbd{H} prefix the Calc commands work as if field |
| 28137 | @infoline @math{60 uPa} | 28137 | quantities are being used. |
| 28138 | @texline @math{60 \mu{\rm Pa}} | ||
| 28139 | relative to | ||
| 28140 | @infoline @math{20 uPa} | ||
| 28141 | @texline @math{20 \mu{\rm Pa}} | ||
| 28142 | (the threshhold of human hearing) is | ||
| 28143 | @infoline @math{20 log10(60 uPa/ 20 uPa) dB = 20 log10(3) dB}, | ||
| 28144 | @texline @math{20 \log_{10}(60 \mu{\rm Pa}/20 \mu{\rm Pa}) {\rm dB} = 20 \log_{10}(3) {\rm dB}}, | ||
| 28145 | which is about | ||
| 28146 | @infoline @math{9.54 dB}. | ||
| 28147 | @texline @math{9.54 {\rm dB}}. | ||
| 28148 | Note that in taking the ratio, the original units cancel and so these | ||
| 28149 | logarithmic units are dimensionless. | ||
| 28150 | |||
| 28151 | @vindex calc-logunits-power-reference | ||
| 28152 | @vindex calc-logunits-field-reference | ||
| 28153 | The Calc commands for the logarithmic units assume that power quantities | ||
| 28154 | are being used unless the @kbd{H} prefix is used, in which case they assume that | ||
| 28155 | field quantities are being used. For power quantities, Calc uses | ||
| 28156 | @infoline @math{1 mW} | ||
| 28157 | @texline @math{1 {\rm mW}} | ||
| 28158 | as the default reference quantity; this default can be changed by changing | ||
| 28159 | the value of the customizable variable | ||
| 28160 | @code{calc-logunits-power-reference} (@pxref{Customizing Calc}). | ||
| 28161 | For field quantities, Calc uses | ||
| 28162 | @infoline @math{20 uPa} | ||
| 28163 | @texline @math{20 \mu{\rm Pa}} | ||
| 28164 | as the default reference quantity; this is the value used in acoustics | ||
| 28165 | which is where decibels are commonly encountered. This default can be | ||
| 28166 | changed by changing the value of the customizable variable | ||
| 28167 | @code{calc-logunits-field-reference} (@pxref{Customizing Calc}). A | ||
| 28168 | non-default reference quantity will be read from the stack if the | ||
| 28169 | capital @kbd{O} prefix is used. | ||
| 28170 | 28138 | ||
| 28171 | The decibel level of a power | 28139 | The decibel level of a power |
| 28172 | @infoline @math{P1}, | 28140 | @infoline @math{P1}, |
| @@ -28214,6 +28182,20 @@ relative to a reference | |||
| 28214 | is defined as | 28182 | is defined as |
| 28215 | @infoline @math{20 log10(F1/F0) dB}. | 28183 | @infoline @math{20 log10(F1/F0) dB}. |
| 28216 | @texline @math{20 \log_{10}(F_{1}/F_{0}) {\rm dB}}. | 28184 | @texline @math{20 \log_{10}(F_{1}/F_{0}) {\rm dB}}. |
| 28185 | For example, the decibel value of a sound pressure level of | ||
| 28186 | @infoline @math{60 uPa} | ||
| 28187 | @texline @math{60 \mu{\rm Pa}} | ||
| 28188 | relative to | ||
| 28189 | @infoline @math{20 uPa} | ||
| 28190 | @texline @math{20 \mu{\rm Pa}} | ||
| 28191 | (the threshhold of human hearing) is | ||
| 28192 | @infoline @math{20 log10(60 uPa/ 20 uPa) dB = 20 log10(3) dB}, | ||
| 28193 | @texline @math{20 \log_{10}(60 \mu{\rm Pa}/20 \mu{\rm Pa}) {\rm dB} = 20 \log_{10}(3) {\rm dB}}, | ||
| 28194 | which is about | ||
| 28195 | @infoline @math{9.54 dB}. | ||
| 28196 | @texline @math{9.54 {\rm dB}}. | ||
| 28197 | Note that in taking the ratio, the original units cancel and so these | ||
| 28198 | logarithmic units are dimensionless. | ||
| 28217 | 28199 | ||
| 28218 | Nepers (named after John Napier, who is credited with inventing the | 28200 | Nepers (named after John Napier, who is credited with inventing the |
| 28219 | logarithm) are similar to bels except they use natural logarithms instead | 28201 | logarithm) are similar to bels except they use natural logarithms instead |
| @@ -28236,55 +28218,72 @@ is | |||
| 28236 | @infoline @math{ln(F1/F0) Np}. | 28218 | @infoline @math{ln(F1/F0) Np}. |
| 28237 | @texline @math{\ln(F_1/F_0) {\rm Np}}. | 28219 | @texline @math{\ln(F_1/F_0) {\rm Np}}. |
| 28238 | 28220 | ||
| 28221 | @vindex calc-lu-power-reference | ||
| 28222 | @vindex calc-lu-field-reference | ||
| 28223 | For power quantities, Calc uses | ||
| 28224 | @infoline @math{1 mW} | ||
| 28225 | @texline @math{1 {\rm mW}} | ||
| 28226 | as the default reference quantity; this default can be changed by changing | ||
| 28227 | the value of the customizable variable | ||
| 28228 | @code{calc-lu-power-reference} (@pxref{Customizing Calc}). | ||
| 28229 | For field quantities, Calc uses | ||
| 28230 | @infoline @math{20 uPa} | ||
| 28231 | @texline @math{20 \mu{\rm Pa}} | ||
| 28232 | as the default reference quantity; this is the value used in acoustics | ||
| 28233 | which is where decibels are commonly encountered. This default can be | ||
| 28234 | changed by changing the value of the customizable variable | ||
| 28235 | @code{calc-lu-field-reference} (@pxref{Customizing Calc}). A | ||
| 28236 | non-default reference quantity will be read from the stack if the | ||
| 28237 | capital @kbd{O} prefix is used. | ||
| 28238 | |||
| 28239 | @kindex l q | 28239 | @kindex l q |
| 28240 | @pindex calc-logunits-quantity | 28240 | @pindex calc-lu-quant |
| 28241 | @tindex powerquant | 28241 | @tindex lupquant |
| 28242 | @tindex fieldquant | 28242 | @tindex lufquant |
| 28243 | The @kbd{l q} (@code{calc-logunits-quantity}) [@code{powerquant}] | 28243 | The @kbd{l q} (@code{calc-lu-quant}) [@code{lupquant}] |
| 28244 | command computes the power quantity corresponding to a given number of | 28244 | command computes the power quantity corresponding to a given number of |
| 28245 | logarithmic units. With the capital @kbd{O} prefix, @kbd{O l q}, the | 28245 | logarithmic units. With the capital @kbd{O} prefix, @kbd{O l q}, the |
| 28246 | reference level will be read from the top of the stack. (In an | 28246 | reference level will be read from the top of the stack. (In an |
| 28247 | algebraic formula, @code{powerquant} can be given an optional second | 28247 | algebraic formula, @code{lupquant} can be given an optional second |
| 28248 | argument which will be used for the reference level.) For example, | 28248 | argument which will be used for the reference level.) For example, |
| 28249 | @code{20 dB @key{RET} l q} will return @code{100 mW}; | 28249 | @code{20 dB @key{RET} l q} will return @code{100 mW}; |
| 28250 | @code{20 dB @key{RET} 4 W @key{RET} O l q} will return @code{400 W}. | 28250 | @code{20 dB @key{RET} 4 W @key{RET} O l q} will return @code{400 W}. |
| 28251 | The @kbd{H l q} [@code{fieldquant}] command behaves like @kbd{l q} but | 28251 | The @kbd{H l q} [@code{lufquant}] command behaves like @kbd{l q} but |
| 28252 | computes field quantities instead of power quantities. | 28252 | computes field quantities instead of power quantities. |
| 28253 | 28253 | ||
| 28254 | @kindex l d | 28254 | @kindex l d |
| 28255 | @pindex calc-dblevel | 28255 | @pindex calc-db |
| 28256 | @tindex dbpowerlevel | 28256 | @tindex dbpower |
| 28257 | @tindex dbfieldlevel | 28257 | @tindex dbfield |
| 28258 | @kindex l n | 28258 | @kindex l n |
| 28259 | @pindex calc-nplevel | 28259 | @pindex calc-np |
| 28260 | @tindex nppowerlevel | 28260 | @tindex nppower |
| 28261 | @tindex npfieldlevel | 28261 | @tindex npfield |
| 28262 | The @kbd{l d} (@code{calc-dblevel}) [@code{dbpowerlevel}] | 28262 | The @kbd{l d} (@code{calc-db}) [@code{dbpower}] command will compute |
| 28263 | command will compute the decibel level of a power quantity using the | 28263 | the decibel level of a power quantity using the default reference |
| 28264 | default reference level; @kbd{H l d} [@code{dbfieldlevel}] will | 28264 | level; @kbd{H l d} [@code{dbfield}] will compute the decibel level of |
| 28265 | compute the decibel level of a field quantity. The commands @kbd{l n} | 28265 | a field quantity. The commands @kbd{l n} (@code{calc-np}) |
| 28266 | (@code{calc-nplevel}) [@code{nppowerlevel}] and @kbd{H l n} | 28266 | [@code{nppower}] and @kbd{H l n} [@code{npfield}] will similarly |
| 28267 | [@code{npfieldlevel}] will similarly compute neper levels. With the | 28267 | compute neper levels. With the capital @kbd{O} prefix these commands |
| 28268 | capital @kbd{O} prefix these commands will read a reference level | 28268 | will read a reference level from the stack; in an algebraic formula |
| 28269 | from the stack; in an algebraic formula the reference level can be | 28269 | the reference level can be given as an optional second argument. |
| 28270 | given as an optional second argument. | ||
| 28271 | 28270 | ||
| 28272 | @kindex l + | 28271 | @kindex l + |
| 28273 | @pindex calc-logunits-add | 28272 | @pindex calc-lu-plus |
| 28274 | @tindex lupoweradd | 28273 | @tindex lupadd |
| 28275 | @tindex lufieldadd | 28274 | @tindex lufadd |
| 28276 | @kindex l - | 28275 | @kindex l - |
| 28277 | @pindex calc-logunits-sub | 28276 | @pindex calc-lu-minus |
| 28278 | @tindex lupowersub | 28277 | @tindex lupsub |
| 28279 | @tindex lufieldsub | 28278 | @tindex lufsub |
| 28280 | @kindex l * | 28279 | @kindex l * |
| 28281 | @pindex calc-logunits-mul | 28280 | @pindex calc-lu-times |
| 28282 | @tindex lupowermul | 28281 | @tindex lupmul |
| 28283 | @tindex lufieldmul | 28282 | @tindex lufmul |
| 28284 | @kindex l / | 28283 | @kindex l / |
| 28285 | @pindex calc-logunits-div | 28284 | @pindex calc-lu-divide |
| 28286 | @tindex lupowerdiv | 28285 | @tindex lupdiv |
| 28287 | @tindex lufielddiv | 28286 | @tindex lufdiv |
| 28288 | The sum of two power or field quantities doesn't correspond to the sum | 28287 | The sum of two power or field quantities doesn't correspond to the sum |
| 28289 | of the corresponding decibel or neper levels. If the powers | 28288 | of the corresponding decibel or neper levels. If the powers |
| 28290 | corresponding to decibel levels | 28289 | corresponding to decibel levels |
| @@ -28305,13 +28304,13 @@ $$ 10 \log_{10}(10^{D_1/10} + 10^{D_2/10}) {\rm dB}.$$ | |||
| 28305 | @end tex | 28304 | @end tex |
| 28306 | 28305 | ||
| 28307 | @noindent | 28306 | @noindent |
| 28308 | When field quantities are combined, it often means the | 28307 | When field quantities are combined, it often means the corresponding |
| 28309 | corresponding powers are added and so the above formula might be used. | 28308 | powers are added and so the above formula might be used. In |
| 28310 | In acoustics, for example, the decibel sound pressure level is defined | 28309 | acoustics, for example, the sound pressure level is a field quantity |
| 28311 | using the field formula but the sound pressure levels are combined | 28310 | and so the decibels are often defined using the field formula, but the |
| 28312 | as the sound power levels, and so the above formula should be used. If | 28311 | sound pressure levels are combined as the sound power levels, and so |
| 28313 | two field quantities themselves are added, the new decibel level will be | 28312 | the above formula should be used. If two field quantities themselves |
| 28314 | 28313 | are added, the new decibel level will be | |
| 28315 | 28314 | ||
| 28316 | @ifnottex | 28315 | @ifnottex |
| 28317 | @example | 28316 | @example |
| @@ -28349,20 +28348,18 @@ $$ D + 20 \log_{10}(N) {\rm dB}.$$ | |||
| 28349 | @end tex | 28348 | @end tex |
| 28350 | 28349 | ||
| 28351 | @noindent | 28350 | @noindent |
| 28352 | There are similar formulas for combining nepers. | 28351 | There are similar formulas for combining nepers. The @kbd{l +} |
| 28353 | The @kbd{l +} (@code{calc-logunits-add}) [@code{lupoweradd}] command | 28352 | (@code{calc-lu-plus}) [@code{lupadd}] command will ``add'' two |
| 28354 | will ``add'' two logarithmic unit power levels this way; with the | 28353 | logarithmic unit power levels this way; with the @kbd{H} prefix, |
| 28355 | @kbd{H} prefix, @kbd{H l +} [@code{lufieldadd}] will add logarithmic | 28354 | @kbd{H l +} [@code{lufadd}] will add logarithmic unit field levels. |
| 28356 | unit field levels. Similarly, logarithmic units can be | 28355 | Similarly, logarithmic units can be ``subtracted'' with @kbd{l -} |
| 28357 | ``subtracted'' with @kbd{l -} (@code{calc-logunits-sub}) | 28356 | (@code{calc-lu-minus}) [@code{lupsub}] or @kbd{H l -} [@code{lufsub}]. |
| 28358 | [@code{lupowersub}] or @kbd{H l -} [@code{lufieldsub}]. | 28357 | The @kbd{l *} (@code{calc-lu-times}) [@code{lupmul}] and @kbd{H l *} |
| 28359 | The @kbd{l *} (@code{calc-logunits-mul}) [@code{lupowermul}] | 28358 | [@code{lufmul}] commands will ``multiply'' a logarithmic unit by a |
| 28360 | and @kbd{H l *} [@code{lufieldmul}] commands will ``multiply'' | 28359 | number; the @kbd{l /} (@code{calc-lu-divide}) [@code{lupdiv}] and |
| 28361 | a logarithmic unit by a number; the @kbd{l /} | 28360 | @kbd{H l /} [@code{lufdiv}] commands will ``divide'' a logarithmic |
| 28362 | (@code{calc-logunits-divide}) [@code{lupowerdiv}] and | 28361 | unit by a number. Note that the reference quantities don't play a role |
| 28363 | @kbd{H l /} [@code{lufielddiv}] commands will ``divide'' a | 28362 | in this arithmetic. |
| 28364 | logarithmic unit by a number. Note that the reference quantities don't | ||
| 28365 | play a role in this arithmetic. | ||
| 28366 | 28363 | ||
| 28367 | @node Musical Notes, , Logarithmic Units, Units | 28364 | @node Musical Notes, , Logarithmic Units, Units |
| 28368 | @section Musical Notes | 28365 | @section Musical Notes |
| @@ -35539,16 +35536,16 @@ should also be added to @code{calc-embedded-announce-formula-alist} | |||
| 35539 | and @code{calc-embedded-open-close-plain-alist}. | 35536 | and @code{calc-embedded-open-close-plain-alist}. |
| 35540 | @end defvar | 35537 | @end defvar |
| 35541 | 35538 | ||
| 35542 | @defvar calc-logunits-power-reference | 35539 | @defvar calc-lu-power-reference |
| 35543 | @defvarx calc-logunits-field-reference | 35540 | @defvarx calc-lu-field-reference |
| 35544 | See @ref{Logarithmic Units}.@* | 35541 | See @ref{Logarithmic Units}.@* |
| 35545 | The variables @code{calc-logunits-power-reference} and | 35542 | The variables @code{calc-lu-power-reference} and |
| 35546 | @code{calc-logunits-field-reference} are unit expressions (written as | 35543 | @code{calc-lu-field-reference} are unit expressions (written as |
| 35547 | strings) which Calc will use as reference quantities for logarithmic | 35544 | strings) which Calc will use as reference quantities for logarithmic |
| 35548 | units. | 35545 | units. |
| 35549 | 35546 | ||
| 35550 | The default value of @code{calc-logunits-power-reference} is @code{"mW"} | 35547 | The default value of @code{calc-lu-power-reference} is @code{"mW"} |
| 35551 | and the default value of @code{calc-logunits-field-reference} is | 35548 | and the default value of @code{calc-lu-field-reference} is |
| 35552 | @code{"20 uPa"}. | 35549 | @code{"20 uPa"}. |
| 35553 | @end defvar | 35550 | @end defvar |
| 35554 | 35551 | ||
| @@ -36209,26 +36206,26 @@ keystrokes are not listed in this summary. | |||
| 36209 | @r{ v x@: I k T @: @: @:ltpt@:(x,v)} | 36206 | @r{ v x@: I k T @: @: @:ltpt@:(x,v)} |
| 36210 | 36207 | ||
| 36211 | @c | 36208 | @c |
| 36212 | @r{ a b@: l + @: @: @:lupoweradd@:(a,b)} | 36209 | @r{ a b@: l + @: @: @:lupadd@:(a,b)} |
| 36213 | @r{ a b@: H l + @: @: @:lufieldadd@:(a,b)} | 36210 | @r{ a b@: H l + @: @: @:lufadd@:(a,b)} |
| 36214 | @r{ a b@: l - @: @: @:lupowersub@:(a,b)} | 36211 | @r{ a b@: l - @: @: @:lupsub@:(a,b)} |
| 36215 | @r{ a b@: H l - @: @: @:lufieldsub@:(a,b)} | 36212 | @r{ a b@: H l - @: @: @:lufsub@:(a,b)} |
| 36216 | @r{ a b@: l * @: @: @:lupowermul@:(a,b)} | 36213 | @r{ a b@: l * @: @: @:lupmul@:(a,b)} |
| 36217 | @r{ a b@: H l * @: @: @:lufieldmul@:(a,b)} | 36214 | @r{ a b@: H l * @: @: @:lufmul@:(a,b)} |
| 36218 | @r{ a b@: l / @: @: @:lupowerdiv@:(a,b)} | 36215 | @r{ a b@: l / @: @: @:lupdiv@:(a,b)} |
| 36219 | @r{ a b@: H l / @: @: @:lufielddiv@:(a,b)} | 36216 | @r{ a b@: H l / @: @: @:lufdiv@:(a,b)} |
| 36220 | @r{ a@: l d @: @: @:dbpowerlevel@:(a)} | 36217 | @r{ a@: l d @: @: @:dbpower@:(a)} |
| 36221 | @r{ a b@: O l d @: @: @:dbpowerlevel@:(a,b)} | 36218 | @r{ a b@: O l d @: @: @:dbpower@:(a,b)} |
| 36222 | @r{ a@: H l d @: @: @:dbfieldlevel@:(a)} | 36219 | @r{ a@: H l d @: @: @:dbfield@:(a)} |
| 36223 | @r{ a b@: O H l d @: @: @:dbfieldlevel@:(a,b)} | 36220 | @r{ a b@: O H l d @: @: @:dbfield@:(a,b)} |
| 36224 | @r{ a@: l n @: @: @:nppowerlevel@:(a)} | 36221 | @r{ a@: l n @: @: @:nppower@:(a)} |
| 36225 | @r{ a b@: O l n @: @: @:nppowerlevel@:(a,b)} | 36222 | @r{ a b@: O l n @: @: @:nppower@:(a,b)} |
| 36226 | @r{ a@: H l n @: @: @:npfieldlevel@:(a)} | 36223 | @r{ a@: H l n @: @: @:npfield@:(a)} |
| 36227 | @r{ a b@: O H l n @: @: @:npfieldlevel@:(a,b)} | 36224 | @r{ a b@: O H l n @: @: @:npfield@:(a,b)} |
| 36228 | @r{ a@: l q @: @: @:powerquant@:(a)} | 36225 | @r{ a@: l q @: @: @:lupquant@:(a)} |
| 36229 | @r{ a b@: O l q @: @: @:powerquant@:(a,b)} | 36226 | @r{ a b@: O l q @: @: @:lupquant@:(a,b)} |
| 36230 | @r{ a@: H l q @: @: @:fieldquant@:(a)} | 36227 | @r{ a@: H l q @: @: @:lufquant@:(a)} |
| 36231 | @r{ a b@: O H l q @: @: @:fieldquant@:(a,b)} | 36228 | @r{ a b@: O H l q @: @: @:lufquant@:(a,b)} |
| 36232 | @r{ a@: l s @: @: @:spn@:(a)} | 36229 | @r{ a@: l s @: @: @:spn@:(a)} |
| 36233 | @r{ a@: l m @: @: @:midi@:(a)} | 36230 | @r{ a@: l m @: @: @:midi@:(a)} |
| 36234 | @r{ a@: l f @: @: @:freq@:(a)} | 36231 | @r{ a@: l f @: @: @:freq@:(a)} |