DSPRelated.com
Forums

Beginner: Integer FFT and Fixed Point FFT

Started by Karthik Ravikanti May 21, 2005
"Mike Yarwood" <mpyarwood@btopenworld.com> wrote in message 
news:d6t7cj$snq$1@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com...
> > "Helmut Sennewald" <HelmutSennewald@t-online.de> wrote in message > news:d6t5tm$on9$03$1@news.t-online.com... >> "Karthik Ravikanti" <karthik.ravikanti@gmail.com> schrieb im Newsbeitrag >> news:1116863331.721049.221440@f14g2000cwb.googlegroups.com...
<snip>
> Borgerding suggested. There's a whole load of FFTs using number theoretic > transforms which are specifically designed for integer math with no error > and , if you have that sort of background already and you just want to use > them for convolution or correlation, he/she may have something like that > in mind. >
If your prof is not that cruel then http://mti.xidian.edu.cn/multimedia/2002/supp/icassp2001/MAIN/papers/pap100.pdf is possibly a good reference. Best of Luck - Mike
Karthik Ravikanti wrote:
> I can't believe it...this is the first time that I asked a question on > comp.dsp and it went unanswered...:( > > There was good pointer though.:D > > But no one answered my most important questions... > > What is integer-FFT?? > and > What is fixed-point FFT? > > Pleeeeezz answer.....:D > > regards... > > Karthik
Never mind FFT. Do you know the distinction between integer and fixed-point math? It's mostly a matter of interpretation, but it also relates to which bits are retained after a multiplication. For an example of an integer FFT, google for "J&#4294967295;rg's useful and ugly FFT page". Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Jerry Avins wrote:
> > Never mind FFT. Do you know the distinction between integer and > fixed-point math?
> Jerry
Sounds like the lead-in to a "who's on first" routine. Bud: What's the difference between fixed-point and integer processing? Lou: Just a bit. Bud: But what exactly is the difference? Lou: I told you -- just a bit. Bud: Look here. Do you know how to do both types of processing? Lou: Yes. Bud: What do you do differently? Lou: I halve the fixed-point product. Bud: Sure. In the end everyone wants to have a product, but how do you get there. .... --- Mark "I'm an excellent driver" Borgerding
Mark Borgerding wrote:

   ...

> Bud: What's the difference between fixed-point and integer processing? > Lou: Just a bit. > Bud: But what exactly is the difference? > Lou: I told you -- just a bit. > Bud: Look here. Do you know how to do both types of processing? > Lou: Yes. > Bud: What do you do differently? > Lou: I halve the fixed-point product. > Bud: Sure. In the end everyone wants to have a product, but how do you > get there. > > ....
I like that. Frame it! Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Jerry Avins wrote:

> Mark Borgerding wrote: > > ... > >> Bud: What's the difference between fixed-point and integer processing? >> Lou: Just a bit. >> Bud: But what exactly is the difference? >> Lou: I told you -- just a bit. >> Bud: Look here. Do you know how to do both types of processing? >> Lou: Yes. >> Bud: What do you do differently? >> Lou: I halve the fixed-point product. >> Bud: Sure. In the end everyone wants to have a product, but how do you >> get there. >> >> .... > > > I like that. Frame it! > > Jerry
I'm a sucker. I'll bite. What's the difference between fixed-point and integer? I suspect something subtle but significant.
"Richard Owlett" <rowlett@atlascomm.net> wrote in message
news:1196sh38u0kgm10@corp.supernews.com...
> Jerry Avins wrote: > > > Mark Borgerding wrote: > > > > ... > > > >> Bud: What's the difference between fixed-point and integer processing? > >> Lou: Just a bit. > >> Bud: But what exactly is the difference? > >> Lou: I told you -- just a bit. > >> Bud: Look here. Do you know how to do both types of processing? > >> Lou: Yes. > >> Bud: What do you do differently? > >> Lou: I halve the fixed-point product. > >> Bud: Sure. In the end everyone wants to have a product, but how do you > >> get there. > >> > >> .... > > > > > > I like that. Frame it! > > > > Jerry > > I'm a sucker. > I'll bite. > > What's the difference between fixed-point and integer? > > I suspect something subtle but significant.
I'm not sure about the terminology used above, but in the many DSPs, a fixed-point number can be interpreted as either an integer or a fractional value. Assuming a signed 16-bit two's complement representation, the fraction interpretation of the bits means that the number is between -1 and +0.9999694. On the other hand with an integer interpretation, it is between -32768 and +32767. On the SHARC, when you multiply 2 fixed-point numbers together, you can specify for each number if it should be treated as integer or fractional. The difference is simply in the shifting of the result, but obviously it is quite significant to the answer!
in article 1196sh38u0kgm10@corp.supernews.com, Richard Owlett at
rowlett@atlascomm.net wrote on 05/24/2005 14:28:

