DSPRelated.com
Forums
Online · Live + on demand
February 9-11, 2027
Price goes up Jan 1: register now to lock in today's rate
Register Now →

How do I solve this fixed point problem

Started by John McDermick ●February 3, 2011
John <john@nospam.thanks> wrote:

>>Then a fixed point log function would be: >> >> dout = quant(log(quant(din, N1, M1), N2, M2); >> >> where din, dout are double.
>If a call to log (as above) results in assembly calls to floating point code >(as you confirmed), >then the code is not a fixed point implementation of log, right? Or what am >I missing here???
(I'll assume you're the OP although you have changed email addresses.) I guess what you may be missing is that you are saying you need a C program that exhibits fixed-point behavior, and that is what I'm describing. Something like I suggest is more expeditious than trying to use integer arithmetic and bit manipulation, and is just as exact. Steve
> > I guess what you may be missing is that you are saying you need a C > program that exhibits fixed-point behavior, and that is what I'm > describing. > > Something like I suggest is more expeditious than trying to use > integer arithmetic and bit manipulation, and is just as exact. >
Yes, I am the OP. I am sorry that I didn't clarify what I was looking for. I have my doubts about your claim that your suggestion is expeditious if you're talking about execution speed? Isn't code which involves floating point operations slower than code which only involves bit manipulation and integer arithmetic ?? Or maybe that's just a relic assumption that people (like me) still believe in??
> > I guess what you may be missing is that you are saying you need a C > program that exhibits fixed-point behavior, and that is what I'm > describing. > > Something like I suggest is more expeditious than trying to use > integer arithmetic and bit manipulation, and is just as exact. >
Yes, I am the OP. I am sorry that I didn't clarify what I was looking for. I have my doubts about your claim that your suggestion is expeditious if you're talking about execution speed? Isn't code which involves floating point operations slower than code which only involves bit manipulation and integer arithmetic ?? Or maybe that's just a relic assumption that people (like me) still believe in??
On Feb 3, 9:25&#4294967295;pm, "John" <j...@nospam.thanks> wrote:
> > Popular implementation choices are either a log domain, or a > > Yeah...that's where I am heading...Any pointers to where I can find > a nice log10 and 10^x fixed point algorithm ?? > > Anyone??? Please :o)
what you might want is a nice log2 and 2^x alg. you can do that pretty readily in fixed point and, with the correct scaling, it can be adapted for any base. r b-j