Many applications that run on fixed-point MCUs and DSPs use a Q-math library as a substitute for pure floating point math. For example, check out TI's Q-math library for its DSPs. The theory is pretty straight-forward, and you can implement it or a subset yourself.
Go Figure, Dennis -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Moynihan Sent: Friday, May 07, 2004 7:14 AM To: Palm Developer Forum Subject: Re: Floating Piont math on T2 You could multiply the initial values by 100, then use simple integer math, and divide the final result by 100 after all the calcs are done. Depends on how precise you need to be. Bob. LeSalle Munroe wrote: >Thanks Tim > >I realize that the speed of the processor was the issue.. I am not sure if I >can use your approach, because I am just trying to scale audio samples by >different values which is almost always less than 1. I will look into it, >adn if necessary I will just have to write my callback in ARM.. > >Thanks much... >----- Original Message ----- >From: "Tim Kostka" <[EMAIL PROTECTED]> >Newsgroups: palm-dev-forum >To: "Palm Developer Forum" <[EMAIL PROTECTED]> >Sent: Thursday, May 06, 2004 7:04 PM >Subject: Re: Floating Piont math on T2 > > > > >>It is possible that the floating point calculations simply slow down the >>system enough to create the broken sound stream. Floating point >> >> >operations > > >>are SLOW. If you are at all interested in speed, avoid them as best you >>can. In many of my applications I use a fixed decimal point to represent >>floating point numbers (ie: use a UINT32 "2375" to represent "23.75"). >> >> >If > > >>you can get by with this it'll be much quicker, you just have to be >> >> >careful > > >>doing arithmetic operations. >> >>The T3 has a much faster processor than the T2 which could explain why it >>works on one and not the other. >> >>-- >>Tim Kostka >>http://www.nuprograms.com >> >> >>"LeSalle Munroe" <[EMAIL PROTECTED]> wrote in message >>news:[EMAIL PROTECTED] >> >> >>>Hi All >>> >>>I am having a problem with floating point math on the T2. I am try to >>> >>> >>play >> >> >>>sound stream using the sample sound APIs, and when ever I do any kind of >>>floating point arithmitc within my callback it breaks up my stream. Any >>>other computations, even twice as many, don't cause any problems. I run >>> >>> >>the >> >> >>>same code on the T3 without any problems. If anyone has any suggestions >>> >>> >>or >> >> >>>solutions, please help... >>> >>>Thank you.. >>> >>> >>> >>> >>> >> >>-- >>For information on using the Palm Developer Forums, or to unsubscribe, >> >> >please see http://www.palmos.com/dev/support/forums/ > > > > > > > -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/ -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
