diff options
| author | Jay Belanger | 2011-02-06 19:35:09 -0600 |
|---|---|---|
| committer | Jay Belanger | 2011-02-06 19:35:09 -0600 |
| commit | 2e78df6b3d1f08c9af131dd79ccc0ead0021ed47 (patch) | |
| tree | 61f0d56798bae2d448ae5681880efffac2956d70 | |
| parent | a7e979a44ee01dcca3e5081fe672427395494aa0 (diff) | |
| download | emacs-2e78df6b3d1f08c9af131dd79ccc0ead0021ed47.tar.gz emacs-2e78df6b3d1f08c9af131dd79ccc0ead0021ed47.zip | |
calc.texi (Logarithmic Units): New section
| -rw-r--r-- | doc/misc/ChangeLog | 4 | ||||
| -rw-r--r-- | doc/misc/calc.texi | 281 |
2 files changed, 284 insertions, 1 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 33772e988d7..51038726130 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2011-02-07 Jay Belanger <jay.p.belanger@gmail.com> | ||
| 2 | |||
| 3 | * calc.texi (Logarithmic Units): New section. | ||
| 4 | |||
| 1 | 2011-02-05 Teodor Zlatanov <tzz@lifelogs.com> | 5 | 2011-02-05 Teodor Zlatanov <tzz@lifelogs.com> |
| 2 | 6 | ||
| 3 | * gnus-overrides.texi: Renamed from overrides.texi and all the relevant | 7 | * gnus-overrides.texi: Renamed from overrides.texi and all the relevant |
diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi index 755956a2999..edb3289aee2 100644 --- a/doc/misc/calc.texi +++ b/doc/misc/calc.texi | |||
| @@ -27675,6 +27675,7 @@ begin with the @kbd{u} prefix key. | |||
| 27675 | * The Units Table:: | 27675 | * The Units Table:: |
| 27676 | * Predefined Units:: | 27676 | * Predefined Units:: |
| 27677 | * User-Defined Units:: | 27677 | * User-Defined Units:: |
| 27678 | * Logarithmic Units:: | ||
| 27678 | @end menu | 27679 | @end menu |
| 27679 | 27680 | ||
| 27680 | @node Basic Operations on Units, The Units Table, Units, Units | 27681 | @node Basic Operations on Units, The Units Table, Units, Units |
| @@ -28036,7 +28037,7 @@ really is unitless.) | |||
| 28036 | 28037 | ||
| 28037 | @c Describe angular units, luminosity vs. steradians problem. | 28038 | @c Describe angular units, luminosity vs. steradians problem. |
| 28038 | 28039 | ||
| 28039 | @node User-Defined Units, , Predefined Units, Units | 28040 | @node User-Defined Units, Logarithmic Units, Predefined Units, Units |
| 28040 | @section User-Defined Units | 28041 | @section User-Defined Units |
| 28041 | 28042 | ||
| 28042 | @noindent | 28043 | @noindent |
| @@ -28120,6 +28121,249 @@ was already a set of user-defined units in your Calc init file, it | |||
| 28120 | is replaced by the new set. (@xref{General Mode Commands}, for a way to | 28121 | is replaced by the new set. (@xref{General Mode Commands}, for a way to |
| 28121 | tell Calc to use a different file for the Calc init file.) | 28122 | tell Calc to use a different file for the Calc init file.) |
| 28122 | 28123 | ||
| 28124 | @node Logarithmic Units, , User-Defined Units, Units | ||
| 28125 | @section Logarithmic Units | ||
| 28126 | |||
| 28127 | The units @code{dB} (decibels) and @code{Np} (nepers) are logarithmic | ||
| 28128 | units which are typically manipulated differently than standard units. | ||
| 28129 | Calc provides commands to work with these logarithmic units. | ||
| 28130 | |||
| 28131 | Decibels and nepers are used to measure power quantities as well as | ||
| 28132 | field quantities (quantities whose squares are proportional to power). | ||
| 28133 | The decibel and neper values of a quantity are relative to | ||
| 28134 | a reference quantity; for example, the decibel value of a sound | ||
| 28135 | pressure level of | ||
| 28136 | @infoline @math{60 uPa} | ||
| 28137 | @texline @math{60 \mu{\rm Pa}} | ||
| 28138 | relative to | ||
| 28139 | @infoline @math{20 uPa} | ||
| 28140 | @texline @math{20 \mu{\rm Pa}} | ||
| 28141 | (the threshhold of human hearing) is | ||
| 28142 | @infoline @math{20 log10(60 uPa/ 20 uPa) dB = 20 log10(3) dB}, | ||
| 28143 | @texline @math{20 \log_{10}(60 \mu{\rm Pa}/20 \mu{\rm Pa}) {\rm dB} = | ||
| 28144 | 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 | |||
| 28171 | The decibel level of a power | ||
| 28172 | @infoline @math{P1}, | ||
| 28173 | @texline @math{P_1}, | ||
| 28174 | relative to a reference power | ||
| 28175 | @infoline @math{P0}, | ||
| 28176 | @texline @math{P_0}, | ||
| 28177 | is defined to be | ||
| 28178 | @infoline @math{10 log10(P1/P0) dB}. | ||
| 28179 | @texline @math{10 \log_{10}(P_{1}/P_{0}) {\rm dB}}. | ||
| 28180 | (The factor of 10 is because a decibel, as its name implies, is | ||
| 28181 | one-tenth of a bel. The bel, named after Alexander Graham Bell, was | ||
| 28182 | considered to be too large of a unit and was effectively replaced by | ||
| 28183 | the decibel.) If @math{F} is a field quantity with power | ||
| 28184 | @math{P=k F^2}, then a reference quantity of | ||
| 28185 | @infoline @math{F0} | ||
| 28186 | @texline @math{F_0} | ||
| 28187 | would correspond to a power of | ||
| 28188 | @infoline @math{P0=k F0^2}. | ||
| 28189 | @texline @math{P_{0}=kF_{0}^2}. | ||
| 28190 | If | ||
| 28191 | @infoline @math{P1=k F1^2}, | ||
| 28192 | @texline @math{P_{1}=kF_{1}^2}, | ||
| 28193 | then | ||
| 28194 | |||
| 28195 | @ifnottex | ||
| 28196 | @example | ||
| 28197 | 10 log10(P1/P0) = 10 log10(F1^2/F0^2) = 20 log10(F1/F0). | ||
| 28198 | @end example | ||
| 28199 | @end ifnottex | ||
| 28200 | @tex | ||
| 28201 | $$ 10 \log_{10}(P_1/P_0) = 10 \log_{10}(F_1^2/F_0^2) = 20 | ||
| 28202 | \log_{10}(F_1/F_0)$$ | ||
| 28203 | @end tex | ||
| 28204 | |||
| 28205 | @noindent | ||
| 28206 | In order to get the same decibel level regardless of whether a field | ||
| 28207 | quantity or the corresponding power quantity is used, the decibel | ||
| 28208 | level of a field quantity | ||
| 28209 | @infoline @math{F1}, | ||
| 28210 | @texline @math{F_1}, | ||
| 28211 | relative to a reference | ||
| 28212 | @infoline @math{F0}, | ||
| 28213 | @texline @math{F_0}, | ||
| 28214 | is defined as | ||
| 28215 | @infoline @math{20 log10(F1/F0) dB}. | ||
| 28216 | @texline @math{20 \log_{10}(F_{1}/F_{0}) {\rm dB}}. | ||
| 28217 | |||
| 28218 | Nepers (named after John Napier, who is credited with inventing the | ||
| 28219 | logarithm) are similar to bels except they use natural logarithms instead | ||
| 28220 | of common logarithms. The neper level of a power | ||
| 28221 | @infoline @math{P1}, | ||
| 28222 | @texline @math{P_1}, | ||
| 28223 | relative to a reference power | ||
| 28224 | @infoline @math{P0}, | ||
| 28225 | @texline @math{P_0}, | ||
| 28226 | is | ||
| 28227 | @infoline @math{(1/2) ln(P1/P0) Np}. | ||
| 28228 | @texline @math{(1/2) \ln(P_1/P_0) {\rm Np}}. | ||
| 28229 | The neper level of a field | ||
| 28230 | @infoline @math{F1}, | ||
| 28231 | @texline @math{F_1}, | ||
| 28232 | relative to a reference field | ||
| 28233 | @infoline @math{F0}, | ||
| 28234 | @texline @math{F_0}, | ||
| 28235 | is | ||
| 28236 | @infoline @math{ln(F1/F0) Np}. | ||
| 28237 | @texline @math{\ln(F_1/F_0) {\rm Np}}. | ||
| 28238 | |||
| 28239 | @kindex l q | ||
| 28240 | @pindex calc-logunits-quantity | ||
| 28241 | @tindex powerquant | ||
| 28242 | @tindex fieldquant | ||
| 28243 | The @kbd{l q} (@code{calc-logunits-quantity}) [@code{powerquant}] | ||
| 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 | ||
| 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 | ||
| 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}; | ||
| 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 | ||
| 28252 | computes field quantities instead of power quantities. | ||
| 28253 | |||
| 28254 | @kindex l d | ||
| 28255 | @pindex calc-logunits-dblevel | ||
| 28256 | @tindex dbpowerlevel | ||
| 28257 | @tindex dbfieldlevel | ||
| 28258 | @kindex l n | ||
| 28259 | @pindex calc-logunits-nplevel | ||
| 28260 | @tindex nppowerlevel | ||
| 28261 | @tindex npfieldlevel | ||
| 28262 | The @kbd{l d} (@code{calc-logunits-dblevel}) [@code{dbpowerlevel}] | ||
| 28263 | command will compute the decibel level of a power quantity using the | ||
| 28264 | default reference level; @kbd{H l d} [@code{dbfieldlevel}] will | ||
| 28265 | compute the decibel level of a field quantity. The commands @kbd{l n} | ||
| 28266 | (@code{calc-logunits-nplevel}) [@code{nppowerlevel}] and @kbd{H l n} | ||
| 28267 | [@code{npfieldlevel}] will similarly compute neper levels. With the | ||
| 28268 | capital @kbd{O} prefix these commands will read a reference level | ||
| 28269 | from the stack; in an algebraic formula the reference level can be | ||
| 28270 | given as an optional second argument. | ||
| 28271 | |||
| 28272 | @kindex l + | ||
| 28273 | @pindex calc-logunits-add | ||
| 28274 | @tindex lupoweradd | ||
| 28275 | @tindex lufieldadd | ||
| 28276 | @kindex l - | ||
| 28277 | @pindex calc-logunits-sub | ||
| 28278 | @tindex lupowersub | ||
| 28279 | @tindex lufieldsub | ||
| 28280 | @kindex l * | ||
| 28281 | @pindex calc-logunits-mul | ||
| 28282 | @tindex lupowermul | ||
| 28283 | @tindex lufieldmul | ||
| 28284 | @kindex l / | ||
| 28285 | @pindex calc-logunits-div | ||
| 28286 | @tindex lupowerdiv | ||
| 28287 | @tindex lufielddiv | ||
| 28288 | 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 | ||
| 28290 | corresponding to decibel levels | ||
| 28291 | @infoline @math{D1} | ||
| 28292 | @texline @math{D_1} | ||
| 28293 | and | ||
| 28294 | @infoline @math{D2} | ||
| 28295 | @texline @math{D_2} | ||
| 28296 | are added, the corresponding decibel level ``sum'' will be | ||
| 28297 | |||
| 28298 | @ifnottex | ||
| 28299 | @example | ||
| 28300 | 10 log10(10^(D1/10) + 10^(D2/10)) dB. | ||
| 28301 | @end example | ||
| 28302 | @end ifnottex | ||
| 28303 | @tex | ||
| 28304 | $$ 10 \log_{10}(10^{D_1/10} + 10^{D_2/10}) {\rm dB}.$$ | ||
| 28305 | @end tex | ||
| 28306 | |||
| 28307 | @noindent | ||
| 28308 | When field quantities are combined, it often means the | ||
| 28309 | corresponding powers are added and so the above formula might be used. | ||
| 28310 | In acoustics, for example, the decibel sound pressure level is defined | ||
| 28311 | using the field formula but the sound pressure levels are combined | ||
| 28312 | as the sound power levels, and so the above formula should be used. If | ||
| 28313 | two field quantities themselves are added, the new decibel level will be | ||
| 28314 | |||
| 28315 | |||
| 28316 | @ifnottex | ||
| 28317 | @example | ||
| 28318 | 20 log10(10^(D1/20) + 10^(D2/20)) dB. | ||
| 28319 | @end example | ||
| 28320 | @end ifnottex | ||
| 28321 | @tex | ||
| 28322 | $$ 20 \log_{10}(10^{D_1/20} + 10^{D_2/20}) {\rm dB}.$$ | ||
| 28323 | @end tex | ||
| 28324 | |||
| 28325 | @noindent | ||
| 28326 | If the power corresponding to @math{D} dB is multiplied by a number @math{N}, | ||
| 28327 | then the corresponding decibel level will be | ||
| 28328 | |||
| 28329 | @ifnottex | ||
| 28330 | @example | ||
| 28331 | D + 10 log10(N) dB, | ||
| 28332 | @end example | ||
| 28333 | @end ifnottex | ||
| 28334 | @tex | ||
| 28335 | $$ D + 10 \log_{10}(N) {\rm dB},$$ | ||
| 28336 | @end tex | ||
| 28337 | |||
| 28338 | @noindent | ||
| 28339 | if a field quantity is multiplied by @math{N} the corresponding decibel level | ||
| 28340 | will be | ||
| 28341 | |||
| 28342 | @ifnottex | ||
| 28343 | @example | ||
| 28344 | D + 20 log10(N) dB. | ||
| 28345 | @end example | ||
| 28346 | @end ifnottex | ||
| 28347 | @tex | ||
| 28348 | $$ D + 20 \log_{10}(N) {\rm dB}.$$ | ||
| 28349 | @end tex | ||
| 28350 | |||
| 28351 | @noindent | ||
| 28352 | There are similar formulas for combining nepers. | ||
| 28353 | The @kbd{l +} (@code{calc-logunits-add}) [@code{lupoweradd}] command | ||
| 28354 | will ``add'' two logarithmic unit power levels this way; with the | ||
| 28355 | @kbd{H} prefix, @kbd{H l +} [@code{lufieldadd}] will add logarithmic | ||
| 28356 | unit field levels. Similarly, logarithmic units can be | ||
| 28357 | ``subtracted'' with @kbd{l -} (@code{calc-logunits-sub}) | ||
| 28358 | [@code{lupowersub}] or @kbd{H l -} [@code{lufieldsub}]. | ||
| 28359 | The @kbd{l *} (@code{calc-logunits-mul}) [@code{lupowermul}] | ||
| 28360 | and @kbd{H l *} [@code{lufieldmul}] commands will ``multiply'' | ||
| 28361 | a logarithmic unit by a number; the @kbd{l /} | ||
| 28362 | (@code{calc-logunits-divide}) [@code{lupowerdiv}] and | ||
| 28363 | @kbd{H l /} [@code{lufielddiv}] commands will ``divide'' a | ||
| 28364 | logarithmic unit by a number. Note that the reference quantities don't | ||
| 28365 | play a role in this arithmetic. | ||
| 28366 | |||
| 28123 | @node Store and Recall, Graphics, Units, Top | 28367 | @node Store and Recall, Graphics, Units, Top |
| 28124 | @chapter Storing and Recalling | 28368 | @chapter Storing and Recalling |
| 28125 | 28369 | ||
| @@ -35225,6 +35469,19 @@ should also be added to @code{calc-embedded-announce-formula-alist} | |||
| 35225 | and @code{calc-embedded-open-close-plain-alist}. | 35469 | and @code{calc-embedded-open-close-plain-alist}. |
| 35226 | @end defvar | 35470 | @end defvar |
| 35227 | 35471 | ||
| 35472 | @defvar calc-logunits-power-reference | ||
| 35473 | @defvarx calc-logunits-field-reference | ||
| 35474 | See @ref{Logarithmic Units}.@* | ||
| 35475 | The variables @code{calc-logunits-power-reference} and | ||
| 35476 | @code{calc-logunits-field-reference} are unit expressions (written as | ||
| 35477 | strings) which Calc will use as reference quantities for logarithmic | ||
| 35478 | units. | ||
| 35479 | |||
| 35480 | The default value of @code{calc-logunits-power-reference} is @code{"mW"} | ||
| 35481 | and the default value of @code{calc-logunits-field-reference} is | ||
| 35482 | @code{"20 uPa"}. | ||
| 35483 | @end defvar | ||
| 35484 | |||
| 35228 | @defvar calc-highlight-selections-with-faces | 35485 | @defvar calc-highlight-selections-with-faces |
| 35229 | @defvarx calc-selected-face | 35486 | @defvarx calc-selected-face |
| 35230 | @defvarx calc-nonselected-face | 35487 | @defvarx calc-nonselected-face |
| @@ -35873,6 +36130,28 @@ keystrokes are not listed in this summary. | |||
| 35873 | @r{ v x@: I k T @: @: @:ltpt@:(x,v)} | 36130 | @r{ v x@: I k T @: @: @:ltpt@:(x,v)} |
| 35874 | 36131 | ||
| 35875 | @c | 36132 | @c |
| 36133 | @r{ a b@: l + @: @: 2 @:lupoweradd@:(a,b)} | ||
| 36134 | @r{ a b@: H l + @: @: 2 @:lufieldadd@:(a,b)} | ||
| 36135 | @r{ a b@: l - @: @: 2 @:lupowersub@:(a,b)} | ||
| 36136 | @r{ a b@: H l - @: @: 2 @:lufieldsub@:(a,b)} | ||
| 36137 | @r{ a b@: l * @: @: 2 @:lupowermul@:(a,b)} | ||
| 36138 | @r{ a b@: H l * @: @: 2 @:lufieldmul@:(a,b)} | ||
| 36139 | @r{ a b@: l / @: @: 2 @:lupowerdiv@:(a,b)} | ||
| 36140 | @r{ a b@: H l / @: @: 2 @:lufielddiv@:(a,b)} | ||
| 36141 | @r{ a@: l d @: @: 1 @:dbpowerlevel@:(a)} | ||
| 36142 | @r{ a b@: O l d @: @: 2 @:dbpowerlevel@:(a,b)} | ||
| 36143 | @r{ a@: H l d @: @: 1 @:dbfieldlevel@:(a)} | ||
| 36144 | @r{ a b@: O H l d @: @: 2 @:dbfieldlevel@:(a,b)} | ||
| 36145 | @r{ a@: l n @: @: 1 @:nppowerlevel@:(a)} | ||
| 36146 | @r{ a b@: O l n @: @: 2 @:nppowerlevel@:(a,b)} | ||
| 36147 | @r{ a@: H l n @: @: 1 @:npfieldlevel@:(a)} | ||
| 36148 | @r{ a b@: O H l n @: @: 2 @:npfieldlevel@:(a,b)} | ||
| 36149 | @r{ a@: l q @: @: 1 @:powerquant@:(a)} | ||
| 36150 | @r{ a b@: O l q @: @: 2 @:powerquant@:(a,b)} | ||
| 36151 | @r{ a@: H l q @: @: 1 @:fieldquant@:(a)} | ||
| 36152 | @r{ a b@: O H l q @: @: 2 @:fieldquant@:(a,b)} | ||
| 36153 | |||
| 36154 | @c | ||
| 35876 | @r{ @: m a @: @: 12,13 @:calc-algebraic-mode@:} | 36155 | @r{ @: m a @: @: 12,13 @:calc-algebraic-mode@:} |
| 35877 | @r{ @: m d @: @: @:calc-degrees-mode@:} | 36156 | @r{ @: m d @: @: @:calc-degrees-mode@:} |
| 35878 | @r{ @: m e @: @: @:calc-embedded-preserve-modes@:} | 36157 | @r{ @: m e @: @: @:calc-embedded-preserve-modes@:} |