home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!caen!sol.ctr.columbia.edu!sol.ctr.columbia.edu!mhall
- From: mhall@mark1.comp.sys.mac.programmer (Matthew Hall)
- Subject: FAST fixed point math?
- Sender: nobody@ctr.columbia.edu
- Organization: Oberlin College Computer Science
- Date: Fri, 13 Nov 1992 15:46:42 GMT
- Message-ID: <MHALL.92Nov13104642@mark1.comp.sys.mac.programmer>
- Distribution: comp.sys.mac.programmer
- X-Posted-From: mark1.cs.oberlin.edu
- NNTP-Posting-Host: sol.ctr.columbia.edu
- Lines: 41
-
- Hello-
- Right now, I am working on some sound analysis software. I
- want to seperate a sound into frequency bins, which I can do, however
- I do it very slowly. I have tried using the math coprocessor and
- apples built in fixed point math, but either method I choose, the time it takes
- to create to compute each frequency bin is at least as long as the
- sound (and there are enough freqeuncy bins to make this really slow).
-
- The main loop of my procedure is:
- for i:=1 to soundlength do
- begin
- x:=x+samplenumber[i]; {the sample is converted to -128..127 first}
- xTemp:=r*(a*x-b*y);
- y:= r*(b*x+a*y);
- x:=xtemp;
- end;
-
- I disassembled this - I don't think it will get much faster with the
- FPU if I code it in assembly. Maybe twice as fast. However, when I
- disassembled the Fixed point version, I saw that for each
- multiplication, it took 35 operations. With 6 multiplications, plus
- the extra stuff, it was over 250 operations (oops, I just saw myself
- being boneheaded. I can combine r*a and r*b before the loop) well,
- it'll be over 170 operations per sound sample.
- Now, does anyone have any blazingly fast fixed point assembly
- code? I know that fixed point math can be faster than the math
- coprocessor (in this case, with the traps, it was much slower, but I
- have seen programs where it surpassed the math coprocessor by quite a
- margin) It does not need to do any error checking, as my data
- shouldn't cause errors. I would really like to speed this process up.
-
- Thank you,
- matt hall
-
- --
- -------------------------------------------------------------------------------
- Matt Hall. mhall@occs.oberlin.edu OR SMH9666@OBERLIN.BITNET
- (216)-775-6613 (That's a Cleveland Area code. Lucky Me)
-
- F(X)=M*X*(1-X)
-
-