• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: LPCM Downmix Algorithm problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LPCM Downmix Algorithm problem


  • Subject: Re: LPCM Downmix Algorithm problem
  • From: Admiral Quality <email@hidden>
  • Date: Sun, 15 Aug 2010 00:34:36 -0400

On Sun, Aug 15, 2010 at 12:31 AM, Sean Costello <email@hidden> 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.
> To avoid clipping while staying in 16 bits, you want to scale down first,
> sum second.
> Sean Costello

Actually you should sum at a higher bit depth, then do the scale.
Scaling first requires twice as many divisions, and you also
accumulate more error that way.

Mixed-Sample = ((int)Sample1 + Sample2) / 2
 _______________________________________________
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

References: 
 >LPCM Downmix Algorithm problem (From: Bob Ingraham <email@hidden>)
 >Re: LPCM Downmix Algorithm problem (From: uɐıʇəqɐz pnoqɥɒɯ <email@hidden>)
 >Re: LPCM Downmix Algorithm problem (From: Bob Ingraham <email@hidden>)
 >Re: LPCM Downmix Algorithm problem (From: Paul Davis <email@hidden>)
 >Re: LPCM Downmix Algorithm problem (From: Bob Ingraham <email@hidden>)
 >Re: LPCM Downmix Algorithm problem (From: Steve Bird <email@hidden>)
 >Re: LPCM Downmix Algorithm problem (From: Bob Ingraham <email@hidden>)
 >Re: LPCM Downmix Algorithm problem (From: Ryan Walklin <email@hidden>)
 >Re: LPCM Downmix Algorithm problem (From: Sean Costello <email@hidden>)

  • Prev by Date: Re: LPCM Downmix Algorithm problem
  • Next by Date: Sampling the secondary mic?
  • Previous by thread: Re: LPCM Downmix Algorithm problem
  • Next by thread: Re: LPCM Downmix Algorithm problem
  • Index(es):
    • Date
    • Thread