xxx/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 double atof(const char *);
00023 int atoi(char *);
00024 void exit(int);
00025 
00026 extern const char *progname;
00027 extern void readdata(char*, double&, int&, double*, int&, double*);
00028 
00029 inline double sqr(double x)
00030 {
00031     return x*x;
00032 }
00033 
00034 inline bool seq(char *s1, char *s2)
00035 {
00036     return strcmp(s1, s2) == 0;
00037 }
00038 
00039 inline bool onebit(uint m)
00040 {
00041     return (m != 0)  &&  ((m & m - 1) == 0);
00042 }
00043 
00044 inline double asinh(double x)
00045 {
00046     /* Microsoft C++ does not define */
00047     return log(x + sqrt(1.0 + sqr(x)));
00048 }
00049 
00050 inline double fix(double x)
00051 {
00052     /* nearest integer */
00053     return (x >= 0.0)  ?  floor(0.5 + x)  :  -floor(0.5 - x);
00054 }

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