First commit

This commit is contained in:
Dave Lacey
2011-07-07 20:15:51 +01:00
commit 02b07ed9f3
70 changed files with 15434 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
#ifndef __dbcalc_h__
#define __dbcalc_h__
/* Function: db_to_mult
This function converts decibels into a volume multiplier. It uses a fixed-point polynomial approximation
to 10^(db/10).
Parameters:
db - The db value to convert.
db_frac_bits - The number of binary fractional bits in the supplied decibel value
result_frac_bits - The number of required fractional bits in the result.
Returns:
The multiplier value as a fixed point value with the number of fractional bits as specified by
the result_frac_bits parameter.
*/
unsigned db_to_mult(int db, int db_frac_bits, int result_frac_bits);
#endif // __dbcalc_h__