uint32_t Modul(int32_t Re,int32_t Im)
{
u16 r0,r1,r2,r3;
u32 mdl;
r0 = abs(Re);// & 0x7FFF;
r1 = abs(Im);// & 0x7FFF;
if (r0 >= r1) {
while(r0 > 0x003F){r0 = r0 >> 1;r1 = r1 >> 1;}
r2 = Tab1[r0][r1];
r3 = r2 & 0x00FF;
r0 = r0 & 0x7FFF;
mdl = r0 * r3 >> 8;
mdl += r0;
return mdl;
} else {
while(r1 > 0x003F){r0 = r0 >> 1;r1 = r1 >> 1;}
r2 = Tab1[r1][r0];
r3 = r2 & 0x00FF;
r0 = r1 & 0x7FFF;
mdl = r0 * r3 >> 8;
mdl += r0;
r3 = (r2 & 0xFF00)>>8;
return mdl;
}
{
u16 r0,r1,r2,r3;
u32 mdl;
r0 = abs(Re);// & 0x7FFF;
r1 = abs(Im);// & 0x7FFF;
if (r0 >= r1) {
while(r0 > 0x003F){r0 = r0 >> 1;r1 = r1 >> 1;}
r2 = Tab1[r0][r1];
r3 = r2 & 0x00FF;
r0 = r0 & 0x7FFF;
mdl = r0 * r3 >> 8;
mdl += r0;
return mdl;
} else {
while(r1 > 0x003F){r0 = r0 >> 1;r1 = r1 >> 1;}
r2 = Tab1[r1][r0];
r3 = r2 & 0x00FF;
r0 = r1 & 0x7FFF;
mdl = r0 * r3 >> 8;
mdl += r0;
r3 = (r2 & 0xFF00)>>8;
return mdl;
}
Комментариев нет:
Отправить комментарий