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.

关于IQ格式转换的问题



   在Example_2833xEqep_pos_speed实例中,转速计算中使用到一个IQ格式转换的运算,不是很清楚,请教各位大神。

   在void POSSPEED_Calc(POSSPEED *p)函数中,有一段:

    

tmp = (long)((long)p->theta_raw*(long)p->mech_scaler); // Q0*Q26 = Q26
tmp &= 0x03FFF000;                                                                                                     ————————这是要做什么事情?
p->theta_mech = (int)(tmp>>11); // Q26 -> Q15
p->theta_mech &= 0x7FFF;                                                                                          ————————这又是要干什么?