diff options
Diffstat (limited to 'src/utils.h')
-rw-r--r-- | src/utils.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/utils.h b/src/utils.h new file mode 100644 index 0000000..c7ddc1e --- /dev/null +++ b/src/utils.h @@ -0,0 +1,17 @@ +#ifndef UTILS_H_ +#define UTILS_H_ + +#include <math.h> + +#define MIN(a,b) (((a)<(b))?(a):(b)) +#define MAX(a,b) (((a)>(b))?(a):(b)) + +#define NUMOF(l) (sizeof(l) / sizeof(*l)) + +#define linear_to_dB(x) (log10(x) * 20) + + +const char* level(int channel, int* peak); + +#endif + |