Conversion from linear to logarithmic representation.
Loading LOADSUB ALL FROM "TOLOG.HTS"
or LOADSUB FROM "MATHLIB.HTS"
or LOADSUB Tolog FROM "MATHLIB.HTS"
Usage REAL A(*),B(*),X
CALL Tolog(A(*),X,B(*))
Description
Tologconverts the data in the arrayAinto logarithmic representation and returns the results in the arrayB. The factorxis used to scale the data in the arrayAafter it is converted; each point inAis multiplied byxafter conversion is done.Tologis usually used to convert data to decibel representation.Tologis equivalent to the following BASIC lines
INTEGER I
FOR I=1 TO size(A)
B(I)=LOG(A(I))*X
NEXT I
wheresize(A)is the number of elements in the arrayA. In most cases,xis either 10 or 20.
Errors
Tologcauses an HTBasic error if its arguments are not all of type REAL or ifAandBdo not have the same number of elements.