This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Is there any efficiency way that "Convert SQ10.5 (16bit) to IQ15(32bit) ?

Hi all

 

I have used IQmath & Vlib with DM6437.

 

These days, I trying to make tracking application using kalman filter in Vlib.

 

In that, there is a SQ10.5(16bit) type matrix "State" (the member of struct VLIB_kalmanFilter) whereas my IQmath is a 32bit.

 

Here are couple of problems.

 

1. Why multiplies  " MAX_S16 / MAX_10p5 " to floating elements of matrix to makes SQ10.5 value, not just multiplies  "MAX_10p5" ?

-

#define MAX_U16 65535
#define MAX_S16 32768
#define MAX_U32 4294967295
#define MAX_S32 2147483647
#define MAX_8p8 256
#define MAX_0p16 1
#define MAX_12p4 4096
#define MAX_4p12 16
#define MAX_16p16 65536
#define MAX_13p2 8192
#define MAX_10p5 1024

 

KFtest->state[0] = 0 * MAX_S16 / MAX_10p5;

 

I got above code in the Vlib examples (VLIB_testKalmanFilter_2x4.c) .

 

Please let me know any manual or document for "SQX.X" . (IQmath Library Maual ? )

 

2. Relate with above 1,  to change form SQ10.5 to IQ15(32bit) , Is it correct way that "_IQ15( KFtest->state[0] * MAX_10p5 / MAX_S16);  " ?

Unfortunatley, there is no example that "how to change SQ10.5 value to IQ15 value".

 

3. IQMath have a efficiency and optimized functions such as "_IQ15toF()".

Is there any good Macro or library that do SQ10.5 to IQ15(32bit) change?