Re: 64bit processing - Why?
Re: 64bit processing - Why?
- Subject: Re: 64bit processing - Why?
- From: Ethan Funk <email@hidden>
- Date: Thu, 30 Jul 2009 17:57:07 -0700
I have been found out: My background is analog RF design!
I hope I have not miss understood: we are talking about the numeric
format used *between* processing units not the format used within the
unit correct?
I have no complaint about using double precision numbers were non-
linear, large coefficient array FIR or recursive IIR DSP operations
are being performed. In such situation, it may be and often is called
for. But why force all the other simple summing and scaling that goes
on in the chain before and after to be double precision just for the
sake of a section of DSP code that needed the precision internally? I
bet the overhead of doing a double to single with dither before coming
out of a piece of DSP code is small compared to having to drag doubles
thought the whole audio chain.
If I go from single to double, then *dither* back to single, I don't
lose anything from the original single. I should be able to do that
over and over again with out degradation correct? Or is my assumption
wrong - is the dither "noise" additive?
Ethan...
On Jul 30, 2009, at 5:07 PM, Brian Willoughby wrote:
I will try to be brief (which is uncharacteristic for me, I admit).
There are more factors than simple dynamic range, and it depends
highly upon the type of processing that you're doing.
First of all, analog dynamic range is not precisely equivalent to
digital dynamic range. Analog noise is generally gaussian in
nature, is typically completely uncorrelated to the signal, and the
human hearing system (which includes the brain as well as the ear
organs) has amazing abilities to ignore such noise. Not only can
'analog' noise be ignored, but we can clearly hear signals that are
well below the noise floor. An analog tape deck with little more
than 60 dB still preserves audible signals well below -60 dB.. IN
contrast, digital quantization noise is correlated to the signal, is
not present in natural sounds, and the human hearing system does not
have the same ability to disregard such noise. On top of that,
undithered A/D or bit reduction will completely lose signals that
are below the quantization noise floor. They're simply missing -
not bathed in noise: but gone. Thus, high-end audio gear has maybe
110 dB or 120 dB of dynamic range at the analog output, and that's
more than enough. However, this doesn't mean you can simply drop
below 24 bits on your DAC without careful processing. We generally
design with a 24-bit system, partly for convenience, but also
because you need more digital dynamic range than analog.
All of the figures that you mentioned, Ethan, would be relevant in
the analog domain. Experts in the field say that fully mastered
digital audio only needs less than 20 bits of D/A for listening in
an average room. But these figures require that absolutely no
processing be done on the digital data. CoreAudio is designed to
allow all manner of processing, so it simply would not be acceptable
to drop the whole system to 20 bits simply because that would
suffice for the final output stage. Mac OS X is designed for
production work as well as consumer entertainment, and the needs are
different.
If you step to the next level, from playback-only to recording and
playback, then 24 bits is certainly sufficient for capturing a wide
range of analog input signals, preserving their quality, and playing
them back without excessive distortion or noise. Again, this
scenario for which 24 bits is adequate is only a small subset of
what is possible with CoreAudio.
When you take things to the ultimate, where any kind of processing
on the digital audio is allowed, from summing to gain to dynamics
processing to filtering and beyond, then there is mathematical and
empirical support for utilizing well more than 24 bits. I won't go
into the details of filter design for minimal quantization and
overflow errors, but suffice it to say that double-precision SRC and
double-precision EQ sound better. Single-precision processing
involves truncation of bits that are generated by multiplication and
division (but not addition and subtraction, to the same degree), and
truncation causes low-level signals to be completely lost in the
digital realm (unless dithered) as opposed to merely sharing the
spectrum with louder noise as happens in the analog domain.
In other words, what's more than adequate for playback (20 bits),
and what's adequate for recording (24 bits), is not necessarily
sufficient for all the possible processing that is allowed by
CoreAudio. Fortunately, Apple were thinking ahead and designed for
this. Whether it's needed in the drivers or not remains to be seen,
but it certainly would be useful to pass double precision sample
streams between AudioUnits, and CoreAudio allows that.
Brian Willoughby
Sound Consulting
On Jul 30, 2009, at 16:38, Ethan Funk wrote:
First off, I would like to weight in on this discussion by pointing
out that the sign bit has the same effect on the dynamic range of a
binary number as any of the other bits. The sign bit allows the
number to handle positive AND negative range - this doubles the
unsigned scalar range, adding 6 dB in the log scale, just like any
other bit.
Second, I'd like to know who (other than people from marketing
departments) need audio dynamic ranges in excess of 144 dB. I am
sure no one from this list has ever experience 144 dB of acoustic
dynamic range. If you would like to experience this your self, find
an audio amp that has more than 144 dB of dynamic range (good luck),
hook it up to some speakers and turn the volume up with no audio
input until you hear some hiss from the amp. You may need to get
close to the speaker for this. Step back from the speakers a bit
until you can't hear the hiss any more. If the room you are in is
very, very quiet, you are now experiencing 0 dBA of sound pressure -
just less than the least significant bit in a binary number
representing audio data.
Now send a 1 to 2 kHz tone into the amplifier. It should be 1 to 2
kHz because this is the frequency range where your ears have the
widest dynamic range. Slowly turn up the tone level going into the
amplifier until your ears hurt. You are now experiencing
approximately 100 dBA of sound pressure. Raise the tone level
another 20 dB. Now, at the 120 dBA of sound pressure your are
experiencing, you have permanently damage your hearing, and your
neighbors are calling the FAA because they think a jet plane is
landing on their street. But wait, you still have another 24 dB to
go before a 32 bit single precision binary float number runs out of
range. So if by some amazing chance, you have not yet destroyed
your speakers and your amplifier is not yet clipping, turn it up
another 24 dB... Yes, 24 dB above where you damaged your hearing.
Once you get to 144 dBA of sound pressure, that's 251 time more
power than the damaging 120 dBA, I would imaging blood would be drip
from your punctured ear drums and you would be signing up for a
course in ASL (American Sign Language).
And remember, this was with the amplifier turned up high enough that
you could almost hear the noise with no audio input - the level just
below where you would actually hear the least significant bit.
The folks at Apple appear to have understood the human limits when
they choose single precision floats. Why waste processor resources
with doubles when it would require the humans to evolve a great
deal, not the machines, for the benefit to be appreciated.
Ethan...
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden