Forums

Audio Mixing using DSP

Started by jadhav_rahul July 7, 2008
Hello everyone,
              i want to implement audio mixing for call conference with
PCM encoded voice channels, 
I want to know how audio mixing is done by DSP ?  and any suitable
algorithm or document for it.
also plz guide me how to proceed for its implementation?

Thanks in advance,

Rahul Jadhav.


On Jul 7, 8:35&#2013266080;am, "jadhav_rahul" <rahul.jad...@spectross.com> wrote:
> Hello everyone, > &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080; i want to implement audio mixing for call conference with > PCM encoded voice channels, > I want to know how audio mixing is done by DSP ? &#2013266080;and any suitable > algorithm or document for it. > also plz guide me how to proceed for its implementation? > > Thanks in advance, > > Rahul Jadhav.
Depends on the PCM. If it is not companded or otherwise encoded, just add the streams together with scaling (if necessary) to prevent overflow. If companded such is commonly the case with telephony (mu- law or A-law), convert to linear, add and then convert back. If your streams are ADPCM, then you have more work ahead of you. Clay
>On Jul 7, 8:35=A0am, "jadhav_rahul" <rahul.jad...@spectross.com> wrote: >> Hello everyone, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 i want to implement audio mixing for call
con=
>ference with >> PCM encoded voice channels, >> I want to know how audio mixing is done by DSP ? =A0and any suitable >> algorithm or document for it. >> also plz guide me how to proceed for its implementation? >> >> Thanks in advance, >> >> Rahul Jadhav. > >Depends on the PCM. If it is not companded or otherwise encoded, just >add the streams together with scaling (if necessary) to prevent >overflow. If companded such is commonly the case with telephony (mu- >law or A-law), convert to linear, add and then convert back. If your >streams are ADPCM, then you have more work ahead of you. > >Clay >
Thanks clay, I have one doubt, suppose we have conference between 3 users (PCM encoded voice channels) then we add the streams together with scaling but data which a user can receive will include his own voice information also or i think we should substract his info. from the combined data, also as the total sum of scaling factors should be 1 how we decide these scaling factors becoz these factors decides audio gain of each channel? regards, Rahul.
>>On Jul 7, 8:35=A0am, "jadhav_rahul" <rahul.jad...@spectross.com> wrote: >>> Hello everyone, >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 i want to implement audio mixing for call >con= >>ference with >>> PCM encoded voice channels, >>> I want to know how audio mixing is done by DSP ? =A0and any suitable >>> algorithm or document for it. >>> also plz guide me how to proceed for its implementation? >>> >>> Thanks in advance, >>> >>> Rahul Jadhav. >> >>Depends on the PCM. If it is not companded or otherwise encoded, just >>add the streams together with scaling (if necessary) to prevent >>overflow. If companded such is commonly the case with telephony (mu- >>law or A-law), convert to linear, add and then convert back. If your >>streams are ADPCM, then you have more work ahead of you. >> >>Clay >> >Thanks clay, > I have one doubt, suppose we have conference between 3 users (PCM >encoded voice channels) then we add the streams together with scaling but
>data which a user can receive will include his own voice information
also
>or i think we should substract his info. from the combined data, >also as the total sum of scaling factors should be 1 how we decide these >scaling factors becoz these factors decides audio gain of each channel? > >regards, >Rahul. >
HI, Is it correct that more the number of channels less will be the received strength of the combined voice? Rahul
jadhav_rahul wrote:
>>> On Jul 7, 8:35=A0am, "jadhav_rahul" <rahul.jad...@spectross.com> wrote: >>>> Hello everyone, >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 i want to implement audio mixing for call >> con= >>> ference with >>>> PCM encoded voice channels, >>>> I want to know how audio mixing is done by DSP ? =A0and any suitable >>>> algorithm or document for it. >>>> also plz guide me how to proceed for its implementation? >>>> >>>> Thanks in advance, >>>> >>>> Rahul Jadhav. >>> Depends on the PCM. If it is not companded or otherwise encoded, just >>> add the streams together with scaling (if necessary) to prevent >>> overflow. If companded such is commonly the case with telephony (mu- >>> law or A-law), convert to linear, add and then convert back. If your >>> streams are ADPCM, then you have more work ahead of you. >>> >>> Clay >>> >> Thanks clay, >> I have one doubt, suppose we have conference between 3 users (PCM >> encoded voice channels) then we add the streams together with scaling but > >> data which a user can receive will include his own voice information > also >> or i think we should substract his info. from the combined data, >> also as the total sum of scaling factors should be 1 how we decide these >> scaling factors becoz these factors decides audio gain of each channel? >> >> regards, >> Rahul. >> > > HI, > Is it correct that more the number of channels less will be the received > strength of the combined voice?
Yes, if the scaling allows for all users talking simultaneously. There are other design decisions that can be made. Jerry -- Engineering is the art of making what you want from things you can get. &#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;
>jadhav_rahul wrote: >>>> On Jul 7, 8:35=A0am, "jadhav_rahul" <rahul.jad...@spectross.com>
wrote:
>>>>> Hello everyone, >>>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 i want to implement audio mixing for
call
>>> con= >>>> ference with >>>>> PCM encoded voice channels, >>>>> I want to know how audio mixing is done by DSP ? =A0and any
suitable
>>>>> algorithm or document for it. >>>>> also plz guide me how to proceed for its implementation? >>>>> >>>>> Thanks in advance, >>>>> >>>>> Rahul Jadhav. >>>> Depends on the PCM. If it is not companded or otherwise encoded,
just
>>>> add the streams together with scaling (if necessary) to prevent >>>> overflow. If companded such is commonly the case with telephony (mu- >>>> law or A-law), convert to linear, add and then convert back. If your >>>> streams are ADPCM, then you have more work ahead of you. >>>> >>>> Clay >>>> >>> Thanks clay, >>> I have one doubt, suppose we have conference between 3 users
(PCM
>>> encoded voice channels) then we add the streams together with scaling
but
>> >>> data which a user can receive will include his own voice information >> also >>> or i think we should substract his info. from the combined data, >>> also as the total sum of scaling factors should be 1 how we decide
these
>>> scaling factors becoz these factors decides audio gain of each
channel?
>>> >>> regards, >>> Rahul. >>> >> >> HI, >> Is it correct that more the number of channels less will be the
received
>> strength of the combined voice? > >Yes, if the scaling allows for all users talking simultaneously. There >are other design decisions that can be made. > >Jerry >-- >Engineering is the art of making what you want from things you can get. >??????????????????????????????????????????????????????????????????????? >
Thanks jerry, but which other design decisions you are talking about? Rahul.
jadhav_rahul wrote:

   ...

