Sound Open Firmware
Loading...
Searching...
No Matches
decibels.h File Reference

Fixed-point exponential and decibel-to-linear conversion functions. More...

Include dependency graph for decibels.h:

Go to the source code of this file.

Macros

#define EXP_FIXED_INPUT_QY   27
 
#define EXP_FIXED_OUTPUT_QY   20
 
#define DB2LIN_FIXED_INPUT_QY   24
 
#define DB2LIN_FIXED_OUTPUT_QY   20
 

Functions

int32_t exp_fixed (int32_t x)
 Compute fixed-point exponential e^x.
 
int32_t db2lin_fixed (int32_t x)
 Convert decibels to linear amplitude scale 10^(x/20).
 

Detailed Description

Fixed-point exponential and decibel-to-linear conversion functions.

Macro Definition Documentation

◆ DB2LIN_FIXED_INPUT_QY

#define DB2LIN_FIXED_INPUT_QY   24

◆ DB2LIN_FIXED_OUTPUT_QY

#define DB2LIN_FIXED_OUTPUT_QY   20

◆ EXP_FIXED_INPUT_QY

#define EXP_FIXED_INPUT_QY   27

◆ EXP_FIXED_OUTPUT_QY

#define EXP_FIXED_OUTPUT_QY   20

Function Documentation

◆ db2lin_fixed()

int32_t db2lin_fixed ( int32_t  x)

Convert decibels to linear amplitude scale 10^(x/20).

Parameters
xInput decibel value in Q8.24 format.
Returns
Linear gain factor in Q12.20 format.

◆ exp_fixed()

int32_t exp_fixed ( int32_t  x)

Compute fixed-point exponential e^x.

Parameters
xInput argument in Q5.27 format.
Returns
Result e^x in Q12.20 format.