> > I'm a sucker. > I'll bite. > > What's the difference between fixed-point and integer? > > I suspect something subtle but significant.
only where you put the binary point. for integers, the binary point is always just to the right of the least significant bit. for fixed-point, the binary point is somewhere else, agreed upon in advance or, at least, understood by the programmer. i've done my first digital filtering on a Motorola MC6809 which was an integer machine, yet i had some fixed-point coefficients. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
"Jon Harris" <jon_harrisTIGER@hotmail.com> wrote in
news:1196uts4b5krfe6@corp.supernews.com: 

> "Richard Owlett" <rowlett@atlascomm.net> wrote in message > news:1196sh38u0kgm10@corp.supernews.com... >> Jerry Avins wrote: >> >> > Mark Borgerding wrote: >> > >> > ... >> > >> >> Bud: What's the difference between fixed-point and integer >> >> processing? Lou: Just a bit. >> >> Bud: But what exactly is the difference? >> >> Lou: I told you -- just a bit. >> >> Bud: Look here. Do you know how to do both types of processing? >> >> Lou: Yes. >> >> Bud: What do you do differently? >> >> Lou: I halve the fixed-point product. >> >> Bud: Sure. In the end everyone wants to have a product, but how do >> >> you get there. >> >> >> >> .... >> > >> > >> > I like that. Frame it! >> > >> > Jerry >> >> I'm a sucker. >> I'll bite. >> >> What's the difference between fixed-point and integer? >> >> I suspect something subtle but significant. > > I'm not sure about the terminology used above, but in the many DSPs, a > fixed-point number can be interpreted as either an integer or a > fractional value. Assuming a signed 16-bit two's complement > representation, the fraction interpretation of the bits means that the > number is between -1 and +0.9999694. On the other hand with an integer > interpretation, it is between -32768 and +32767. On the SHARC, when > you multiply 2 fixed-point numbers together, you can specify for each > number if it should be treated as integer or fractional. The > difference is simply in the shifting of the result, but obviously it > is quite significant to the answer! > > >
I'm not sure if Jon's explanation makes the difference clear: If you assume fixed point representation, you normally assume one sign bit and N fractional bits. For example, the Sharc fractional format is typically in 1.31. If the multiplier didn't do anything special, then when you multiplied two 1.31 numbers you would get a result that was in 2.62 format. There would be a redundant sign bit. This is automatically adjusted for by the DSP by a bit shift of 1, so that the result is in 1.63 format and therefore the fractional numbers are interpreted correctly (you often round the result to 1.31 format at some point). Now if you reread Bud and Lou, you will get the joke. -- Al Clark Danville Signal Processing, Inc. -------------------------------------------------------------------- Purveyors of Fine DSP Hardware and other Cool Stuff Available at http://www.danvillesignal.com
Jon Harris wrote:

(snip)

> I'm not sure about the terminology used above, but in the many DSPs, a > fixed-point number can be interpreted as either an integer or a fractional > value. Assuming a signed 16-bit two's complement representation, the fraction > interpretation of the bits means that the number is between -1 and +0.9999694. > On the other hand with an integer interpretation, it is between -32768 and > +32767. On the SHARC, when you multiply 2 fixed-point numbers together, you can > specify for each number if it should be treated as integer or fractional. The > difference is simply in the shifting of the result, but obviously it is quite > significant to the answer!
The computer hardware, of course, doesn't know about the binary point at all. Many high-level languages only provide an integer type and let the user worry about anything else. PL/I, and a small number of other languages, allow one to specify numbers with a wide range of positions of the binary point. One consideration is that library routines know how to read in and print out such values, and arithmetic operations will supply the appropriate shift. For multiply and divide hardware it is very useful to have a multiply that produces a double length product and divide that takes a double length dividend. -- glen
robert bristow-johnson wrote:
> in article 1196sh38u0kgm10@corp.supernews.com, Richard Owlett at > rowlett@atlascomm.net wrote on 05/24/2005 14:28: > > >>I'm a sucker. >>I'll bite. >> >>What's the difference between fixed-point and integer? >> >>I suspect something subtle but significant. > > > only where you put the binary point. for integers, the binary point is > always just to the right of the least significant bit. for fixed-point, the > binary point is somewhere else, agreed upon in advance or, at least, > understood by the programmer. i've done my first digital filtering on a > Motorola MC6809 which was an integer machine, yet i had some fixed-point > coefficients.
Richard, Another term for fixed point, especially when the hardware makes no low-level provision for it, is "scaled integer". Does that sound more familiar? It's a fairly common usage in Forth. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;