• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: 8.24-bit Fixed point Math
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 8.24-bit Fixed point Math


  • Subject: Re: 8.24-bit Fixed point Math
  • From: Mark's Studio <email@hidden>
  • Date: Sat, 8 Nov 2008 11:28:19 +0100

I am porting an AU to the iPhone,
and since the canonical format is 8.24 on the device,
i thought it might be better to do the processing in that format.


On 08/11/2008, at 10.34, philippe wicker wrote:

I'm also as Tahome wondering why you would want to do something like this.

Anyway you can apply the formula:

  SInt32 sample_8_24 = (SInt32)(16777216.f  * sample);

Where 16777216.f is equal to 2pow24.

On Nov 8, 2008, at 9:55 AM, Mark's Studio wrote:

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:
@mac.com


This email sent to email@hidden


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


  • Follow-Ups:
    • Re: 8.24-bit Fixed point Math
      • From: David Duncan <email@hidden>
References: 
 >8.24-bit Fixed point Math (From: Mark's Studio <email@hidden>)
 >Re: 8.24-bit Fixed point Math (From: philippe wicker <email@hidden>)

  • Prev by Date: Re: 8.24-bit Fixed point Math
  • Next by Date: Audio unit ( Instrument ) Development resources
  • Previous by thread: Re: 8.24-bit Fixed point Math
  • Next by thread: Re: 8.24-bit Fixed point Math
  • Index(es):
    • Date
    • Thread