![]() |
Mixxx
|
00001 /*************************************************************************** 00002 mathstuff.h - description 00003 ------------------- 00004 copyright : (C) 2002 by Tue and Ken Haste Andersen 00005 email : 00006 ***************************************************************************/ 00007 00008 /*************************************************************************** 00009 * * 00010 * This program is free software; you can redistribute it and/or modify * 00011 * it under the terms of the GNU General Public License as published by * 00012 * the Free Software Foundation; either version 2 of the License, or * 00013 * (at your option) any later version. * 00014 * * 00015 ***************************************************************************/ 00016 00017 // Misc. math functios for Mixxx by Tue Haste Andersen. 00018 00019 #ifndef MATHSTUFF_H 00020 #define MATHSTUFF_H 00021 00022 #include "defs.h" 00023 #include <math.h> 00024 #include <algorithm> 00025 00026 00027 CSAMPLE besseli(CSAMPLE); 00028 int sign(CSAMPLE); 00029 int invmatrix(CSAMPLE *); 00030 void polcoe(CSAMPLE x[], CSAMPLE y[], int n, CSAMPLE cof[]); 00031 CSAMPLE mod2pi(CSAMPLE); 00032 #ifdef __WINDOWS__ 00033 int round(CSAMPLE x); 00034 #endif 00035 CSAMPLE arctan2(CSAMPLE y, CSAMPLE x); 00036 CSAMPLE wndKaiser(CSAMPLE *wnd, int size, CSAMPLE beta); 00037 CSAMPLE wndKaiserSample(int size, CSAMPLE beta, int i); 00038 bool even(long n); 00039 //void wndDwnd(CSAMPLE *wnd, CSAMPLE *dwnd, int size); 00042 double qip(CSAMPLE x, unsigned int n); 00043 float sigmoid_zero(double t, double max_t); 00044 00045 static CSAMPLE pi = acos(-1.0f); 00046 static CSAMPLE two_pi = (2.f*acos(-1.f)); 00047 00048 #ifdef _MSC_VER 00049 #include <float.h> // for _isnan() on VC++ 00050 #define isnan(x) _isnan(x) // VC++ uses _isnan() instead of isnan() 00051 #else 00052 //#include <math.h> // for isnan() everywhere else 00053 #endif 00054 00055 00056 #endif