DSPRelated.com
Forums

Input for G729 and G723 from U/A law PCM code.

Started by zhang_zhh June 27, 2003
Hi all,

I have a simple question: according to the G729/G723 spec, the
input buffer should be 16bit linear PCM code, but the decode of U/A
law PCM is 14/13 bit linear code, do I just need shift 2/3 bit before
call the G729/G723 codec? What is the standard method to handle this?
Thanks in advance!

Best Regards,
William




Thank you!
You are right on the bandwidth caculation.

I am just wonderring how to handle the 16 input
requirement for G723/G729 codec when I only have A/U
PCM input for example I have a TDM backplane running
u-law voice data. Before I can put the voice data to
g723 encoder, I need decode the u-law to linear. But
it is only 14 bit. If I just throw this 14 bit to the
encoder and the encoded data is sent to another system
in a typical VoIP gateway application. And
unfortunately that system is running a A-law TDM
backplane, so it will decode G723 data and obviously
it will still be 14 bit resolution, but if these 14
bit resolution linear code is then encoded to A-law
PCM to TDM bus, they is 6db gain since A-law only have
13 bit maximum linear resolution!

So it seems to me there must be something to normalize
the A/U linear code before call vocoder. I just don't
know what is standard way to that. I could be wrong
in my unstanding, correct me if any.
Thanks!

Best Regards,
William
--- pooja sugathan <> wrote:
> hi,
> i am no athority to say much about it, but i m
> going thru g723.1. What i understood is that in
> g723.1 the input to encoder is 16 bit and the
> compressed data is in 8 bit format, this 8 bit and
> the additional crc bits bring it to 10 bit...
> what brought me to decide on this is that
> (8*24)/30ms=6.4kbps which is the encoded rate, and
> the input to the encoder being (16*240)/30ns=
> 128kbps.
>
> if i m wrong kindly correct
> thank you.
>
> zhang_zhh <> wrote:
> Hi all,
>
> I have a simple question: according to the G729/G723
> spec, the
> input buffer should be 16bit linear PCM code, but
> the decode of U/A
> law PCM is 14/13 bit linear code, do I just need
> shift 2/3 bit before
> call the G729/G723 codec? What is the standard
> method to handle this?
> Thanks in advance!
>
> Best Regards,
> William >
>
> ------------------------ Yahoo! Groups Sponsor
>
> _____________________________________
> Note: If you do a simple "reply" with your email
> client, only the author of this message will receive
> your answer. You need to do a "reply all" if you
> want your answer to be distributed to the entire
> group.
>
> _____________________________________
> About this discussion group:
>
> To Join:
>
> To Post:
>
> To Leave:
>
> Archives:
> http://www.yahoogroups.com/group/speechcoding
>
> Other DSP-Related Groups: http://www.dsprelated.com > ">http://docs.yahoo.com/info/terms/ >
>
> ---------------------------------
> Want to chat instantly with your online
friends?&#29149;et
> the FREE Yahoo!Messenger


__________________________________



mu-law/a-law to linear conversion (16 bits) is the decoder part of
G.711 PCM coder. ITU has standard (called ITU G.711 ) for it. You
should be able to download it from ITU. ITU also provide test
vectors for the mu/a-law to linear conversion and linear to mu/a-law
conversion. If you want your system communicating with other
vendor's system through TDM bus, you have to pass the test vector
bit-exactness test.

