home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / math / cephes / ellf / ellf.doc < prev    next >
Encoding:
Text File  |  1992-11-17  |  3.6 KB  |  100 lines

  1. /*            ellf.c
  2.  *
  3.  * This program calculates design coefficients for
  4.  * elliptic function digital filters.
  5.  *
  6.  * Inputs are entered by keyboard, as follows:
  7.  * 
  8.  * Type of filter (1: low pass, 2: band pass, 3: high pass,
  9.  *                 4: band reject, 0: exit to monitor)
  10.  * Order of filter (an integer)
  11.  * Passband ripple (peak to peak decibels)
  12.  * Sampling frequency (Hz)
  13.  * Passband edge frequency (Hz)
  14.  * Second passband edge frequency (for band pass or reject filters)
  15.  * Stop band edge frequency (Hz)
  16.  *      or stop band attenuation (entered as -decibels)
  17.  *
  18.  * The "exit to monitor" type 0 may be used to terminate the
  19.  * program when input is redirected to come from a command file.
  20.  *
  21.  * If your specification is illegal, e.g. the stop band edge
  22.  * is in the middle of the passband, the program will make you
  23.  * start over.  However, it remembers and displays the last
  24.  * value of each parameter entered.  To use the same value, just
  25.  * hit return instead of typing it in again.
  26.  *
  27.  * The program displays all pass band and stop band edge frequencies,
  28.  * and the stop band attenuation. The z-plane coefficients are
  29.  * printed in these forms:
  30.  *   Numerator and denominator z polynomial coefficients
  31.  *   Pole and zero locations
  32.  *   Polynomial coefficients of quadratic factors
  33.  *
  34.  * The following mathematical subroutines are required:
  35.  * asin(), atan(), atan2(), cos(), ellik()
  36.  * ellpj(), ellpk(), exp(), log(), sin(), sqrt().
  37.  * Of these, all but the elliptic functions are available in
  38.  * standard C function libraries.
  39.  * 
  40.  * References:
  41.  * A. H. Gray, Jr., and J. D. Markel, "A Computer Program for
  42.  * Designing Digital Elliptic Filters", IEEE Transactions on
  43.  * Acoustics, Speech, and Signal Processing 6, 529-538
  44.  * (December, 1976)
  45.  *
  46.  * B. Gold and C. M. Rader, Digital Processing of Signals,
  47.  * McGraw-Hill, Inc. 1969, pp 61-90
  48.  *
  49.  * M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical
  50.  * Functions, National Bureau of Standards AMS 55, 1964,
  51.  * Chapters 16 and 17
  52.  *
  53.  *
  54.  *        ellf.c
  55.  *
  56.  *    System dependent aspects:
  57.  *
  58.  * This program has been tested on IBM PC with Microsoft C;
  59.  * DEC PDP-11 with Whitesmiths C; and DEC VAX with VAX C.
  60.  * All answers agreed within 1 in the last reported decimal place.
  61.  *
  62.  * It was also tried on a Unisoft 68000 Unix system, but did
  63.  * not work.  The reason was traced to a serious problem
  64.  * in Unisoft's floating point arithmetic -- so that
  65.  * particular attempt was abandoned.
  66.  *
  67.  * The code was compiled without any complaints by the
  68.  * Greenhills 68000 cross compiler running on a VAX;
  69.  * but the object code was not tested.
  70.  *
  71.  * You need: this file; the three elliptic functions ellik.c,
  72.  * ellpk.c, and ellpj.c; and perhaps const.c (possibly named
  73.  * mthutl.c).  If you don't have the necessary constants,
  74.  * define UNK below to be 1 and hope your C compiler converts
  75.  * the decimal values correctly.
  76.  *
  77.  * See the accompanying output listing file ellf.ans
  78.  * for a set of correct answers.  If the low pass and high
  79.  * pass options work but the others don't, then examine your
  80.  * atan2() function carefully for reversed arguments or perhaps
  81.  * an offest of pi.
  82.  *
  83.  * On most systems, define DECPDP to be 0.  This should work
  84.  * with most Unix-like function libraries.
  85.  *
  86.  * All static variables are initialized in order to make
  87.  * the Whitesmiths C compiler happy.
  88.  *
  89.  * The program has been cut up into rather arbitrary subroutines
  90.  * to get it safely through the Microsoft C compiler on IBM PC.
  91.  *
  92.  * Function abs(x) returns the double precision absolute
  93.  * value of x.  Function polevl() is needed by ellpk();
  94.  * Both abs() and polevl() are included with this listing.
  95.  *
  96.  *
  97.  * Steve Moshier, December 1986
  98.  */
  99.  
  100.