The coefficients of the recording path
mixers [like ax, bx, cx, dx] are
programmed as 32-bit twos-complement values, each occupying four consecutive
registers in the register space of the device. These mixer coefficients are in
either 1.31 format with a range from –1 (0x80000000) to 0.9999999995 (0x7FFFFFFF),
or 2.30 format with a range from – 2(0x80000000) to 1.9999999991 (0x7FFFFFFF). These
representations are shown in Figure 2-2.
- To convert a floating point
number to the corresponding Q31 format, multiply the floating point mixer
coefficient by 231 (for 1.31) or 230 (for 2.30) and
truncate to the nearest integer.
- For example, a
coefficient of 0.4 corresponds to an integer value of 858993459 in 1.31
format.
- Similarly, a coefficient
of 1.25 corresponds to an integer value of 1288490189 in 2.30
format
- For positive integers, convert
directly to hexadecimal format.
- For negative integers, take the
absolute value of the coefficient, convert the value to binary, negate the
value, add one, and convert to hex. For example, to represent -135 in 32-bit
two's complement hexadecimal format:
- Absolute value of -135 is
0000 0000 0000 0000 0000 0000 1000 0111 in binary (or 0x00000087 in
hex)
- Negating the binary
results in 1111 1111 1111 1111 1111 1111 0111 1000 in binary (or
0xFFFFFF78 in hex). This is the twos-complement representation of the
negative integer.