--- In , Zhang Zhenghao <zhang_zhh@y...>
wrote:
> Thank you!
> You are right on the bandwidth caculation.
>
> I am just wonderring how to handle the 16 input
> requirement for G723/G729 codec when I only have A/U
> PCM input for example I have a TDM backplane running
> u-law voice data. Before I can put the voice data to
> g723 encoder, I need decode the u-law to linear. But
> it is only 14 bit. If I just throw this 14 bit to the
> encoder and the encoded data is sent to another system
> in a typical VoIP gateway application. And
> unfortunately that system is running a A-law TDM
> backplane, so it will decode G723 data and obviously
> it will still be 14 bit resolution, but if these 14
> bit resolution linear code is then encoded to A-law
> PCM to TDM bus, they is 6db gain since A-law only have
> 13 bit maximum linear resolution!
>
> So it seems to me there must be something to normalize
> the A/U linear code before call vocoder. I just don't
> know what is standard way to that. I could be wrong
> in my unstanding, correct me if any.
> Thanks!
>
> Best Regards,
> William
> --- pooja sugathan <pooja_sugathan@y...> wrote:
> > hi,
> > i am no athority to say much about it, but i m
> > going thru g723.1. What i understood is that in
> > g723.1 the input to encoder is 16 bit and the
> > compressed data is in 8 bit format, this 8 bit and
> > the additional crc bits bring it to 10 bit...
> > what brought me to decide on this is that
> > (8*24)/30ms=6.4kbps which is the encoded rate, and
> > the input to the encoder being (16*240)/30ns=
> > 128kbps.
> >
> > if i m wrong kindly correct
> > thank you.
> >
> > zhang_zhh <zhang_zhh@y...> wrote:
> > Hi all,
> >
> > I have a simple question: according to the G729/G723
> > spec, the
> > input buffer should be 16bit linear PCM code, but
> > the decode of U/A
> > law PCM is 14/13 bit linear code, do I just need
> > shift 2/3 bit before
> > call the G729/G723 codec? What is the standard
> > method to handle this?
> > Thanks in advance!
> >
> > Best Regards,
> > William
> >
> >
> >
> >
> > ------------------------ Yahoo! Groups Sponsor
> >
> > _____________________________________
> > Note: If you do a simple "reply" with your email
> > client, only the author of this message will receive
> > your answer. You need to do a "reply all" if you
> > want your answer to be distributed to the entire
> > group.
> >
> > _____________________________________
> > About this discussion group:
> >
> > To Join:
> >
> > To Post:
> >
> > To Leave:
> >
> > Archives:
> > http://www.yahoogroups.com/group/speechcoding
> >
> > Other DSP-Related Groups: http://www.dsprelated.com
> >
> >
> > ">http://docs.yahoo.com/info/terms/
> >
> >
> >
> >
> > ---------------------------------
> > Want to chat instantly with your online
> friends?&#29149;et
> > the FREE Yahoo!Messenger > __________________________________
>




