This is a set of commonly used
routines written in optimized assembly language and
callable by the user's assembly program. A 'C' callable
version is included with the dsp32c-cc-sun4 compiler. The
DSP32C-al-sun4 contains the source code for the
applications library on cartridge tape and the msdos
versions are supplied on floppies.
| _acos calculates
arcosine(x) for lxl<0.966 |
|
Time: 1.28 |
| _alog10 calculates base 10
anti-log(x) for lxl<38 |
|
Time: 1.40 |
| _alog calculates base 2
anti-log(x) for lxl<127 |
|
Time: 1.34 |
| _aloge calculates anti-in(x) for lxl<88 |
|
Time: 1.40 |
| _asin calculates arcsine(x) for lxl<0.966 |
|
Time: 1.23 |
| _atan calculates arctangent(x) for lxl<0 |
|
Time: 2.15 |
| _cos calculates cosine(x) for lxl<pi/2 |
|
Time: 1.26 |
| _div calculates N/D (divide) |
|
Time: 1.30 |
| _divf faster but less accurate divide |
|
Time: 0.95 |
| _dsp32 converts an array of N numbers in IEEE
floating-point format to the internal DSP format. |
|
Time: 0.4+0.10N |
| _dsp32c same as _dsp32 if N<2049. |
|
Time: .5+.05N |
| _gran generates Gaussian random number. |
|
Time: 7.93 |
| _ieee32 converts an array of N numbers in DSP
internal floating-point format to IEEE format. |
|
Time: .45+.1N |
| _ieee32c same as _ieee32 if N<2049. |
|
Time: .55+.05N |
| _inv calculates the inverse of a number. |
|
Time: 1.14 |
| _invf fast inverse routine. |
|
Time: 0.84 |
| _invsqr calculates inverse square root. |
|
Time: 1.83 |
| _log10 calculates base 10 log(x) for lxl<0 |
|
Time: 1.71 |
| _log2 calculates base 2 log(x) for lxl<0 |
|
Time: 1.66 |
| _loge calculates base e In(x) for lxl<0 |
|
Time: 1.71 |
| _ran generates random numbers uniformly
distributed between 0.0 and 1.0 with a period of
65536. |
|
Time: 1.03 |
| _ran24 same as _ran but with a period of 16M |
|
Time: 1.03 |
| _sin calculates sine(x) for lxl<pi/2 |
|
Time: 1.03 |
| _sqr calculates square root of x for x<0
(accurate to 21 bits). |
|
Time: 1.86 |
| _sqrtq faster but less accurate than _sqr. |
|
Time: 1.3 |
| _tan calculates tangent(x) for lxl<pi/4 |
|
Time: 1.76 |
| _xtoy calculates x for x<0. |
|
Time: 2.75 |
Matrix Routines |
| _mat2x2 Multiply two 2x2
matrices. |
|
Time: 0.9 |
| _mat3x3 Multiply two 3x3
matrices. |
|
Time: 2.00 |
| _mat4x1 Multiply two 4x4 matrix
by 4x1. |
|
Time: 1.3 |
| _mat4x1f Larger but faster
version. |
|
Time: 1.25 |
| _mat4x4 Multiply two 4x4
matrices. |
|
Time: 3.85 |
| _mat5x5 Multiply two 5x5
matrices. |
|
Time: 6.9 |
| _matin1 Calculate inverse of a
2x2 matrix. |
|
Time: 1.86 |
| _matinv Calculate inverse of a
NxN matrix. |
|
Time for 6x6: 103 |
| _matinf Faster but less accurate
than _matinv. |
|
Time for 6x6: 79 |
| _matmul Multiply MxN matrix by
NxP. |
|
Time for 5x5: 15.5 |
Graphics/Imaging Routines |
| _grey Converts an array of color pixels
represented by bits per pixel (5 bits per color)
to an array of pixels with a 5-bit grey scale. |
|
Time for N.pixels: .45 + 5.06N |
| _histeq Implements the histogram
equalizatrion algorithm on a grey scale image
with each pixel represented by a 5-bit value. |
|
Time for N.pixels: 17.31 + 1.76N |
Filter Routines |
| _fir calculates an fir filter. |
|
Time for length: 1.74 |
| _fir5 fir filter with length multiple of 5. |
|
Time for length: 1.74 |
| _firc complex FIR filter. |
|
Time for length: 4.83 |
| _iir calculates an IIR filter. |
|
Time for length: 5.21 |
| _iir2 calculates a 2-section and 4-multiply
per section IIR filter. |
|
Time: 1.01 |
| _iir3 calculates a 3-section and 4-multiply
per section IIR filter. |
|
Time: 1.24 |
| _iir4 calculates a 4-section and 4-multiply
per section IIR filter. |
|
Time: 1.46 |
| _iird calculates an IIR filter with direct
form II cascade 2nd order sections with 5
multiplications/section. |
|
Time for 4 sections: 1.78 |
| _iirdN same as _iird with N sections. |
|
Time for 4 sections: 1.63 |
| _iirt calculates an IIR filter with direct
form I cascade 2nd order sections with 5
multiplications/section. |
|
Time for 4 sections: 1.76 |
| _iirt1 calculates a single 5-multiplier
section IIR filter. |
|
Time: .79 |
| _iirt2 calculates a 2-section 5-multiplier
IIR filter. |
|
Time: 1.06 |
| _iirt3 calculates a 3-section 5-multiplier
IIR filter. |
|
Time: 1.34 |
| _iirt4 calculates a 4-section 5-multiplier
IIR filter. |
|
Time: 1.61 |
| _osc returns a sample value from a digital
sinusoidal osc |
|
Time: 0.51 |
| _oscN returns N samples from a digital
sinusoidal osc. _oscamp returns an estimate of
the square amplitude of the osc from its state
variables. |
|
Time: 1.55 |
| _oscinit initializes the digital sinusoidal
oscillator. |
|
Time: 2.1 |
| _tone returns a sample value from a
tone-pair. |
|
Time: 0.68 |
| _toneN returns N samples from a tone-pair.
_toneamp returns an estimate of the square
amplitude of a pair of oscillators. |
|
Time: 2.95 |
| _toneini initializes the pair of oscillators. |
|
Time: 4.35 |
Adaptive Filter Routines |
| _Ims Implements a real adaptive
FIR filter using the least-mean-square algorithm
without tap leakage. |
|
Time for length 20:
3.28 |
| _Imsc Implements a complex adaptive FIR. |
|
Time for length 20: 11.38 |
| _Imsl Implements a real adaptive FIR filter
using the leaky least-mean-square algorithm. |
|
Time for length 20: 4.51 |
FFT Routines |
| Several Fast Fourier Transform
routines handle a combination of real or complex
data (in same or separate arrays), from 64 point
up to 16K. |
Time for a
1024 pt. complex FFT: 2.11ms
Time for a 1024 pt. real FFT: 1.31ms |
| _chammo multiply an array of
complex data by the Hamming window. |
| _channo multiply an array of
complex data by the Hanning window. |
| _hamm multiply an array of real
data by the Hamming window. |
| _hann multiply an array of
complex data by the Hanning window. |
| _ifft inverse complex FFT. |
|
Time for 1024 pt.: 2.84ms |