HTBasic Help
×
Menu
Index
Tolinear
Conversion from log to linear representation.
 
Loading        LOADSUB ALL FROM "TOLINEAR.HTS"
or LOADSUB FROM "MATHLIB.HTS"
or LOADSUB Tolinear FROM "MATHLIB.HTS"
 
Usage                REAL A(*),B(*),X
CALL Tolinear(A(*),X,B(*))
 
Description                
Tolinear converts the data in the array A into linear representation and returns the results in the array B. The factor x is used to scale the data in the array A before it is converted; each point in A is divided by x before conversion is done. Tolinear is usually used to convert data in decibel representation into linear form. Tolinear is equivalent to the following BASIC lines
 
INTEGER I
FOR I=1 TO size(A)
B(I)=10^(A(I)/X)
NEXT I
 
where size(A) is the number of elements in the array A. In most cases, x is either 10 or 20.
 
Errors                
Tolinear causes an HTBasic error if its arguments are not all of type REAL, if x is zero, or if A and B do not have the same number of elements.