mu/a-law to linear conversion is the decoder part of G711 PCM coder. ITU
defined the standard way to do it. The standard is called ITU G.711. You
should be able to download it freely, even source code. They also provides
test vectors.
>
> Thank you!
> You are right on the bandwidth caculation.
>
> I am just wonderring how to handle the 16 input
> requirement for G723/G729 codec when I only have A/U
> PCM input for example I have a TDM backplane running
> u-law voice data. Before I can put the voice data to
> g723 encoder, I need decode the u-law to linear. But
> it is only 14 bit.&nbsp; If I just throw this 14 bit to the
> encoder and the encoded data is sent to another system
> in a typical VoIP gateway application. And
> unfortunately that system is running a A-law TDM
> backplane, so it will decode G723 data and obviously
> it will still be 14 bit resolution, but if these 14
> bit resolution linear code is then encoded to A-law
> PCM to TDM bus, they is 6db gain since A-law only have
> 13 bit maximum linear resolution!&nbsp;&nbsp;
>
> So it seems to me there must be something to normalize
> the A/U linear code before call vocoder. I just don't
> know what is standard way to that.&nbsp;&nbsp; I could be wrong
> in my unstanding, correct me if any.
> &nbsp;&nbsp;&nbsp; Thanks!
>
> Best Regards,
> William
> --- pooja sugathan &lt;&gt; wrote:
> &gt; hi,
> &gt;&nbsp;&nbsp;&nbsp;&nbsp; i am no athority to say much about it, but
> i m &gt; going thru g723.1. What i understood is that in
> &gt; g723.1 the input to encoder is 16 bit and the
> &gt; compressed data is in 8 bit format, this 8 bit and
> &gt; the additional crc bits bring it to 10 bit...
> &gt; what brought me to decide on this is that
> &gt; (8*24)/30ms=6.4kbps which is the encoded rate, and
> &gt; the input to the encoder being (16*240)/30ns=
> &gt; 128kbps.
> &gt;&nbsp;&nbsp;
> &gt;&nbsp; if i m wrong kindly correct
> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; thank you.
> &gt;
> &gt; zhang_zhh &lt;&gt; wrote:
> &gt; Hi all,
> &gt;
> &gt; I have a simple question: according to the G729/G723
> &gt; spec, the
> &gt; input buffer should be 16bit linear PCM code, but
> &gt; the decode of U/A
> &gt; law PCM is 14/13 bit linear code, do I just need
> &gt; shift 2/3 bit before
> &gt; call the G729/G723 codec? What is the standard
> &gt; method to handle this?
> &gt; Thanks in advance!
> &gt;
> &gt; Best Regards,
> &gt; William
> &gt;
> &gt;
> &gt;
> &gt;
> &gt; ------------------------ >
> _____________________________________
> Note: If you do a simple &quot;reply&quot; with your email client, only
> the author of this message will receive your answer.&nbsp; You need to
> do a &quot;reply all&quot; if you want your answer to be distributed to
> the entire group.
>
> _____________________________________
> About this discussion group:
>
> To Join:&nbsp;
>
> To Post:&nbsp;
>
> To Leave:
>
> Archives: http://www.yahoogroups.com/group/speechcoding
>
> Other DSP-Related Groups: http://www.dsprelated.com





Thank you for reply!
I have G.711 standard. The problem I am facing right
now is the diffrent resolution linear code from the
decode of A/U PCM code. Look at the following
senario:

U law Decode
U law PCM(8 bits)-------------> 14 bit linear code
G723 encode
------------> 6.4kbps data( send to another system
G723 decode
through IP ) --------------> 14 bit linear code

A law encode(but A law linear should be 13 bit)
-------------> A law PCM (8 bits)

so in this case, A law PCM data and u law PCM data
don't represent same singal level, there is 6db
difference. If I have the knowledge of what kind of
PCM code is used, I can do the neccessary A/u
conversion. But in the VoIP application, different
VoIP gateway could be in different contry that may use
different PCM code and from different vendor. So it
seems to me some additional normalization for the a/u
law linear code to 16 bit linear code for vocoder is
needed so that the input and output are all the same
resolution linear code(which is actually the
requirement of G723/G729 standard).
Sorry for the long messagem, thanks!

