Re: Stereo > Mono Downmixing on iOS
Re: Stereo > Mono Downmixing on iOS
- Subject: Re: Stereo > Mono Downmixing on iOS
- From: Roman Thilenius <email@hidden>
- Date: Fri, 01 Apr 2011 01:16:18 +0200
On 31 Mar 2011, at 12:18, Paul Davis wrote:
no, using floating point is far more common in a software context.
this essentially cannot overflow, though there is some (small)
loss of
precision when the summed signal exceeds the range of a signed 24 bit
int.
What you've written here implies that using floats solves the
problem of data overflow whereas using ints doesn't. That is
incorrect.
Sure, if you store 16 bit audio samples in short integers and start
adding them together then you can expect problems when data
overflows! If you store audio samples in floats then the operating
system won't complain about overflows, but the same is true if you
store your data in 32 bit integers with sign extension for negative
values - and you can expect intermediate processing to be faster
using ints.
Whichever type you use, the problem of overflow doesn't go away.
Floats are normalised to the range -0.9999... to +0.9999... so if
you add two values and get a sum >= 1.0 then you've got exactly the
same problem as when the sum of two signed 16 bit samples exceeds
32767. In either case, you've got an invalid audio sample and you
have to decide what to do with it to make it valid again.
Bob
when i was suggesting to use 1 overflow bit per channel that was
more like a philosophical answer to the thread starter, paul is
right that you will normally just use float to sum 2 channels,
even ikf the source was int24.
either the material you sum is already float, or it is not, and if
it is not, of course a 25th bit will definetly be enough to sum
them - yet an engineer still dont do that in practice, because it
is hilarious to convert your 24 bit vectors into 25 bit vectors only
to make sure that you do not clip 3 samples per piece of music -
and that in a personal computer OS or phone OS enviroment. ^^
but about float ... well, there IS a difference. using float32 to sum
up 2 float 32 channels which do not exceed 1.0 literally gives you
_many "overflow bits" - and not just the _one per channel which i
suggested as theoretically required.
when you think about summing in a DAW, the chaos theorem will
explain why float 64 should normally be enough to mix rock music,
even if the user really runs 400 tracks.
only in theory you need one overflow bit (as in "bits of precision")
per channel, but not in real life.
even if the threadstarter wants to sum 2 channels of int 24, doing the
math in int 24 with no headroom at all should be just fine in practice.
-110
_______________________________________________
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