HTBasic Help
×
Menu
Index

Advanced Math Functions

 

Advanced Math Library

The HTBasic Math Library is a collection of precompiled higher mathematical and signal processing functions that can be called from HTBasic programs to enhance execution speed and save users the trouble of writing them.
 

Higher mathematical functions

 

Statistics and data reduction

 

Signal processing

Fourier transforms and inverse Fourier transforms of both real and complex sequences.
Digital filtering, correlation, convolution, autocorrelation, and power spectral density of sequences of data.
Windowing using cosine, triangular, and Bessel windows.
Built-in waveforms.
 

Numerical analysis

Solutions to linear systems of equations having both real and complex coefficients.
Polynomial evaluation.
Numerical integration.
Roots of equations of the form f(x) = 0.
Derivatives and antiderivatives of polynomials.
 

Loading the Subroutines

The subroutines in the Advanced Math Library are grouped into modules that share common program sections. Therefore, when a function is loaded, the entire module gets loaded. For example, the FNAi Airy function is in the module AIRY. When this module is loaded, all the other functions in the module, FNAie, FNBi, and FNBie, become available to the program also. The MATHLIB.HTS file in the HTBasic install folder contains all the modules.
 
Compiled subroutines appear in program listings as a single CSUB line listing its name and arguments. After the subroutine is loaded, the program should be saved using the RE-STORE command. The subroutine will thereafter be loaded together with the program. However, using SAVE to save the program in an ASCII file will remove any compiled subroutines from the program.
 
One or more modules may be loaded under program control by placing the appropriate LOADSUB line in the program. Re-running the program does not load them a second time.
 
LOADSUB ALL FROM "AIRY.HTS" ! from the current directory:
LOADSUB FROM "MATHLIB.HTS"  ! all from the current directory:
 
LOADSUB ALL FROM "C:\HTB386\MATHLIB\AIRY.HTS" !  from the install directory:
LOADSUB FROM "C:\HTB386\MATHLIB\MATHLIB.HTS" ! all from the current directory: