Prev Next db10

Conversion to dB (decibels) in 10*log10 Form
Syntax y = db10(x)
Include: include spt\db10.oms
See Also

ARGUMENTS:
   INPUTS:
     x = MATRIX, any numerical type
   RETURN: MATRIX, 10*log10(x), type DOUBLE

Description

Returns the element-by-element value of ten times the log base ten of the input matrix. Any numerical type may be input. INTEGER, REAL, and DOUBLE type are coerced to DOUBLE for internal processing. COMPLEX types are converted to their ABSOLUTE VALUE before local processing. Type returned is always DOUBLE.

This function is appropriate for quantities that may be interpreted as power (or, the square of some fundamental quantity). Power quantities are always non-negative, so this function will produce an error if negative values INTEGER, REAL, or DOUBLE data are input. For values that are less than or equal to zero (including negative), a decibel value corresponding to the DOUBLE_EPSILON is returned.

Example

For vectors:

O>x={-3, 0 ,1, 2, 10d0}
O>db10(x)
{
-156.536
-156.536
0
3.0103
10
}

For complex values:

O>db10(3d0 + 4i0)
6.9897 

For matirces:

O>A = {[-10, 4],[0, 8]}
O>db10(A)
{
[ -156.536 , 6.0206 ]
[ -156.536 , 9.0309 ]
}