Re: AudioConvertor does dither?
Re: AudioConvertor does dither?
- Subject: Re: AudioConvertor does dither?
- From: Doug Wyatt <email@hidden>
- Date: Mon, 3 May 2004 11:00:03 -0700
On May 3, 2004, at 5:55, Ev wrote:
On May 3, 2004, at 12:00 AM, email@hidden
wrote:
Ev,
Currently the AudioConverter does no dithering or noise-shaping and
simply rounds to the nearest integer.
Chris Rogers
Core Audio
Apple Computer
When I use the AudioConvertor to blast my buffers from floating
point data to whatever stock bit depth I need, is there any sort of
dithering action done during the conversion?
If so, what kind of dithering is it? Is it noise-shaped at all?
Triangular?
OK, knowing that then, is there any need for dithering code anywhere
in this process then? Can/should I modify the results?
I've seen bits of sample code dealing with dither that is all about
the translation from floating point to integer, just adding a
particular noise at the resulting bit depth's lowest level, so the
rounding isn't so expected. I've heard examples of it, and I see the
point.
Should I be doing this to my floating point numbers before I feed them
to the AudioConvertor? Or is the floating point number, by nature,
dithering in itself and it's just not necessary?
Does anyone have any suggestion?
As for when to dither: If you are recording, the driver will have
received 16 or 24-bit integers and converted them to float, which is a
perfectly accurate conversion for 24 bits and less. There's no need to
dither when you convert back from float to int for saving in a file. On
playback, the driver is ultimately going to be responsible for
converting your floats to ints. I don't know if any drivers do dither
at this stage of the process, that's an interesting ball of wax. If the
driver doesn't dither (and I don't believe you have a way to know
without asking the manufacturer), then you might consider dithering
your floats based on the device's bit depth (though for 24-bit I
suspect it's not worth the trouble -- or someone will correct me if I'm
wrong :-).
In cases where you want dithering, yes, you could add noise to your
floats.
It's conceivable that a future version of AudioConverter would
implement dithering, but it would almost certainly have to be turned on
explicitly by the client, both to preserve the current behavior and to
allow the client to make the decision about whether to incur the extra
computational overhead.
--
Doug Wyatt
Core Audio, Apple
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.