> Thanks jerry, > but which other design decisions you are talking about? > Rahul.
You can dynamically adjust the scaling to allow any sum. (Dynamic compression.) You can allow enough headroom for two people to shout at each other, but no more. Clipping overloads would be better than wrapping around, but either works. There is not much reason to allow for everyone talking at once because it wouldn't be intelligible anyway. Jerry -- Engineering is the art of making what you want from things you can get. &#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;
>jadhav_rahul wrote: > > ... > >> Thanks jerry, >> but which other design decisions you are talking about? >> Rahul. > >You can dynamically adjust the scaling to allow any sum. (Dynamic >compression.) You can allow enough headroom for two people to shout at >each other, but no more. Clipping overloads would be better than >wrapping around, but either works. There is not much reason to allow for
> everyone talking at once because it wouldn't be intelligible anyway. > > >Jerry >-- >Engineering is the art of making what you want from things you can get. >???????????????????????????????????????????????????????????????????????
>Thanks jerry
what should be the level of buffering (of decompressed voice data) before adding them? i mean in case of y[n]=a.x1[n]+b.x2[n]+c.x3[n] we have to buffer all the inputs or we can add first two and buffer the result to add with third one? which one will be better? is there any standard algorithm availabe for entire processing? Thanks in advance, Rahul
On Jul 8, 12:11&#2013266080;am, "jadhav_rahul" <rahul.jad...@spectross.com> wrote:

> &#2013266080; &#2013266080; &#2013266080; I have one doubt, suppose we have conference between 3 users (PCM > encoded voice channels) then we add the streams together with scaling but > data which a user can receive will include his own voice information also > or i think we should substract his info. from the combined data, > also as the total sum of scaling factors should be 1 how we decide these > scaling factors becoz these factors decides audio gain of each channel?
Search for "automixer" and "mix-minus". Greg
jadhav_rahul wrote:
>> jadhav_rahul wrote: >> >> ... >> >>> Thanks jerry, >>> but which other design decisions you are talking about? >>> Rahul. >> You can dynamically adjust the scaling to allow any sum. (Dynamic >> compression.) You can allow enough headroom for two people to shout at >> each other, but no more. Clipping overloads would be better than >> wrapping around, but either works. There is not much reason to allow for > >> everyone talking at once because it wouldn't be intelligible anyway. >> >> >> Jerry >> -- >> Engineering is the art of making what you want from things you can get. >> ??????????????????????????????????????????????????????????????????????? > >> Thanks jerry > what should be the level of buffering (of decompressed voice data) before > adding them? > i mean in case of y[n]=a.x1[n]+b.x2[n]+c.x3[n] > we have to buffer all the inputs or we can add first two and buffer the > result to add with third one? > which one will be better? > is there any standard algorithm availabe for entire processing? > Thanks in advance,
Getting the result with minimum delay is the only important point. Assuming that the data are already in linear twos-complement form (what I think you mean by "PCM"), I would add first and scale the result back to the allowed bit count. The computer can add only two numbers in one operation. That may be obscured by a high-level language, but the processor isn't fooled by fancy notation. :-) Jerry -- Engineering is the art of making what you want from things you can get. &#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;