Programmer Guide/Command Reference/EVAL/log2lin: Difference between revisions

From STX Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
=====log2lin=====
Logarithmic to linear conversion where <var>x</var> -> <var>ref</var> * 10 ^ (<var>x</var> / <var>fac</var>)
=====Usage:=====
<code>log2lin(<var>x</var>, <var>ref</var>, <var>fac</var>)</code>
=====Parameters:=====
;<var>ref</var>
:Default is <code>1</code>.
;<var>fac</var>
:Default is <code>20</code>.
{{DISPLAYTITLE:lin2log, log2lin}}
{{DISPLAYTITLE:lin2log, log2lin}}
Convert the elements of ''x'' to logarithmic values (e.g. dB) and vice versa.
Convert the elements of ''x'' to logarithmic values (e.g. dB) and vice versa.

Revision as of 15:34, 6 April 2011

Convert the elements of x to logarithmic values (e.g. dB) and vice versa.

Usage
lin2log(x {, ref {, fac}})
log2lin(x {, ref {, fac}})
x
a scalar, vector or matrix
ref
the reference value; must be a positive number (default=1)
fac
the factor; must be a positive number (default=20)
Result
The result r has the same type as x and contains the converted elements of x
  • lin2log: ri,j = fac * log10(xi,j / ref)
  • log2lin: ri,j = ref * 10 ^ (xi,j / fac)
See also
log, exp

Example:

#a := eval 20*log(2)     // convert factor 2 to 6dB
#b := eval 20*log(2,10)  // same as above
#c := eval 20*log(vv(2,10,20,50,100))
// $#c = { 6.02, 20, 26.02, 33.98, 40 }

<function list>

Navigation menu

Personal tools