Convertion macro from a float to a Q Formated value | |
| |
#define | DSP16_Q(fnum) ((dsp16_t__) DSP_Q(DSP16_QA, DSP16_QB, fnum)) |
Convert a float into a 16-bit signed fixed-point type. | |
#define | DSP32_Q(fnum) ((dsp32_t__) DSP_Q(DSP32_QA, DSP32_QB, fnum)) |
Convert a float into a 32-bit signed fixed-point type. | |
#define | DSP_Q(a, b, fnum) |
Convert a float into a signed fixed-point typed Qa.b. | |
Limit values in floating-point format of a signed fixed-point number typed Qa.b | |
#define | DSP_FP_MAX(a, b) (((float) (1 << ((a)-1))) - DSP_FP_RES(a, b)) |
Return the maximal value of a fixed-point Qa.b typed number. The result is returned as a floating point number. | |
#define | DSP_FP_MIN(a, b) (-((float) (1 << ((a)-1)))) |
Return the minimal value of a fixed-point Qa.b typed number. The result is returned as a floating point number. | |
Resolution in floating-point format of a signed fixed-point number typed Qa.b | |
#define | DSP_FP_RES(a, b) (1./((unsigned) (1 << (b)))) |
Return the resolution of a fixed-point Qa.b typed number. | |
Limit values in fixed-point format of a signed fixed-point number typed Qa.b | |
#define | DSP_Q_MAX(a, b) ((S32) (((U32) -1) >> (32 - ((a)+(b)-1)))) |
Return the maximal value of a fixed-point Qa.b typed number. | |
#define | DSP_Q_MIN(a, b) ((S32) ((-1) << ((a)+(b)-1))) |
Return the minimal value of a fixed-point Qa.b typed number. |
#define DSP16_Q | ( | fnum | ) | ((dsp16_t__) DSP_Q(DSP16_QA, DSP16_QB, fnum)) |
Convert a float into a 16-bit signed fixed-point type.
Definition at line 297 of file dsp_types.h.
Referenced by dsp16_filt_lpfirdesign(), dsp16_gen_dcomb(), dsp16_gen_dirac(), dsp16_gen_noise(), dsp16_gen_ramp(), dsp16_gen_rect(), dsp16_gen_saw(), dsp16_gen_sqr(), dsp16_op_acos(), dsp16_op_asin(), dsp16_op_cos(), dsp16_op_exp(), dsp16_op_kaiser_i0(), dsp16_op_kernel_cosfix(), dsp16_op_kernel_sinfix(), dsp16_op_ln_raw(), dsp16_op_pow(), dsp16_op_sin(), dsp16_op_sqrt(), dsp16_resampling_setup(), dsp16_win_bart(), dsp16_win_black(), dsp16_win_gauss(), dsp16_win_hamm(), dsp16_win_hann(), dsp16_win_kaiser(), dsp16_win_rect(), dsp16_win_welch(), and state_machine_source().
#define DSP32_Q | ( | fnum | ) | ((dsp32_t__) DSP_Q(DSP32_QA, DSP32_QB, fnum)) |
Convert a float into a 32-bit signed fixed-point type.
Definition at line 301 of file dsp_types.h.
Referenced by dsp32_gen_dcomb(), dsp32_gen_dirac(), dsp32_gen_noise(), dsp32_gen_ramp(), dsp32_gen_rect(), dsp32_gen_saw(), dsp32_gen_sqr(), dsp32_op_acos(), dsp32_op_asin(), dsp32_op_cos(), dsp32_op_exp(), dsp32_op_kaiser_i0(), dsp32_op_kernel_cosfix(), dsp32_op_kernel_sinfix(), dsp32_op_ln_raw(), dsp32_op_pow(), dsp32_op_sin(), dsp32_op_sqrt(), dsp32_win_bart(), dsp32_win_black(), dsp32_win_gauss(), dsp32_win_hamm(), dsp32_win_hann(), dsp32_win_kaiser(), dsp32_win_rect(), and dsp32_win_welch().
#define DSP_FP_MAX | ( | a, | |||
b | ) | (((float) (1 << ((a)-1))) - DSP_FP_RES(a, b)) |
Return the maximal value of a fixed-point Qa.b typed number. The result is returned as a floating point number.
Definition at line 252 of file dsp_types.h.
#define DSP_FP_MIN | ( | a, | |||
b | ) | (-((float) (1 << ((a)-1)))) |
Return the minimal value of a fixed-point Qa.b typed number. The result is returned as a floating point number.
Definition at line 256 of file dsp_types.h.
Referenced by gui_buffer_print_dsp16_bars(), and gui_buffer_print_dsp16_signal().
#define DSP_FP_RES | ( | a, | |||
b | ) | (1./((unsigned) (1 << (b)))) |
Return the resolution of a fixed-point Qa.b typed number.
Definition at line 278 of file dsp_types.h.
#define DSP_Q | ( | a, | |||
b, | |||||
fnum | ) |
Value:
(((fnum) >= DSP_FP_MAX(a, b) - DSP_FP_RES(a, b))?\ DSP_Q_MAX(a, b):\ (((fnum) <= DSP_FP_MIN(a, b) + DSP_FP_RES(a, b))?\ DSP_Q_MIN(a, b):\ (((fnum)*(((unsigned) (1 << (b))))))))
Definition at line 288 of file dsp_types.h.
Referenced by dsp16_filt_lpfirdesign(), dsp16_op_exp(), dsp16_op_kaiser_i0(), dsp16_op_log10(), dsp16_op_log2(), dsp16_op_pow(), dsp16_win_gauss(), and dsp16_win_kaiser().
#define DSP_Q_MAX | ( | a, | |||
b | ) | ((S32) (((U32) -1) >> (32 - ((a)+(b)-1)))) |
Return the maximal value of a fixed-point Qa.b typed number.
Definition at line 265 of file dsp_types.h.
Referenced by dsp16_op_exp(), dsp16_op_pow(), dsp16_vect_min(), dsp32_op_exp(), dsp32_op_pow(), dsp32_vect_min(), and dsp_debug_read_q().
#define DSP_Q_MIN | ( | a, | |||
b | ) | ((S32) ((-1) << ((a)+(b)-1))) |
Return the minimal value of a fixed-point Qa.b typed number.
Definition at line 269 of file dsp_types.h.
Referenced by dsp16_op_ln(), dsp16_op_ln_raw(), dsp16_op_log10(), dsp16_op_log2(), dsp16_op_pow(), dsp16_vect_max(), dsp32_op_ln(), dsp32_op_ln_raw(), dsp32_op_log10(), dsp32_op_log2(), dsp32_op_pow(), dsp32_vect_max(), and dsp_debug_read_q().