• 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: 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

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: Re: LPCM Downmix Algorithm problem
  • Previous by thread: Re: LPCM Downmix Algorithm problem
  • Next by thread: Re: LPCM Downmix Algorithm problem
  • Index(es):
    • Date
    • Thread