Subject: comp.dsp FAQ [2 of 4]
Supersedes: <compdsp.2_820625636@bdti.com>
Date: 18 Apr 1996 00:05:55 GMT
References: <compdsp.1_829785923@bdti.com>
Summary: This is a periodic posting to comp.dsp that gives information
        on frequently asked questions asked in this newsgroup.

Version: 2.4



Q2.1: Where can I get some algorithms for general DSP?

   The following archives contain things such as matrix operations, FFT's
   and generally useful things like that, as opposed to complete
   applications.
     _________________________________________________________________
   
   
   
   Netlib, which serves some of this software via email. Try mail to
   netlib@ORNL.GOV with "send help" in the subject field.
   
   For Europe:
   
   Internet: netlib@nac.no
   EARN/BITNET: netlib%nac.no@norunix.bitnet
   X.400: s=netlib; o=nac; c=no;
   EUNET/uucp: nac!netlib
   
   
   For the Pacific, try netlib@draci.cs.uow.edu.au
   
   For background about netlib, see Jack J. Dongarra and Eric Grosse,
   "Distribution of Mathematical Software Via Electronic Mail," Comm. ACM
   (1987) 30,403--407.
   
   A similar collection of statistical software is available from
   statlib@temper.stat.cmu.edu.
   
   The symbolic algebra system REDUCE is supported by
   reduce-netlib@rand.org.
     _________________________________________________________________
   
   
   
   The Naval Surface Warfare Center has a library of mathematical Fortran
   subroutines that may be of use. The NSWC library is a library of
   general-purpose Fortran subroutines that provide a basic computational
   capability in a variety of mathematical activities. Emphasis has been
   placed on the transportability of the codes. Subroutines are available
   in the following areas: Elementary Operations, Geometry, Special
   Functions, Polynomials, Vectors, Matrices, Large Dense Systems of
   Linear Equations, Banded Matrices, Sparse Matrices, Eigenvalues and
   Eigenvectors, l1 Solution of Linear Equations, Least-Squares Solution
   of Linear Equations, Optimization, Transforms, Approximation of
   Functions, Curve Fitting, Surface Fitting, Manifold Fitting, Numerical
   Integration, Integral Equations, Ordinary Differential Equations,
   Partial Differential Equations
   
   NSWC Library of Mathematical Subroutines
   Report No.: NSWC TR 90-21, January 1990
   by Alfred H. Morris, Jr.
   
   
   From:
   
   Naval Surface Warfare Center (E43)
   Dahlgren, VA 22448-5000
   U.S.A.
   
   
   [Witold Waldman, witold@hotblk.aed.dsto.gov.au]
   
   This is avialble from file://euler.math.usma.edu/pub/misc/nswc.tar.Z
   This is a 3.2 Mbyte file with 800+ Fortran routines mentioned above.
     _________________________________________________________________
   
   Also, you can get the Fortran source code from the IEEE Press book
   "Programs For Digital Signal Processing." See question 1.2. Also, see
   the summary of DSP-related FTP sites, at the end of this FAQ.
   
   If you don't know where to find what you're after, try archie.
     _________________________________________________________________
   
   SigLib
   
   SigLib is an ANSI C Source DSP library. Current version is 1.61 SigLib
   has been compiled to run on IBM PCs, Sun Workstations and the
   following DSPs : TMS320C30, TMS320C40, DSP96002 and ADSP21020.
   
   SigLib contains about 130 base functions, from which many others are
   derived and over 80 demonstration programs, all of which exercise more
   than on part of the library at any one time. The library source and
   examples supplied total more than 18000 lines of code. SigLib also
   includes DFilter, an FIR and IIR digital filter design program and
   WinBuf, a Windows 3 graphical front end, for display of process
   results.
   
   Some applications of SigLib include drill string vibration analysis,
   room response analysis, audio effects, telecommunications, active
   control of sound and vibration, system simulation and medical imaging.
   
   
   Registered users of SigLib get one years free upgrade and maintenance.
   
   
   Spectrum analysis : FFTs and IFFTs; real, complex, zoom and
   spectrograms, microscan. Windowing types : Hanning, Hamming, Blackman,
   Triangle, Rectangle, Kaiser and Blackman-Harris. Fixed coefficient
   filtering : FIR, comb, IIR and one pole IIR filters, filter design
   methods, polyphase multi-rate filters, differentiation and integration
   filters, Hilbert transformers. Adaptive coefficient filtering : LMS.
   Convolution and Correlation : convolve, correlate. Imaging : conv3x3,
   histogram and 2DFFT. Signal generation : Sine, Cosine, White noise,
   Chirp (linear and non-linear), Square, Triangular, Sawtooth, Impulse,
   PN sequence. Modulation : AM, complex shift, FSK, spectral inversion,
   FM, QAM. Statistical analysis : sum, mean, average, standard deviation
   and variance, kurtosis. Regression analysis : linear, logarithmic,
   exponential, power. Digital effects : reverb, distortion, echo, pitch
   shifting Utility functions, including : scaling (lin and log) offset,
   min/max find, clip, offset, rotate, buffer lengthen, buffer shorten,
   buffer addition multiplication etc., histogram, quantise, absolute,
   peak hold, polynomial expansion. Control : PID. Graphics :
   display_buffer, display_buffer_line, print_buffer, display_3d_buffer,
   pole_zero_plot, xy_plot. Data stream disk I/O functions.
   
   SigLib object code UKP20, US$30
   SigLib source and object code UKP35, US$60
   Educational Price (Source code) UKP25, US$40
   
   
   Available on 3.5" diskette
   
   UK shipping per package UKP3; Non UK shipping per diskette UKP5, US$8
   
   These fees include 1 years free upgrade and maintenance.
   
   Payment preferably by Money Order or Cheque.
   
   email: johned@cix.compulink.co.uk
   
   John Edwards, Numerix, 157 Sileby Road, Barrow-on-Soar, Leics, LE12
   8LW, UK.
   
   Phone : +44 (0)509 413195, UK time between 17.30 PM and 9.00 PM.

