Re: LPCM Downmix Algorithm problem
Re: LPCM Downmix Algorithm problem
- Subject: Re: LPCM Downmix Algorithm problem
- From: Brian Willoughby <email@hidden>
- Date: Sun, 15 Aug 2010 12:18:45 -0700
On Aug 14, 2010, at 19:48, Bob Ingraham wrote:
To mix two 16-bit-signed samples:
MixedSample = Sample1 + Sample2 - (Sample1 * Sample2);
That's it? I don't have to apply and clamping or range checking or
envelope manipulation or FFT conversion to the frequency domain or
something like that?
I read two single-channel LPCM sources, and for each sample from
each source perform the above equation and I should expect to hear
a crystal-clear, non-static combo of both sounds?
That algorithm will not be clear at all. Any time you multiply two
sources, you end up with a "mix" that includes the sums and
differences of all the source frequencies. The result is very
inharmonic. Even though you're subtracting the product, it's the
same as adding a polarity-inverted signal. Basically, what you have
is heterodyning, or FM. It's the furthest thing from a crystal-clear
mix.
I think that the remainder of this thread has answered your
questions. It also seems that you're working on iOS, where the DSP
requires more advanced understanding of the format of the samples.
Fixed-point DSP is not trivial, whether on CoreAudio or elsewhere.
Brian Willoughby
Sound Consulting
_______________________________________________
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