• SONAR
  • 64bit floating point vs 64bit fixed point (p.2)
2006/01/09 16:18:42
Master Chief [Cakewalk]
I think in practice 64-bit fixed would be comparable to 64-bit floating. Both representations would necessarily set aside some number of bits for headroom and some for mantissa.

In theory 64-bit float is more precise than 48-bit fixed. But in practice I don't think there is any DSP out there that requires the extra precision.
2006/01/09 16:27:44
attalus

ORIGINAL: mewsicknerd

IMHO, it doesn't really matter. The human ear can't hear distinctions in levels
so fine. Granted, performing many mixing and effect calculations can introduce
errors into the soup. But I doubt anyone could hear the difference.

We would need a massive ear and cognitive upgrades for our hardware to be able
to discern the difference.


I do believe soundcards will improve in near future and a know for a fact there has been serious talk in the music industry about raising the quality of cd from 16bit 44.1 khz to a higher bit and samplerate.Are you going to tell me you don't hear a difference between cd and dvd's? Even now if my memory serves me correctly, there are virtual media players that accept higher quality songs then what cd's accept.
2006/01/09 17:09:44
attalus

ORIGINAL: Ron Kuper [Cakewalk]

I think in practice 64-bit fixed would be comparable to 64-bit floating. Both representations would necessarily set aside some number of bits for headroom and some for mantissa.

In theory 64-bit float is more precise than 48-bit fixed. But in practice I don't think there is any DSP out there that requires the extra precision.



I know that if a souncard where 32bit it would sound better when mixing then 24bit, but what i'm curious about is that you state: " in practice I don't think there is any DSP out there that requires the extra precision." So with a better soundcard in the equation there still is no difference heard far as precision between 64bit floating or 48bit fixed? What type of souncards did you guys use in your testing?


2006/01/09 21:10:19
bogdan
64-bit floating point (IEEE Format) uses 52 bits for mantissa, 1 bit for sign and 11 bits for exponent.

48-bit fixed point (in signed format) would be equivalent to 47-bits of mantissa and 1 sign bit.

So, it is true that 64-bit floats would give you more precision. Real question is, why would you care for 5 bits more precision, once you already have 48 bits?

Floating point is a convenience. It is really useful only if you have to deal with a variety of huge dynamic ranges so you don't have to deal with exponent manually. It's already there for every number you use.