Q2.2: What are CELP and LPC? Where can I get the source for CELP and LPC?

   
   
   CELP stands for "code excited linear prediction". LPC stands for
   "linear predictive coding". They are compression algorithms used for
   low bit rate (2400 and 4800 bps) speech coding. You can't get the
   source for LPC anywhere on the net.
   
   The U.S. DoD's Federal-Standard-1016 based 4800 bps code excited
   linear prediction voice coder version 3.2 (CELP 3.2) Fortran and C
   simulation source codes are available for worldwide distribution (on
   DOS diskettes, but configured to compile on Sun SPARC stations) from
   NTIS and DTIC. Example input and processed speech files are included.
   A Technical Information Bulletin (TIB), "Details to Assist in
   Implementation of Federal Standard 1016 CELP," and the official
   standard, "Federal Standard 1016, Telecommunications: Analog to
   Digital Conversion of Radio Voice by 4,800 bit/second Code Excited
   Linear Prediction (CELP)," are also available.
   
   This is available through the National Technical Information Service:
   
     NTIS
     U.S. Department of Commerce
     5285 Port Royal Road
     Springfield, VA 22161
     USA
     (703) 487-4650
     
   
   
   It may also be obtained from:
   file://svr-ftp.eng.cam.ac.uk/comp.speech/sources/DoD_CELP-3.2.tar.Z
   
   An updated version of the FS-1016 CELP 3.2 code is available, at least
   for a while, on:
   
   file://super.org/pub/celp_3.2a.tar.Z
   
   The code (C, FORTRAN, diskio) all has been built and tested on a Sun4
   under SunOS4.1.3. If you want to run it somewhere else, then you may
   have to do a bit of work. (A Solaris 2.x-compatible release is planned
   soon.)
   
   Note to PCers. The files cbsearch.F, celp.F, csub.F, mexcite.F,
   psearch.F are meant to be passed through the C preprocessor (cpp). We
   gather that DOS (or whatever it's called) can't distinguish the .F
   from a .f. Be careful!
   
   Very limited support is available from the authors (Joe, et al.).
   Please do not send questions or suggestions without first reading the
   documentation (README files, the Technical Information Bulletin,
   etc.). The authors would enjoy hearing from you, but they have limited
   time for support and would like to use it as efficiently as possible.
   They welcome bug reports, but, again, please read the documentation
   first. All users of FS-1016 CELP software are strongly encouraged to
   acquire the latest release (version 3.2a as of this writing).
   
   The "AD" ordering number for the CELP software is AD M000 118 (US$
   90.00) and for the TIB it's AD A256 629 (US$ 17.50). The LPC-10
   standard, described below, is FIPS Pub 137 (US$ 12.50). There is a
   $3.00 shipping charge on all U.S. orders. The telephone number for
   their automated system is 703-487-4650, or 703-487-4600 if you'd
   prefer to talk with a real person.
   
   (U.S. DoD personnel and contractors can receive the package from the
   Defense Technical Information Center: DTIC, Building 5, Cameron
   Station, Alexandria, VA 22304-6145. Their telephone number is
   703-274-7633.)
   
   The following articles describe the Federal-Standard-1016 4.8-kbps
   CELP coder (it's unnecessary to read more than one):
   
     
     
     Campbell, Joseph P. Jr., Thomas E. Tremain and Vanoy C. Welch, "The
     Federal Standard 1016 4800 bps CELP Voice Coder," Digital Signal
     Processing, Academic Press, 1991, Vol. 1, No. 3, p. 145-155.
     
     Campbell, Joseph P. Jr., Thomas E. Tremain and Vanoy C. Welch, "The
     DoD 4.8 kbps Standard (Proposed Federal Standard 1016)," in Advances
     in Speech Coding, ed. Atal, Cuperman and Gersho, Kluwer Academic
     Publishers, 1991, Chapter 12, p. 121-133.
     
     Campbell, Joseph P. Jr., Thomas E. Tremain and Vanoy C. Welch, "The
     Proposed Federal Standard 1016 4800 bps Voice Coder: CELP," Speech
     Technology Magazine, April/May 1990, p. 58-64.
     
   
   
   The U.S. DoD's Federal-Standard-1015/NATO-STANAG-4198 based 2400 bps
   linear prediction coder version 53 (LPC-10e v53) Fortran or C
   simulation source codes are available on a limited basis upon written
   request to:
   
     Tom Tremain
     Department of Defense
     Ft. Meade, MD 20755-6000
     USA
     
   
   
   There is also a section about FS-1015 in the book: Panos E.
   Papamichalis, Practical Approaches to Speech Coding, Prentice-Hall,
   1987.
   
   The following article describes the FS 1016 4.8-kbps CELP coder:
   Campbell, Joseph P. Jr., Thomas E. Tremain and Vanoy C. Welch, "The
   Proposed Federal Standard 1016 4800 bps Voice Coder: CELP," Speech
   Technology Magazine, April/May 1990, p. 58-64.
   
   Copies of the official standard "Federal Standard 1016,
   Telecommunications: Analog to Digital Conversion of Radio Voice by
   4,800 bit/second Code Excited Linear Prediction (CELP)" are available
   for US$ 5.00 each from:
   
     GSA Federal Supply Service Bureau
     Specification Section, Suite 8100
     470 E. L'Enfant Place, S.W.
     Washington, DC 20407
     (202) 755-0325
     
   
   
   The U.S. Federal Standard 1015 (NATO STANAG 4198) is described in:
   Thomas E. Tremain, "The Government Standard Linear Predictive Coding
   Algorithm: LPC-10," Speech Technology Magazine, April 1982, p. 40-49.
   
   The voicing classifier used in the enhanced LPC-10 (LPC-10e) is
   described in: Campbell, Joseph P., Jr. and T. E. Tremain,
   "Voiced/Unvoiced Classification of Speech with Applications to the
   U.S. Government LPC-10E Algorithm," Proceedings of the IEEE
   International Conference on Acoustics, Speech, and Signal Processing,
   1986, p. 473-6.
   
   Realtime DSP code for FS-1015 and FS-1016 is sold by several vendors,
   including DSP Software Engineering and Analogical Systems (see the
   vendor address list in section 5 for contact info). DSP Software
   Engineering's FS-1016 code can run on a DSP Research's Tiger 30 or on
   Intellibit's AE2000 TMS320C31 based 3" by 2.5" card. See section 4.1
   for more on these cards. Analogical's product runs on a 27 MHz
   DSP56001 chip.
   
   [Most of the above from Joe Campbell, jpcampb@afterlife.ncsc.mil, with
   additions from Dan Frankowski, drankow@cs.umn.edu, and Ed Hall,
   edhall@rand.org]

Q2.3: What is ADPCM? Where can I get source for it?

   
   
   ADPCM stands for Adaptive Differential Pulse Code Modulation. It is a
   family of speech compression and decompression algorithms. A common
   implementation takes 16-bit linear PCM samples samples and converts
   them to 4-bit samples, yeilding a compression rate of 4:1.
   
   There is public domain C code available via anonymous ftp at
   file://ftp.cwi.nl/pub/audio/adpcm.shar written by Jack Jansen (email
   Jack.Jansen@cwi.nl). It is very programmer-friendly. The ADPCM code
   used is the Intel/DVI ADPCM code which is being recommended by the IMA
   Digital Audio Technical Working Group. It allows the following calls:

adpcm_coder(short inbuf[], char outbuf[], int nsample,
        struct adpcm_state *state);
adpcm_decoder(char inbuf[], short outbuf[], int nsample,
        struct adpcm_state *state);

   
   
   The routines have been tested on an SGI Indigo running Irix 4.0.2 and
   on a Sparcstation 1+ running SunOS 4.1.1. On a Sun, the code will
   compress at 250Ksample/sec and decompress at 300Ksample/sec. On an
   SGI, the compressor runs at 350Ksample/sec and the decompressor at
   700Ksample/sec.
   
   Note that this is NOT a CCITT G722 coder. The CCITT ADPCM standard is
   much more complicated, probably resulting in better quality sound but
   also in much more computational overhead.
   
   You can get a G.721/722/723 package by email to teledoc@itu.arcom.ch,
   with "GET ITU-3022" as the only line in the body of the message.
   
   This is also available as:
   file://svr-ftp.eng.cam.ac.uk/comp.speech/sources/G711_G722_G723.tar.
   Z
   
   [From Dan Frankowski, drankow@cs.umn.edu; Jack Jansen,
   Jack.Jansen@cwi.nl]

Q2.4: What is GSM? Where can I get source for it?

   The README file for GSM says:
   
   The Communications and Operating Systems Research Group (KBS) at the
   Technische Universitaet Berlin is currently working on a set of
   UNIX-based tools for computer-mediated telecooperation that will be
   made freely available.
   
   As part of this effort we are publishing an implementation of the
   European GSM 06.10 provisional standard for full-rate speech
   transcoding, prI-ETS 300 036, which uses RPE/LTP (residual pulse
   excitation/long term prediction) coding at 13 kbit/s.
   
   GSM 06.10 compresses frames of 160 13-bit samples (8 kHz sampling
   rate, i.e. a frame rate of 50 Hz) into 260 bits; for compatibility
   with typical UNIX applications, our implementation turns frames of 160
   16-bit linear samples into 33-byte frames (1650 Bytes/s). The quality
   of the algorithm is good enough for reliable speaker recognition; even
   music often survives transcoding in recognizable form (given the
   bandwidth limitations of 8 kHz sampling rate).
   
   The interfaces offered are a front end modelled after compress(1), and
   a library API. Compression and decompression run faster than realtime
   on most SPARCstations. The implementation has been verified against
   the ETSI standard test patterns.
   
   Jutta Degener (jutta@cs.tu-berlin.de)
   Carsten Bormann (cabo@cs.tu-berlin.de)
   
   Communications and Operating Systems Research Group, TU Berlin
   Fax: +49.30.31425156, Phone: +49.30.31424315
   
   An implementation can be had from:
   ftp://ftp.cs.tu-berlin.de/pub/tubmik/gsm-1.0.tar.Z. An alternative
   site is ftp://ftp.cwi.nl/pub/audio/gsm-1.0.7.tar.gz.
   
   [From Dan Frankowski, dfrankow@cs.umn.edu; Jutta Degener,
   jutta@cs.tu-berlin.de]

Q2.5: How does pitch perception work, and how do I implement it on my DSP chip?

   
   
   Pitch is officially defined as "That attribute of auditory sensation
   in terms of which sounds may be ordered on a musical scale." Several
   good examples illustrating the subtleties of pitch perception are
   included in the "Auditory Demonstrations CD" which is available from
   the Acoustical Society of America, Woodbury, NY 10797 for $20.
   
   A good general reference about the psychology of pitch perception is
   the book:
   
     B.C.J. Moore, An Introduction to the Psychology of Hearing, Academic
     Press, London, 1989.
     
   
   
   This book is available in paperback and makes a good desk reference.
   
   An algorithm implementation that matches a large body of
   psychoacoustical work, but which is computationally very intensive, is
   presented in the paper:
   
     Malcolm Slaney and Richard Lyon, "A Perceptual Pitch Detector,"
     Proceedings of the International Conference of Acoustics, Speech,
     and Signal Processing, 1990, Albuquerque, New Mexico. Available for
     ftp at ftp://ftp.apple.com/pub/Lyon/ICASSP90.psc.ps
     
   
   
   The definitive papers describing the use of such a perceptual pitch
   detector as applied to the classical pitch literature is in:
   
     Ray Meddis and M. J. Hewitt. "Virtual pitch and phase sensitivity of
     a computer model of the auditory periphery. " Journal of the
     Acoustical Society of America 89 (6 1991): 2866-2682. and
     2883-2894.
     
   
   
   The current work that argues for a pure spectral method starts with
   the work of Goldstein:
   
     J. Goldstein, "An optimum processor theory for the central formation
     of the pitch of complex tones," Journal of the Acoustical Society of
     America 54, 1496-1516, 1973.
     
   
   
   Two approaches are worth considering if something approximating pitch
   is appropriate. The people at IRCAM have proposed a harmonic analysis
   approach that can be implemented on a DSP:
   
     Boris Doval and Xavier Rodet, "Estimation of Fundamental Frequency
     of Musical Sound Signals," Proceedings of the 1991 International
     Conference on Acoustics, Speech, and Signal Processing, Toronto,
     Volume 5, pp. 3657-3660.
     
   
   
   The classic paper for time domain (peak picking) pitch algorithms is:
   
     B. Gold and L. Rabiner, "Parallel processing techniques for
     estimating pitch periods of speech in the time domain," Journal of
     the Acoustical Society of America, 46, pp 441-448, 1969.
     
   
   
   Finally, a word of caution: Pitch is not single-valued. We can hear a
   sound and match it to several different pitches. Imagine the number of
   instruments in an orchestra, each with its own pitch. Even a single
   sound can have more than one pitch. See for example Demonstration 27
   from the ASA Auditory Demonstrations CD.
   
   [The above from Malcolm Slaney, Apple Computer, and John Lazzaro, U.C.
   Berkeley.]

Q2.6: What standards are there for digital audio? What is AES/EBU? What is
S/P-DIF?

   
   
   The "AES/EBU" (Audio Engineering Society / European Broadcast Union)
   digital audio standard is probably the most popular digital audio
   standard today. Most consumer and professional digital audio devices
   (CD players, DAT decks, etc.) that feature digital audio I/O support
   AES/EBU.
   
   AES/EBU is a bit-serial communications protocol for transmitting
   digital audio data through a single transmission line. It provides two
   channels of audio data (up to 24 bits per sample), a method for
   communication control and status information ("channel status bits"),
   and some error detection capabilities. Clocking information (i.e.,
   sample rate) is derived from the AES/EBU bit stream, and is thus
   controlled by the transmitter. The standard mandates use of 32 kHz,
   44.1 kHz, or 48 kHz sample rates, but some interfaces can be made to
   work at other sample rates.
   
   AES/EBU provides both "professional" and "consumer" modes. The big
   difference is in the format of the channel status bits mentioned
   above. The professional mode bits include alphanumeric channel origin
   and destination data, time of day codes, sample number codes, word
   length, and other goodies. The consumer mode bits have much less
   information, but do include information on copy protection
   (naturally). Additionally, the standard provides for "user data",
   which is a bit stream containing user-defined (i.e.,
   manufacturer-defined) data. According to Tim Channon, "CD user data is
   almost raq CD subcode; DAT is StartID and SkipID. In professional
   mode, there is an SDLC protocol or, if DAT, it may be the same as
   consumer mode."
   
   The physical connection media are commonly used with AES/EBU: balanced
   (differential), using two wires and shield in three-wire microphone
   cable with XLR connectors; unbalanced (single-ended), using audio coax
   cable with RCA jacks; and optical (via fiber optics).
   
   "S/P-DIF" (Sony/Philips Digital Interface Format) typically refers to
   AES/EBU operated in consumer mode over unbalanced RCA cable. Note that
   S/P-DIF and AES/EBU mean different things depending on how much of a
   purist you are in the digital audio world; see the Finger article
   below.
   
   References:
   
   Finger, Robert, "AES3-199X: The Revised Two Channel Digital Audio
   Interface (DRAFT)", presented at the 91st Convention of the Audio
   Engineering Society, October 4-8, 1991. Reprints: AES, 60 East 42nd
   St., New York, NY, 10165.
   
   [The above from Phil Lapsley, phil@bdti.com, and Tim Channon,
   tchannon@black.demon.co.uk]

Q2.7: What is mu-law encoding? Where can I get source for it?

   
   
   Mu-law (also "u-law") encoding is a form of logarithmic quantization
   or companding. It's based on the observation that many signals are
   statistically more likely to be near a low signal level than a high
   signal level. Therefore, it makes more sense to have more quantization
   points near a low level than a high level. In a typical mu-law system,
   linear samples of 14 to 16 bits are companded to 8 bits. Most
   telephone quality codecs (including the Sparcstation's audio codec)
   use mu-law encoded samples.
   
   Desktop Sparc machines come with routines to convert between linear
   and mu-law samples. On a desktop Sparc, see the man page for
   audio_ulaw2linear in /usr/demo/SOUND/man.
   
   Craig Reese posted the source of similar routines to comp.dsp in
   August '92. These are archived on
   file://evans.ee.adfa.oz.au/pub/dsp/misc
   
   References:
   
   CCITT Recommendation G.711 (very difficult to follow).
   
   Michael Villeret, et. al, "A New Digital Technique for Implementation
   of Any Continuous PCM Companding Law,", IEEE Int. Conf. on
   Communications , 1973, vol. 1, pp. 11.12-11.17.
   
   MIL-STD-188-113, "Interoperability and Performance Standards for
   Analog-to-Digital Conversion Techniques," 17 February 1987.
   
   TI Digital Signal Processing Applications with the TMS320 Family (TI
   literature number SPRA012A), pp. 169-198.
   
   [From Joe Campbell; Craig Reese, cfreese@super.org; Sepehr
   Mehrabanzad, sepehr@falstaff.dev.cdx.mot.com; Keith Kendall,
   KLK3%mimi@magic.itg.ti.com]

Q2.8: How can I do CD DAT sample rate conversion?

   
   
   CD players use a 44.1 kHz sample rate, whereas DAT uses a 48 kHz
   sample rate. This means that you must do sample rate conversion before
   you can get data from a CD player directly into a DAT deck.
   
   [From Ed Hall, edhall@rand.org:]
   
   For a start, look at Multirate Digital Signal Processing by Crochiere
   and Rabiner (see FAQ section 1.1).
   
   Almost any technique for producing good digital low-pass filters will
   be adaptable to sample-rate conversion. 44.1:48 and vice-versa is
   pretty hairy, though, because the lowest whole-number ratio is
   147:160. To do all that in one go would require a FIR with thousands
   of coefficients, of which only 1/147th or 1/160th are used for each
   sample--the real problem is memory, not CPU for most DSP chips. You
   could chain several interpolators and decimators, as suggested by
   factoring the ratio into 3*7*7:2*2*2*2*2*5. This adds complexity, but
   reduces the number of coefficients required by a considerable amount.
   
     _________________________________________________________________
   
   
   
   [From Lou Scheffer:]
   
   Theory of operation: 44.1 and 48 are in the ratio 147/160. To convert
   from 44.1 to 48, for example, we (conceptually):
   
   interpolate 159 zeros between every input sample. This raises that
   data rate to 7.056 MHz. Since it is equivalent to reconstructing with
   delta functions, it also creates images of frequency f at 44.1-f,
   44.1+f, 88.2-f, 88.2+f, ...
   
   We remove these with an FIR digital filter, leaving a signal
   containing only 0-20 KHz information, but still sampled at a rate of
   7.056 MHz.
   
   We discard 146 of every 147 output samples. It does not hurt to do so
   since we have no content above 24 KHz. In practice, of course, we
   never compute the values of the samples we will throw out.
   
   So we need to design an FIR filter that is flat to 20 KHz, and down at
   least X db at 24 KHz. How big does X need to be? You might think about
   100 db, since the max signal size is roughly +-32767, and the input
   quantization +- 1/2, so we know the input had a signal to broadband
   noise ratio of 98 db at most. However, the noise in the stopband
   (20KHz-3.5MHz) is all folded into the passband by the decimation in
   step 3, so we need another 22 db (that's 160 in db) to account for the
   noise folding. Thus 120 db rejection yields a broadband noise equal to
   the original quantizing noise. If you are a fanatic, you can shoot for
   130 db to make the original quantizing errors dominate, and a 22.05
   KHz cutoff to eliminate even ultrasonic aliasing. You will pay for
   your fanaticism with a penance of more taps, however.
     _________________________________________________________________
   
   For more details, a technical report (the author's name is missing, if
   you know who - let me know!), is available is LaTeX source form as
   file://evans.ee.adfa.oz.au/pub/dsp/cd-rate-convert.tex and in
   PostScript as file://evans.ee.adfa.oz.au/pub/dsp/cd-rate-convert.ps
     _________________________________________________________________
   
   There's a free implementation of Julius O. Smith III and someone
   else's "bandwidth-limited interpolation" rate conversion algorithm.
   
   The paper available as
   file://ccrma-ftp.stanford.edu/pub/DSP/Tutorials/BandlimitedInterpola
   tion.eps.Z explains the algorithm. The source code in
   file://ftp.netcom.com/pub/th/thinman/resample.01.Z,
   file://ftp.netcom.com/pub/th/thinman/resample.02.Z, and
   file://ftp.netcom.com/pub/th/thinman/kaiser.c implements the
   algorithm. It all works quite well.
     _________________________________________________________________
   
   [From Kevin Bradley, kb+@andrew.cmu.edu]:
   
   I have an implementation of polyphase resampling for various rates in
   Matlab and C at
   http://www.ece.cmu.edu/afs/ece/usr/kb/www/Software.html. It's got
   comments, and people might find it useful.
     _________________________________________________________________
   
   [From Fritz M. Rothacher, rothacfm@nb.rockwell.com]:
   
   You can add my Ph.D. thesis on sample-rate conversion to the FAQ:
   
   Fritz M. Rothacher, Sample-Rate Conversion: Algorithms and VLSI
   Implementation, Ph.D. thesis, Integrated Systems Lab, Swiss Federal
   Institute of Technology, ETH Zuerich, 1995, ISBN 3-89191-873-9
   
   It can also be downloaded from my homepage at
   http://err.ethz.ch/~rota.

Q3.1: What are the available DSP chips and chip architectures?

   
   
   { This is based on a woefully inadequate databook collection. Anyone
   want to add to this list? Manufacturers want to submit anything? }
   
   The "big four" programmable DSP chip manufacturers are Texas
   Instruments, with the TMS320 series of chips; Motorola, with the
   DSP56000, DSP56100, DSP56300, and DSP96000 series; AT&T, with the
   DSP1600 and DSP3200 series; and Analog Devices, with the ADSP2100 and
   ADSP21000 series. A good overview of programmable DSP chips is
   published periodically in EDN and Computer Design magazines. The most
   recent versions are:
   
     Marcus Levy and James P. Leonard, "EDN's 1995 DSP Chip Directory",
     EDN, May 11, 1995, p. 40.
     
     Ray Weiss, "Designers Go Shopping as DSP Prices Start Dropping",
     Computer Design, December 1995, p. 69.
     
   
   
   You may also want to check out Berkeley Design Technology's home page,
   which has a number of articles on choosing DSP processors, as well as
   a "Pocket Guide to DSP Processors and Cores" in downloadable
   PostScript.
   
   Here's a less ambitious chip breakdown by manufacturer:
     _________________________________________________________________
   
  TEXAS INSTUMENTS:
  
   TMS320C1x: family of low cost fixed-point DSP's; 16 bit data, 32 bit
   registers; Various RAM and ROM configurations; 16 bit I/O bus, serial
   ports.
   
   TMS320C25: 50 MHz fixed-point DSP; 16 bit data, 32 bit registers; 12.5
   MIPS @ 50 MHz.
   
   TMS320C30: 27/33/40 MHz floating point DSP; 32 bit floating point, 24
   bit fixed point data, 40 bit registers; DMA controller; dual serial
   ports; some support for multi-processor arrays.
   
   TMS320C31: version of C30 minus peripheral bus, one serial port, and
   the 4Kx32 internal ROM. ~$20, 132 pin PQFP.
   
   TMS320C40: 40/50 MHz floating point DSP; extensive parallel processing
   support through 6 buffered byte-wide 20 Mb/s links and 6 channel DMA;
   cache.
   
   TMS320C50: enhanced TMS320C25 (double throughput); low overhead
   looping; 10 Kwords SRAM on chip.
   
   TMS320C80: four 50 MHz fixed-point processors combined with a RISC
   supervisory processor in a single multichip module.
     _________________________________________________________________
   
  MOTOROLA:
  
   
   
   DSP56001: 20.5, 27, or 33 MHz 24-bit fixed point DSP. 24 bit data bus,
   16 bit address bus, 56 bit accumulators (2), host interface port,
   serial ports (2), general purpose I/O pins, timer. Harvard
   architecture. 512 words program RAM, 32 words bootstrap ROM, 512 words
   data RAM, 512 words data ROM on chip. Available in PGA, CQFP or PQFP
   packaging.
   
   DSP56000: Mask-programmed version of DSP56001, same peripherals and
   data memories, 3.75k words program ROM on chip.
   
   DSP56002: modular DSP based on new 24-bit DSP56k core, a superset of
   the DSP56001 architecture with On-Chip Emulation (OnCE) debug port,
   clock PLL and improved bus arbitration. Has four cycle double
   precision multiply and support for block floating point. Same memory
   as in DSP56001, except for 64 words bootstrap ROM. Host interface
   port, serial ports (2), general purpose I/O pins, programmable 24-bit
   timer, non-maskable interrupt. Low power fully static design, no
   minimum clock frequency requirement. Available at 40 MHz (5V supply)
   in PGA and CQFP packaging.
   
   DSP56004: modular DSP, same 24-bit DSP56k core as in DSP56002.
   Targeted to consumer digital audio applications. Has On-Chip Emulation
   (OnCE) debug port, clock PLL, serial host interface (I2C and SPI),
   four general purpose I/O pins, two stereo serial audio receivers
   (I2S/Sony), three stereo serial audio transmitters (I2S/Sony),
   external SRAM/DRAM memory interface with 8-bit data bus. Low power
   fully static design, no minimum clock frequency requirement. Available
   at 40 MHz (5V supply) in 80-pin QFP package.
   
   DSP56156: 40, 50, or 60 MHz fixed point DSP; 16 bit data bus, 40 bit
   accumulators (2), host interface port, serial ports (2), timer, OnCE
   debug port, clock PLL, 14 bit sigma-delta voice band CODEC, 2K words
   program RAM, 2K words data RAM on chip.
   
   DSP96002: IEEE format floating point DSP; two complete 32 bit data and
   address buses; Harvard architecture. 1k words program RAM, 64 words
   bootstrap ROM, 1k words data RAM, 1k words data ROM, host interface
   ports (2). Available in 33 MHz or 40 MHz in 223-pin PGA packaging.
   [The above from Sergio Liberman, sergio@msil.sps.mot.com ]
   
   
     _________________________________________________________________
   
  AT&T:
  
   
   
   DSP 16 FAMILY: DSP16A, $22.60; DSP1610, $91; DSP1616, $35.70 16 bit
   fixed point DSPs. The DSP16A has a 25ns cycle time while the 16C has
   an ADC and DAC on chip. The C-version also has a 4-pin JTAG interface.
   The 1610/1616 are enhanced versions intended for cellular phone use.
   The chips use separate on-chip 16-bit program- and data buses. The A
   and C versions have 12k x 16-bit program ROM and a 2k x 16-bit
   data-RAM while featuring parallell and serial I/O.
   
   DSP 32C/3210: DSP32C, $70(1000); DSP3210, $50(100k) 32-bit floating
   point with 40-bits accumulator and 16/24-bit fixed point. These DSP's
   uses a single 4M-word (3210: 4G-word) linear memory space instead of
   the separate program and data memory found on most DSP:s. The bus can
   be accessed four times and each internal memory two times per cycle.
   The 3210, along with the VCOS operating system is intended for use on
   the mother board of personal computers and workstations where it
   shares memory with the host. The 32C has three 512 x 32-bit RAM:s
   while the 3210 has two 1k x 32-bit RAMs and a 256 x 32-bit boot ROM.
   32C: Serial and parallell I/O, 3210: Serial I/O, timer,
   DMA-controller. 3210 available at 50 and 66MHz.
   
   DSP3210/DSP3207: 32-bit floating point with four 40-bit floating-point
   accumulators and twenty-two general purpose 32-bit fixed point
   registers. Single 32-bit (4G-byte) linear memory space. Support for
   byte, 16-bit word, and 32-bit word accesses. Big/little endian
   interface. C-like assembly language. Up to four memory accesses per
   instruction. VCOS operating system allows sharing of host memory (e.g.
   mother-board or local-bus board) or operation out of inexpensive DRAM
   (e.g. ISA board). Two 1k x 32-bit RAMs and a 256 x 32-bit boot ROM.
   Serial I/O, timer, DMA-controller. The DSP3207 is functionally
   equivalent to the DSP3210 except it lacks the serial I/O and
   associated DMA controller and has been designed for low power
   dissipation. DSP3210 available at 55MHz/5V and 66MHz/5V. DSP3207
   available at 55MHz/5V and 66MHz/5V and 40MHz/3V.
     _________________________________________________________________
   
  ANALOG DEVICES:
  
   
   
   ADSP-2100: 40 and 50Mhz fixed point DSP (10 MIPS, 12.5MIPS). 16 bit
   operations with 40-bit multiply-accumulate. No on chip memory except
   for a 16 word instruction cache. Off chip harvard architecture. PGA
   and PQFP packages.
   
   ADSP-2101: Derived from ADSP-2100; 16 bit operations with 40-bit MAC
   register. Extras include on chip memory of 2Kx24 program memory
   instruction/data RAM and 1Kx16 data memory RAM, 16-bit timer, two
   serial ports, low power state. PGA, PLCC, PQFP packages. Fastest speed
   grade in production is 16.6 MHz (16.6MIPS).
   
   ADSP-2102: RAM/ROM version of 2101; user selects how much of the 2kx24
   program memory is mask ROM.
   
   ADSP-2103: 3.3V version of the 2101 running at 13MHz (13 MIPs). PLCC,
   PQFP packages.
   
   ADSP-2105: 10Mhz (10MIPS) low cost fixed point DSP with 1 serial port,
   timer and 1kx24 instruction/data RAM in program memory space, and 512
   word data RAM in data memory space. Architecture and instruction set
   identical to ADSP-2101. Pin compatible with 2101. PLCC package only
   (can use standard 68 pin plcc socket). This processor sells for US
   $9.90 in any quantity.
   
   ADSP-2115: Architecture and pinout same as ADSP-2101, but 1K program
   memory RAM, 1/2K data memory RAM with 2 serial ports, interval timer
   etc. PLCC and PQFP packages. Available in 13.8MHz and 16MHz (13.8, 16
   MIPs)
   
   ADSP-2111: Adds a 8/16bit host interface port to ADSP-2101
   architecture allowing interface to Intel or Motorola style
   microprocessors. 13 and 16 MIPs speeds available. PGA and PQFP
   packages.
   
   ADSP-21msp50: ADSP-2111 with an on chip a/d and d/a interface (65dB
   SNR) Additional low power modes allow CMOS standby ( [Analog Devices
   DSP applications, dsp_applications@analog.com]

Q3.2: Software for Motorola DSPs.

   
     _________________________________________________________________
   
   
   
  Q3.2.1: WHERE CAN I GET A FREE ASSEMBLER FOR THE MOTOROLA DSP56000?
  
   
   
   A free assembler for the Motorola DSP56000 exists, thanks to Quinn
   Jensen, jensenq@qcj.icon.com. The current version is 1.1, and it is
   posted to alt.sources, so look for it on mirrors of that newsgroup
   (like wuarchive.wustl.edu).
     _________________________________________________________________
   
   
   
  Q3.2.2: WHERE CAN I GET A FREE C COMPILER FOR THE MOTOROLA DSP56000?
  
   
   
   There are two separate compiler sources for the Motorola DSP56000. One
   is the port of gcc 1.40 done by Andrew Sterian
   (asterian@eecs.umich.edu) and the other is a port of gcc 1.37.1 done
   by Motorola and returned to the FSF. Andrew's port has bowed to
   Motorola's version. Both may be portable to gcc2.x.x with some effort
   required. Neither of these comes with an assembler, but you can get a
   free DSP56000 assembler elsewhere (see Q3.2.1 above). The Motorola gcc
   source is available for FTP from:

Site                    Directory
nic.funet.fi            ~pub/ham/dsp/dsp56k-tools/dsp56k-gcc.tar.Z
evans.ee.adfa.oz.au     pub/micros/56k/g56k.tar.Z

   
   
   From Andrew Sterian, asterian@eecs.umich.edu: "My DSP56156 port is
   still the only DSP56156 compiler around and I have just released an
   updated version of it. Both this compiler and the previous incarnation
   are archived on wuarchive.wustl.edu (in the usenet/alt.sources
   directory) amongst other places."
     _________________________________________________________________
   
   
   
  Q3.2.3: WHERE CAN I GET ALGORITHMS AND LIBRARIES FOR MOTOROLA DSPS?
  
   What is the number for the Motorola DSP BBS?
   
   Motorola runs "Dr. Bub", a bulletin board for DSPs containing source
   code for various libraries and algorithms. You can call it at (512)
   891-3771 (9600, 4800, 2400, 1200 bps) or (512) 891-3773 (2400/1200/300
   bps). Format is 8 data bits, no parity, 1 stop bit). Log in as "guest"
   to browse the system, or you can open an account by entering "new" at
   the account name prompt. [John Fisher, johnf@dsp.sps.mot.com]
   
   Dr. Bub is also available on the Internet at
   http://www.design-net.com/dsp/bubfile/bub.html.
   
   Alternatively, Dr. BuB is mirrored on the following sites:

Site                    Directory
calvin.stanford.edu     /motorola bode.ee.
ualberta.ca             /pub/dos/motorola
nic.funet.fi            /pub/misc/motorola
doc.ic.ac.uk            /computing/systems/motorola/digital-signal-processing/d
r.bub.sources

   
   
   Also try nic.funet.fi in /pub/ham/dsp for a lot of good stuff on
   communications uses, including some hardware. More recent software and
   Motorola DSP-based hardware info can be found on wooster.hut.fi in
   /pub/alefnull. [Jarkko Vuori, Jarkko.Vuori@hut.fi]
   
   ccrma-ftp.stanford.edu also has a variety of DSP code (much of it NeXT
   specific, see below), including the following for the DSP56000:
   
   pub/clm.tar.Z "CLM", a package aimed mainly at composers doing
   computer music in Common Lisp, but includes a Lisp 56000 assembler,
   debugger, loader, large libraries of DSP56000 routines useful in
   computer music, and a compiler from a subset of Common Lisp to
   DSP56000 code. [bil@ccrma.stanford.edu]
     _________________________________________________________________
   
   
   
  Q3.2.4: WHERE CAN I GET NEXT-COMPATIBLE MOTOROLA DSP56001 CODE?
  
   
   
   Try the following from ccrma-ftp.Stanford.EDU:
     * DSP programs for the NeXT platform:
       
   pub/DSP/resample.tar.Z
          Audio sampling-rate conversion and FIR filter design.
          
   pub/DSP/ResoLab2.1.tar.Z
          Interactive filter instrument; sources now included, online
          help.
          
   pub/DSP/Spectro.Z
          Spectrum analysis tool, with source code.
          
   pub/DSP/WaveFormEditor.tar.Z
          Jean Laroche's real-time waveform editor, with DAJ's additions.
          
     * DSP programming examples for the NeXT platform:
       
   pub/DSP/dsp_dma_stream.tar.Z
          Fast DSP DMA programming example (two-way DMA).
          
   pub/DSP/JeanLaroche.tar.Z
          Low-level sound and DSP programming examples and docs.
          
   
   
   [bil@ccrma.Stanford.EDU]

Q3.3: Software for Texas Instruments DSPs.

   
     _________________________________________________________________
   
  Q3.3.1: WHERE CAN I GET FREE ALGORITHMS OR LIBRARIES FOR TI DSPS? WHAT IS THE
  NUMBER FOR THE TI DSP BBS?
  
   
   
   nic.funet.fi has some old, apparently public domain, assembler and
   related tools from TI for the TMS320 family. [Antti-Pekka Virtanen,
   antsu@utu.fu]
   
   The TI DSP bulletin board is at (713) 274-2323 (300, 1200, 2400, or
   9600 bps; 8 data, 1 stop, no parity).
   
   The TI DSP bulletin board is mirrored on ftp.ti.com, and on
   evans.ee.adfa.oz.au. TI's world-wide web site is http://www.ti.com.
   The TI site is the official one, but has no user contributed software.
   The file: file://evans.ee.adfa.oz.au/mirrors/tibbs/00README provides
   further guidance. Please restrict FTP session to outside of 8 am to 6
   pm local time (10 pm to 8 am GMT). [Brad Hards, bradh@ee.adfa.oz.au]
   
   { If anyone knows of any other sources for TI DSP software, please let
   us know at comp-dsp-faq@bdti.com. Thanks! }
     _________________________________________________________________
   
   
   
  Q3.3.2: WHERE CAN I GET A FREE C COMPILER FOR THE TI TMS320C30?
  
   
   
   Sonitech (see vendors list) has a gcc based TMS320C30 C compiler that
   was originally done Computer Motion. Sonitech sells it for $995, but
   under the terms of the Gnu Public License, other people can then give
   it away. While we haven't heard of any ftp sites yet, there are bound
   to be some soon.
     _________________________________________________________________
   
   
   
  Q3.3.3: WHERE CAN I GET A FREE ASSEMBLER FOR THE TI TMS320C30?
  
   
   
   Ted Rossin has written an assembler and linker for the TMS320C30. In
   his words, "It is somewhat limited by the fact that it can't handle
   expressions but it has worked fine for me over the past few years.
   There is no manual because it is a clone of the TI assembler and
   linker. However the linker command files use a different (easier to
   use) syntax. It runs on HP-UX workstations, Macs, IBM clones and
   believe it or not the Atari-ST (because I developed the code on it)."
   
   It is available for anonymous ftp from:
   ftp://ftp.ee.uts.edu.au/pub/DSP/contrib/as30r24.tar.Z
   
   [Ted Rossin, rossin@fc.hp.com]
     _________________________________________________________________
   
   
   
  Q3.3.4: WHAT IS TICK? WHERE CAN I GET IT?
  
   
   
   Tick is a TMS320C40 parallel network detection and loader utility.
   
   It is available from:
   file://evans.ee.adfa.oz.au/mirrors/tibbs/UserContributed
   
   Supports: Transtech, Hunt, and Traquair boards hosted by DOS, SunOS,
   Linux (a PC unix)

   
   
Q3.4: Software for Analog Devices DSPs.

   
     _________________________________________________________________
   
  Q3.4.1: WHERE CAN I GET ALGORITHMS OR LIBRARIES FOR ANALOG DEVICES DSPS?
  
   What is the number for the Analog Devices DSP BBS?
   
   The number for the Analog Devices DSP BBS is (617) 461-4258 (300,
   1200, 2400, 9600, 14400 bps), 8N1.
   
   You can also find files on Analog Devices' web site, or at their FTP
   site at ftp://ftp.analog.com.
   
   [Analog Devices DSP Applications, dsp_applications@analog.com]
