Re: LPCM Downmix Algorithm problem
Re: LPCM Downmix Algorithm problem
- Subject: Re: LPCM Downmix Algorithm problem
- From: Ryan Walklin <email@hidden>
- Date: Sun, 15 Aug 2010 16:33:19 +1200
On 15/08/2010, at 4:31 PM, Sean Costello wrote: On Aug 14, 2010, at 9:01 PM, Ryan Walklin wrote:
So I tried, in an attempt to "re-scale" the resultant sum back into the 16-bit domain: Mixed-Sample = (Sample1 + Sample2) / 2 But this doesn't work either.
In what way won't it work? This logic seems sound if the sample rates match. You're reducing the volume of both signals to 50% so that there won't be clipping.
In a fixed point system, the order that operations are performed is important. The code above adds the samples together first, then reduces the volume. If the sum of the signals clips or wraps around, the /2 operation will just reduce the volume of the clipped / wrapped waveform, with clipping / wrapping intact.
Good point, I'm used to working with float internally.
-Ryan
To avoid clipping while staying in 16 bits, you want to scale down first, sum second.
Sean Costello
|
_______________________________________________
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