Floating point implementations will generally waste memory and result in slower execution (on most CPU's).

The only real (but very important) advantage of floating point is ease of use. Hence, it is faster to make software that works. It is easier to debug floating point software. Companies will make money faster if they use floating point....

Fixed point is primarily used for real-time hardware implementations. Also, fixed point is used if you want to do something extremely fast (hence, it is used for most real time hardware implementations that have to fit in small memory, or that have to serve many channels in parallel at relatively low cost)

Floating point hardware would cost more and it would end up using considerably more memory and potentially multiple CPU's. Fixed point solutions will always win in terms of speed/memory/power consumption/footprint for real-time hardware solutions. However, the cost of development and later maintenance is much larger. Most of the cost in all these cases would be absorbed by the consumer. That's you!

Generally, it is much harder to master fixed point math and fixed point algorithms than the floating point.

So much about floating point vs. fixed point...

As for what is better, it depends on the skill of the designers and programmers. You have to listen and judge for yourself.

Bottom line: there is no general answer to your question. It depends. (when comparing take into account audio quality, CPU usage, memory usage)

Regards,
Bogdan
2006/01/10 08:17:12
sinc
ORIGINAL: attalus

I know that if a souncard where 32bit it would sound better when mixing then 24bit, but what i'm curious about is that you state: " in practice I don't think there is any DSP out there that requires the extra precision." So with a better soundcard in the equation there still is no difference heard far as precision between 64bit floating or 48bit fixed? What type of souncards did you guys use in your testing?



In practice, most soundcards end up being closer to 20-bit, even if they advertise 24-bit. The last few bits are usually masked by noise in the electronics. So, a 32-bit soundcard is basically insane overkill.

Keep in mind that all mixing happens inside of Sonar, which uses a 32-bit or 64-bit mixing engine (depending on your version and settings). Having a 32-bit soundcard does not affect this.
2006/01/10 09:40:48
Master Chief [Cakewalk]
Floating point implementations will generally waste memory and result in slower execution (on most CPU's).
I am pretty sure floating point is faster than fixed point on Pentium and x64 CPUs, and uses the same amount of memory.

Why faster? To do a fixed-point multiply you must multiply and shift (2 instructions instead of 1 -- though maybe it's all a wash in the CPUs microarchitecture). Then we you add 2 fixed-point numbers you have to manage overflow more carefully, which means you either need extra code to do saturation addition, or you *must* use integer SSE instructions since they provide saturation addition.

Definitely the same memory, because a 32-bit float is the same word size as a 32-bit fixed.
2006/01/10 16:30:55
attalus

ORIGINAL: sinc

ORIGINAL: attalus

I know that if a souncard where 32bit it would sound better when mixing then 24bit, but what i'm curious about is that you state: " in practice I don't think there is any DSP out there that requires the extra precision." So with a better soundcard in the equation there still is no difference heard far as precision between 64bit floating or 48bit fixed? What type of souncards did you guys use in your testing?



In practice, most soundcards end up being closer to 20-bit, even if they advertise 24-bit. The last few bits are usually masked by noise in the electronics. So, a 32-bit soundcard is basically insane overkill.

Keep in mind that all mixing happens inside of Sonar, which uses a 32-bit or 64-bit mixing engine (depending on your version and settings). Having a 32-bit soundcard does not affect this.


I believe 32bit cards would present a hearable difference, just as 24bit sounds way better than 16bit and even tho the mixing takes place in sonar it is not wise to have a 16bit card is it? As far as most studio equipment 24bit 96khz is standard, but i assure you a mark of the unicorn 24bit 192khz sound better than my m-audio delta 66 24bit 96khz wich suggest sound can always be improved khz wise, and far as bit wise the Neve 88D i believe is 40bit floating processing and the ssl is beyond 196 khz bandwidth and i'm quite sure they sound better than my delta 66.But even if i where wrong about increased bit and samplerate, i'd rather live with the overkill than the underachievement!
2006/01/10 17:36:26
raggletaggle

ORIGINAL: attalus
but i assure you a mark of the unicorn 24bit 192khz sound better than my m-audio delta 66 24bit 96khz wich suggest sound can always be improved khz wise,


yes, but how much of that differnce in sound is attributable to better AD/DA converters?


2006/01/11 18:05:46
attalus

ORIGINAL: raggletaggle


ORIGINAL: attalus
but i assure you a mark of the unicorn 24bit 192khz sound better than my m-audio delta 66 24bit 96khz wich suggest sound can always be improved khz wise,


yes, but how much of that differnce in sound is attributable to better AD/DA converters?





I have no doubt converters play there role but i'm sure aswell that the 192khz extra bandwidth plays it's role aswell.I'm sure the same is with the neve 88D 40bit processing and the SSL beyond 192khz bandwith aswell, Im sure they convert better, but i'll bet my right arm that they just plain sound better overall.In the end you have a good point but i'm pretty convinced soundcards can always be improved, and at this point i believe 32bit would be a hearable difference if the converters and the rest of the card is built well!
2006/01/11 20:42:50
bogdan

ORIGINAL: Ron Kuper [Cakewalk]

Floating point implementations will generally waste memory and result in slower execution (on most CPU's).
I am pretty sure floating point is faster than fixed point on Pentium and x64 CPUs, and uses the same amount of memory.


Regarding memory you're wrong. Fixed point implementation (when done correctly), will not use the same number of bits for all variables. It has more flexibility. Also, people often use block floating point for arrays, etc. That saves a lot based on array sizes. If you have a simple algorithm it doesn't really matter what you do, but for more memory intensive algorithms, fixed point will always win.

Regarding execution speed it depends. It depends on the instruction set, ALU structure, existence or not of a barrel shifter and type and number of the accumulators. If you have a single cycle integer MAC operations with a barrel shifter at the output, fixed point would be either faster or the same speed as floating point. (for most algorithms) Sometimes fixed point would require more operations to implement what floating point would do in less. However, based on the number of cycles used and number of memory accesses necessary it is not always easy to guess which one would be faster.

I'm no expert on Pentium instruction set, so I do not know if what I mentioned above is available or not. However, I worked on most existing DSP's since the 1980's including many RISC CPU's. On all of them fixed point was always faster and used considerably less memory. There was no exception.

As for the types of instructions, you should definitely use "integer" instructions for fixed point math. They will be faster. As for the saturation, you shouldn't worry about it much. People who do fixed point for living, know how to deal with it efficiently. Also, most good CPU's know how to handle integer saturation properly. (all DSP CPU's do it for sure)

Finally, 1-bit shift following multiply is only needed for some types of fixed point algorithms. If the CPU does not support implied shift (happens in the same cycle as the multiply) you do not really have to use it. That is, you do not need to use always Q15, Q31 or Q47 number formats, you can use arbitrary Q-formats and keep track of where the format goes, so you adjust only the final results instead of all intermediate products or sums.......

You would be amazed to find out how much faster you can get things to execute with fixed point math. (especially if the CPU architecture enables you to do it with efficient integer operations as mentioned above)

However, I must point out (again), it would come at a price. Highly skilled fixed point DSP programmers (paid considerbly more than a high school floating point "wizz") are not easy to find. Development is harder and takes more time and thinking since the algorithms have to be converted with a lot of care. Debugging is harder and maintenance will cost more.

Regards,
Bogdan
© 2024 APG vNext Commercial Version 5.1

Use My Existing Forum Account

Use My Social Media Account