Put binForFrequency/frequencyForBin in a common place

This commit is contained in:
Chris Cannam
2022-06-13 10:08:05 +01:00
parent 05fb611544
commit 182e2b0e3b
8 changed files with 95 additions and 70 deletions

View File

@@ -92,16 +92,6 @@ struct timeval { long tv_sec; long tv_usec; };
void gettimeofday(struct timeval *p, void *tz);
#endif // _WIN32
inline double mod(double x, double y) { return x - (y * floor(x / y)); }
inline float modf(float x, float y) { return x - (y * float(floor(x / y))); }
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif // M_PI
inline double princarg(double a) { return mod(a + M_PI, -2.0 * M_PI) + M_PI; }
inline float princargf(float a) { return modf(a + (float)M_PI, -2.f * (float)M_PI) + (float)M_PI; }
} // end namespace
// The following should be functions in the RubberBand namespace, really