Regards,
William
--- wrote:
> mu/a-law to linear conversion is the decoder part of
> G711 PCM coder. ITU
> defined the standard way to do it. The standard is
> called ITU G.711. You
> should be able to download it freely, even source
> code. They also provides
> test vectors.
> >
> >
> >
> >
> > Thank you!
> > You are right on the bandwidth caculation.
> >
> > I am just wonderring how to handle the 16 input
> > requirement for G723/G729 codec when I only have
> A/U
> > PCM input for example I have a TDM backplane
> running
> > u-law voice data. Before I can put the voice data
> to
> > g723 encoder, I need decode the u-law to linear.
> But
> > it is only 14 bit.&nbsp; If I just throw this 14
> bit to the
> > encoder and the encoded data is sent to another
> system
> > in a typical VoIP gateway application. And
> > unfortunately that system is running a A-law TDM
> > backplane, so it will decode G723 data and
> obviously
> > it will still be 14 bit resolution, but if these
> 14
> > bit resolution linear code is then encoded to
> A-law
> > PCM to TDM bus, they is 6db gain since A-law only
> have
> > 13 bit maximum linear resolution!&nbsp;&nbsp;
> >
> > So it seems to me there must be something to
> normalize
> > the A/U linear code before call vocoder. I just
> don't
> > know what is standard way to that.&nbsp;&nbsp; I
> could be wrong
> > in my unstanding, correct me if any.
> > &nbsp;&nbsp;&nbsp; Thanks!
> >
> > Best Regards,
> > William
> > --- pooja sugathan
> &lt;&gt; wrote:
> > &gt; hi,
> > &gt;&nbsp;&nbsp;&nbsp;&nbsp; i am no athority to
> say much about it, but
> > i m &gt; going thru g723.1. What i understood is
> that in
> > &gt; g723.1 the input to encoder is 16 bit and the
> > &gt; compressed data is in 8 bit format, this 8
> bit and
> > &gt; the additional crc bits bring it to 10 bit...
> > &gt; what brought me to decide on this is that
> > &gt; (8*24)/30ms=6.4kbps which is the encoded
> rate, and
> > &gt; the input to the encoder being (16*240)/30ns=
> > &gt; 128kbps.
> > &gt;&nbsp;&nbsp;
> > &gt;&nbsp; if i m wrong kindly correct
> > &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; thank
> you.
> > &gt;
> > &gt; zhang_zhh &lt;&gt; wrote:
> > &gt; Hi all,
> > &gt;
> > &gt; I have a simple question: according to the
> G729/G723
> > &gt; spec, the
> > &gt; input buffer should be 16bit linear PCM code,
> but
> > &gt; the decode of U/A
> > &gt; law PCM is 14/13 bit linear code, do I just
> need
> > &gt; shift 2/3 bit before
> > &gt; call the G729/G723 codec? What is the
> standard
> > &gt; method to handle this?
> > &gt; Thanks in advance!
> > &gt;
> > &gt; Best Regards,
> > &gt; William
> > &gt;
> > &gt;
> > &gt;
> > &gt;
> > &gt; ------------------------ Yahoo! Groups
> Sponsor
> > &gt;
> > &gt; _____________________________________
> > &gt; Note: If you do a simple &quot;reply&quot;
> with your email
> > &gt; client, only the author of this message will
> receive
> > &gt; your answer. You need to do a &quot;reply
> all&quot; if you
> > &gt; want your answer to be distributed to the
> entire
> > &gt; group.
> > &gt;
> > &gt; _____________________________________
> > &gt; About this discussion group:
> > &gt;
> > &gt; To Join:
>
> > &gt;
> > &gt; To Post:
> > &gt;
> > &gt; To Leave:
>
> > &gt;
> > &gt; Archives:
> > &gt; http://www.yahoogroups.com/group/speechcoding
> > &gt;
> > &gt; Other DSP-Related Groups:
> http://www.dsprelated.com
> > &gt;
> > &gt;
> > &gt; ">http://docs.yahoo.com/info/terms/
> > &gt;
> > &gt;
> > &gt;
> > &gt;
> > &gt; ---------------------------------
> > &gt; Want to chat instantly with your online
> > friends?&amp;#29149;et
> > &gt; the FREE Yahoo!Messenger
> >
> >
> > __________________________________
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > _____________________________________
> > Note: If you do a simple &quot;reply&quot; with
> your email client, only
> > the author of this message will receive your
> answer.&nbsp; You need to
> > do a &quot;reply all&quot; if you want your answer
> to be distributed to
> > the entire group.
> >
> > _____________________________________
> > About this discussion group:
> >
> > To Join:&nbsp;
>
> >
> > To Post:&nbsp;
> >
> > To Leave:
> >
> > Archives:
> http://www.yahoogroups.com/group/speechcoding
> >
> > Other DSP-Related Groups:
> http://www.dsprelated.com
> >
> >
> >
> >
> >


__________________________________