Hello Friends, what is the advantage of using fixed point numbers in DSP calculations ? Could anybody explain, why digital signal processors use it instead of integers ? Best regards Roman Rumian
Why fixed point ?
Started by ●March 11, 2006
Reply by ●March 11, 20062006-03-11
Roman Rumian <usun_torumian@agh.edu.pl> writes:> Hello Friends, > > what is the advantage of using fixed point numbers in DSP calculations ? > Could anybody explain, why digital signal processors use it instead of > integers ?Power, cost, board-area. -- % Randy Yates % "Though you ride on the wheels of tomorrow, %% Fuquay-Varina, NC % you still wander the fields of your %%% 919-577-9882 % sorrow." %%%% <yates@ieee.org> % '21st Century Man', *Time*, ELO http://home.earthlink.net/~yatescr
Reply by ●March 11, 20062006-03-11
Hi Randy, Randy Yates napisa�(a):> Roman Rumian <usun_torumian@agh.edu.pl> writes: > >> Hello Friends, >> >> what is the advantage of using fixed point numbers in DSP calculations ? >> Could anybody explain, why digital signal processors use it instead of >> integers ? > > Power, cost, board-area.I compare FIXED (not float) point representation with integer one. Fixed point multiplication needs one operation (shift left) more, as the point position is not "neutral". So, why ? Kind regards Roman Rumian
Reply by ●March 11, 20062006-03-11
Hi Randy, Randy Yates napisa�(a):> Roman Rumian <usun_torumian@agh.edu.pl> writes: > >> Hello Friends, >> >> what is the advantage of using fixed point numbers in DSP calculations ? >> Could anybody explain, why digital signal processors use it instead of >> integers ? > > Power, cost, board-area.I compare FIXED (not float) point representation with integer one. Fixed point multiplication needs one operation (shift left) more, as the point position is not "neutral". So, why ? Kind regards Roman Rumian
Reply by ●March 11, 20062006-03-11
Randy, Were you answering fixed point vs floating point or fixed point vs integers? Dirk Randy Yates wrote:> Roman Rumian <usun_torumian@agh.edu.pl> writes: > > > Hello Friends, > > > > what is the advantage of using fixed point numbers in DSP calculations ? > > Could anybody explain, why digital signal processors use it instead of > > integers ? > > Power, cost, board-area. > -- > % Randy Yates % "Though you ride on the wheels of tomorrow, > %% Fuquay-Varina, NC % you still wander the fields of your > %%% 919-577-9882 % sorrow." > %%%% <yates@ieee.org> % '21st Century Man', *Time*, ELO > http://home.earthlink.net/~yatescr
Reply by ●March 11, 20062006-03-11
"dbell" <dbell@niitek.com> writes:> Randy, > > Were you answering fixed point vs floating point or fixed point vs > integers? > > DirkFixed vs. floating. I didn't read the last line, which is all the poster wrote about integers - i.e., it's not in the subject, and it's not in the body except for the last line. -- % Randy Yates % "The dreamer, the unwoken fool - %% Fuquay-Varina, NC % in dreams, no pain will kiss the brow..." %%% 919-577-9882 % %%%% <yates@ieee.org> % 'Eldorado Overture', *Eldorado*, ELO http://home.earthlink.net/~yatescr
Reply by ●March 11, 20062006-03-11
Roman Rumian <usun_torumian@agh.edu.pl> writes:> Hi Randy, > > Randy Yates napisa�(a): >> Roman Rumian <usun_torumian@agh.edu.pl> writes: >> >>> Hello Friends, >>> >>> what is the advantage of using fixed point numbers in DSP calculations ? >>> Could anybody explain, why digital signal processors use it instead of >>> integers ? >> Power, cost, board-area. > > I compare FIXED (not float) point representation with integer one. > Fixed point multiplication needs one operation (shift left) more, as > the point position is not "neutral". So, why ?In order to preserve as much precision as possible. If you use the same representation (e.g., integer, or A(15,0)) for all values, then depending on the values, you could lose a lot of precision. Take a simple example. Let's say you're using a 16-bit integer machine and you want to represent the value x = 3.27. If you stick with integers, you can only represent this as x' = 3. Your "quantization error" is q = x' - x = 3/2^0 - 3.27 = -0.27 If, however, you choose to represent x using A(2,13), then x' = round(x*2^13)/2^13 = 26788 / 8192 = 3.270019531 and q = x' - x = 3.270019531 - 3.27 = 0.000019531 Which value would you rather use for your x-ray dosage/guided missile navigation/radar tracking system/etc.? -- % Randy Yates % "How's life on earth? %% Fuquay-Varina, NC % ... What is it worth?" %%% 919-577-9882 % 'Mission (A World Record)', %%%% <yates@ieee.org> % *A New World Record*, ELO http://home.earthlink.net/~yatescr
Reply by ●March 11, 20062006-03-11
Roman Rumian <usun_torumian@agh.edu.pl> wrote in news:duuu1a$ntq$1@news.agh.edu.pl:> Hi Randy, > > Randy Yates napisa�(a): >> Roman Rumian <usun_torumian@agh.edu.pl> writes: >> >>> Hello Friends, >>> >>> what is the advantage of using fixed point numbers in DSP >>> calculations ? Could anybody explain, why digital signal processors >>> use it instead of integers ? >> >> Power, cost, board-area. > > I compare FIXED (not float) point representation with integer one. > Fixed point multiplication needs one operation (shift left) more, as > the point position is not "neutral". So, why ? > > Kind regards > > Roman Rumian > >If the questions is fixed (which I take to mean fractional) versus Integer, there is only one real difference. In fractional, we typically assume 1 sign bit and N-1 fractional bits. In ADI parlance a 32 bit fractional number might be represented as 1.31. If we multiply two 1.31 format numbers, we would get a result in 2.62 format. There is a redundant sign bit. This is not usually desirable, so the the MAC shifts the result by 1 bit to 1.63 format. This makes the most significant part of the result to have the same scaling as the inputs. Most DSPs can switch the MAC to use either Integer or Fractional Format. If you didn't have a fractional format natively, you could add a SHIFT instruction. -- Al Clark Danville Signal Processing, Inc. -------------------------------------------------------------------- Purveyors of Fine DSP Hardware and other Cool Stuff Available at http://www.danvillesignal.com
Reply by ●March 11, 20062006-03-11
Roman Rumian wrote:> what is the advantage of using fixed point numbers in DSP calculations ? > Could anybody explain, why digital signal processors use it instead of > integers ?Isn't the main difference only a matter of units and scaling? Fixed point representation is just a form of scaled integers. Given the same number of bits, using smaller units give you greater precision at the cost of less total range. Some measurements or calculations are more convenient in klometers, some are more accurate in microns. IMHO. YMMV. -- rhn A.T nicholson d.0.t C-o-M
Reply by ●March 11, 20062006-03-11
Hi, Randy Yates napisa�(a): (...)> In order to preserve as much precision as possible. > > If you use the same representation (e.g., integer, or A(15,0)) for all > values, then depending on the values, you could lose a lot of > precision. > > Take a simple example. Let's say you're using a 16-bit integer machine > and you want to represent the value x = 3.27. If you stick with integers, > you can only represent this as x' = 3. Your "quantization error" is > > q = x' - x > = 3/2^0 - 3.27 > = -0.27 > > If, however, you choose to represent x using A(2,13), then > > x' = round(x*2^13)/2^13 > = 26788 / 8192 > = 3.270019531 > > and > > q = x' - x > = 3.270019531 - 3.27 > = 0.000019531 > > Which value would you rather use for your x-ray dosage/guided missile > navigation/radar tracking system/etc.?Hmmm ... This is not good explanation, because we can assume ANY point position (to preserve precision), and the difference is only in multiply results correction (we always use integer multiply unit). Only besfore MSB or after LSB position of comma, ("neutral") no correction shift is needed. If you assume, on example, A(q,r) format, then, after multiplication you get A(2g,2r) result, so you need shift it q bits left to get correct A(q,r) result. Only q=0 and r=0 cases are shiftless, so why not use integer (r=0) format ? Scaling is not a problem, as you have just 16 bits from A/D converter and you can use them directly in fixed point as well signed integer calculation (you can assume ANY point possition). Hope, you better understand my doubts. :-) Best regards Roman Rumian






