3.11.11 Q14_SCALE Macro

C

#define   Q14_SCALE(value)         (int16_t)( value * (float32_t)Q14_SCALE_FACTOR)

Summary

Convert the given value into the Q14 fixed-point format .

Description

The macro is used to convert the given value into the Q14 fixed-point format by multiplying it with a predefined scaling factor, Q14_SCALE_FACTOR(214).

Example

float32_t input_value = 0.50f;  // 
int16_t scaled_value = Q14_SCALE(input_value);  // Scaled result  
    

Remarks

None