Q Format
[Configuration]


Detailed Description

This module regroups the options used to configure the signed fixed point Q format.

This module regroups the options used to configure the signed fixed point Q format.
Here is a description of the Q-Format:
Q-format: Qa.b

Here is the formula linking a Q-format number (x) to a decimal number (d):

qformat_main_formula.gif

The resolution of a Q-formatted number is calculated as follow:

qformat_resolution.gif
The range of a Q-formatted number x defines the maximum and minimum numbers which frame x. Here is a formula to calculate those values:
qformat_range.gif

Example:
For the Q1.15 type:

For the Q1.31 type:

Here is a link where you can find more information http://en.wikipedia.org/wiki/Fixed-point_arithmetic on fixed-point formats.


Q Format definition for the 16-bit type

Note:
The 16-bit functions are optimized to work with a Q1.15 format:
Resolution: 0.00003
Range: [-1.; 0.99997]


#define DSP16_QA   1
 number of integer bits
#define DSP16_QB   15
 number of fractional bits

Q Format definition for the 32-bit type

Note:
The 32-bit functions are optimized to work with a Q1.31 format:
Resolution: 0.00000000047
Range: [-1.; 0.99999999953]


#define DSP32_QA   1
 number of integer bits
#define DSP32_QB   31
 number of fractional bits


Define Documentation

#define DSP16_QA   1

number of integer bits

Definition at line 131 of file dsp_types.h.

#define DSP16_QB   15

number of fractional bits

Definition at line 135 of file dsp_types.h.

Referenced by dsp16_op_div(), and dsp16_op_mul().

#define DSP32_QA   1

number of integer bits

Definition at line 161 of file dsp_types.h.

#define DSP32_QB   31

number of fractional bits

Definition at line 165 of file dsp_types.h.

Referenced by dsp32_op_div(), and dsp32_op_mul().


Generated on Fri Apr 4 21:17:19 2008 for AVR32 - Fixed point DSP Library by  doxygen 1.5.1