frac32 rotation angle
frac32buffer in
frac32buffer theta ar
frac32buffer output signal
frac32.u.map rotation angle
int32_t theta;
int32_t Z_1;
theta = 0;
Z_1 = 0;
int32_t dTheta = (inlet_theta_space_kr + param_theta - theta) >> 4;
// jump
if (abs(dTheta) > (1 << 20)) {
theta = inlet_theta_space_kr + param_theta;
dTheta = 0;
}
// linear interpolation of krate theta
theta += dTheta;
uint32_t t = ((uint32_t)(inlet_theta_space_ar + theta)) << 5;
int32_t a = (t & ((1 << 20) - 1)) << 8; // q28
uint32_t i = t >> 20;
int32_t s = ___SMMLA(a, sine2t[i + 1] - sine2t[i], sine2t[i] >> 4);
i = (i + 1024) & 4095;
int32_t c = ___SMMLA(a, sine2t[i + 1] - sine2t[i], sine2t[i] >> 4);
outlet_out = ___SMMLS(Z_1, s, ___SMMUL(inlet_in, c)) << 5;
Z_1 = ___SMMLA(Z_1, c, ___SMMUL(inlet_in, s)) << 5;