8.24-bit Fixed point Math
8.24-bit Fixed point Math
- Subject: 8.24-bit Fixed point Math
- From: Mark's Studio <email@hidden>
- Date: Sat, 8 Nov 2008 09:55:57 +0100
I know this might be a bit of topic,
but could anyone please explain how to do math on 8.24-bit little-
indian signed integer,
in my original AudioUnit i used this code, how would i convert that to
fixed point 8.24
Float32 omega, sn, cs, alpha;
Float32 a0, a1, a2, b0, b1, b2;
/* setup variables */
omega = 2 * M_PI * freq /srate;
sn = sin(omega);
cs = cos(omega);
alpha = sn * sinh(M_LN2 /2 * bandwidth * omega /sn);
b0 = alpha;
b1 = 0.0f;
b2 = -alpha;
a0 = 1.0f + alpha;
a1 = -2.0f * cs;
a2 = 1.0f - alpha;
/* precompute the coefficients */
Va0 = b0 /a0;
Va1 = b1 /a0;
Va2 = b2 /a0;
Va3 = a1 /a0;
Va4 = a2 /a0;
band = fabsf(Va0 * sample + Va1 * Vx1 + Va2 * Vx2 - Va3 * Vy1 - Va4 *
Vy2);
/* shift x1 to x2, sample to x1 */
Vx2 = Vx1;
Vx1 = sample;
/* shift y1 to y2, result to y1 */
Vy2 = Vy1;
Vy1 = band;
Peter Mark
Mark's Recording Studio A/S
Lundeskovsvej 3
2900 Hellerup
Denmark
Tel: +45 35366078
Fax: +45 35366038
Mobile: +45 20416018
www.marks-studio.dk
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden