mkfilter.h

00001 /* mkfilter -- given n, compute recurrence relation
00002    to implement Butterworth, Bessel or Chebyshev filter of order n
00003    A.J. Fisher, University of York   <fisher@minster.york.ac.uk>
00004    September 1992 */
00005 
00006 /* Header file */
00007 #include <string.h>
00008 
00009 #define VERSION     "4.6"
00010 #undef  PI
00011 #define PI              3.14159265358979323846  /* Microsoft C++ does not define M_PI ! */
00012 #define TWOPI       (2.0 * PI)
00013 #define EPS             1e-10
00014 #define MAXORDER    12
00015 #define MAXPZ       2048    /* .ge. 2*MAXORDER, to allow for doubling of poles in BP filter;
00016                                        high values needed for FIR filters */
00017 #define MAXSTRING   256
00018 
00019 typedef void (*proc)();
00020 typedef unsigned int uint;
00021 
00022 extern "C"
00023 {
00024     double atof(const char *);
00025     int atoi(const char *);
00026     void exit(int);
00027 };
00028 
00029 extern const char *progname;
00030 extern void readdata(char*, double&, int&, double*, int&, double*);
00031 
00032 inline double sqr(double x)
00033 {
00034     return x*x;
00035 }
00036 
00037 inline bool seq(char *s1, char *s2)
00038 {
00039     return strcmp(s1, s2) == 0;
00040 }
00041 
00042 inline bool onebit(uint m)
00043 {
00044     return (m != 0)  &&  ((m & m - 1) == 0);
00045 }
00046 
00047 inline double asinh(double x)
00048 {
00049     /* Microsoft C++ does not define */
00050     return log(x + sqrt(1.0 + sqr(x)));
00051 }
00052 
00053 inline double fix(double x)
00054 {
00055     /* nearest integer */
00056     return (x >= 0.0)  ?  floor(0.5 + x)  :  -floor(0.5 - x);
00057 }

Generated on Tue Oct 7 20:25:47 2008 for spandsp by  doxygen 1.5.6