X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=db.h;fp=db.h;h=53261abd058bd0b80f8881a182a4f93d2e3474d0;hb=2a30d1f3a428511dab64587bd7615bc528a2573b;hp=0000000000000000000000000000000000000000;hpb=d722eb439a9cb6a0ff8f420d25730bbba8a56fd6;p=nageru diff --git a/db.h b/db.h new file mode 100644 index 0000000..53261ab --- /dev/null +++ b/db.h @@ -0,0 +1,11 @@ +#ifndef _DB_H +#define _DB_H 1 + +// Utility routines for working with decibels. + +#include + +static inline double from_db(double db) { return pow(10.0, db / 20.0); } +static inline double to_db(double val) { return 20.0 * log10(val); } + +#endif // !defined(_DB_H)