]> git.sesse.net Git - nageru/blob - db.h
Write 1.4.0 changelog.
[nageru] / db.h
1 #ifndef _DB_H
2 #define _DB_H 1
3
4 // Utility routines for working with decibels.
5
6 #include <math.h>
7
8 static inline double from_db(double db) { return pow(10.0, db / 20.0); }
9 static inline double to_db(double val) { return 20.0 * log10(val); }
10
11 #endif  // !defined(_DB_H)