Integer vs Floating Point: Which is Better?

Yoder · 17884

0 Members and 1 Guest are viewing this topic.

Offline Yoder

  • Sr. Member
  • ****
    • Posts: 253
on: March 03, 2012, 01:55:17 PM
It was suggested that I start a new thread to discuss the topic of "Integer Audio vs Floating Point Audio."

For starters, fixed point is the same as an integer (this will help in reading the article). "A value of a fixed-point data type is essentially an integer that is scaled by a specific factor determined by the type. For example, the value 1.23 can be represented as 1230 in a fixed-point data type with scaling factor of 1/1000, and the value 1230000 can be represented as 1230 with a scaling factor of 1000. Unlike floating-point data types, the scaling factor is the same for all values of the same type, and does not change during the entire computation." http://en.wikipedia.org/wiki/Fixed-point_arithmetic I was told that there was less processing involved when using integer values. But, if 1.23 has to be converted to a fixed-point and then manipulated versus a floating point processor that could manipulate 1.23 as it is read, then there is obviously one less computing step...converting the value to a fixed point, and possibly two if it has to be converted back to its original value.

Ever since I became aware of the two different ways of formatting audio numerically I have assumed that floating point would be more accurate. Furthermore, when OS X Lion was released people were up in arms saying that Lion did not support integer audio. I got one of the first versions of Lion for two of my Mac's. On my Mac Book Pro all that is available to the internal speakers is 16, 20, and 24bit Integer that goes up to 96KHz. On my mini that shipped with Lion it uses the same bit depth, plus a 32-bit floating point option, and Encoded Digital Audio. Since getting it I have used the TOSLINK hook-ed up to a DAC or a FW Apogee Duet as my DAC. Even with the internal speakers on integer mode is listed. Since Amarra plays only in native rate, then I cannot flip to Floating Point.

My confusion arose when people started complaining about  how Lion could not handle integer audio. After pursuing it, it was not that Lion could not handle integer audio but that Lion did not have any drivers to support USB devices that could receive integer audio. Don't know if this issue has been resolved or not, but it has always been a matter of USB drivers and not a lack of Lion audio capabilities. I am curious if there is anyone out there using a USB DAC with Lion, and if so, how does it play?

So, in trying to find some objective data on what is better, integer or floating point audio, I came upon the article below. In a nutshell it says that floating point has better resolution, less noise, is easier to develop for, but costs more. The bad news is that industry goes with what cost less. The good news is that a lot of DPS folks have or will be migrating to floating point in the near future. It is good read on where audio is going. The problem for me is that I have not heard any true floating point audio and so cannot compare it to integer.

The article: http://www.dspguide.com/ch28/4.htm



Offline porcupunctis

  • Sr. Member
  • ****
    • Posts: 386
  • 0D3
Reply #1 on: March 03, 2012, 02:16:25 PM
Theoretically, if you stick with integers, your software will have an easier time of it.  There is no reason why you can't have the same resolution either way. 

Imagine that you take the highest peak of a sine wave and the lowest one and measure the distance.  If you measure in meters, you will want lots of decimal places to get good resolution, but if you measure in microns you probably won't need any.  It's all in how you set up the formats and codes.

SACD, by the way, doesn't do things the way other formats do at all.  It only uses ones and zeros and they don't really mean anything in groups like normal computer code.  It has to process the ones and zeros amazingly fast but that's pretty easy for a computer to do.  Computers do amazing things in fractions of a second.

The real question would be how many digits of precision do you get.  Even floating point has a limit on how many real digits of precision it can use before switching to scientific notation and lopping off a certain bit of information.




Randall Massey
Teacher of Mathematics
Lifetime audio-electronics junkie


Offline grufti

  • Sr. Member
  • ****
    • Posts: 320
Reply #2 on: March 03, 2012, 04:51:30 PM
The only format where floating point is typically used is 32-bit. At 32-bit resolution it doesn't matter how you represent audio as far as audio/sound resolution is concerned. Both formats are very close to overkill. The only reason it ever matters is that some DAC's and ADC's use 32-bit floating point as a native format. The conversion is "simple" enough that any modern computer does it in its sleep. Neither one is better, it simply doesn't matter.