DSPRelated.com
Forums

reading the MELP bitstream

Started by eric...@yahoo.com August 30, 2008
Good day!

I'm supposed to do some experiments on this particular wideband speech coder that we're developing at our laboratory. I'm supposed to verify this certain paper dealing with the exploitation of residual redundancies of a particular source coder's bitstream. I'd like to verify the paper first by using it on standard MELP and comparing my results with the results on the paper. However, I'm having difficulties on convincing myself that how I read the MELP bitstream is correct.

I checked the seminal paper on the MELP codec and I've seen a table that describes the order of the 54 bits in the bitstream. However, the paper also mentions that there are 24 MSB's which are not the first 24 bits of the total 54 bits. I'm confused. I'm sorry if I didn't get that by reading the paper, sometimes it's because of the language barrier (misinterpretations, etc). But anyway, I tried doing an experiment by getting the bitstream from standard MELP by using a 3 second speech from the TIMIT database. First, what I got from the bitstream is not divisible by 54 (is this okay?)... Second, when I check every 54th bit, it does not alternate (the sync bit alternates between 0 and 1, right? so maybe how i read the bitstream is wrong.) I'm using MATLAB by the way, i'm just invoking the MELP program through the dos function in MATLAB.

Please elucidate on these issues. I can't seem to find the answer on the internet. Thank you very much and God bless.
Eric-

> I'm supposed to do some experiments on this particular wideband
> speech coder that we're developing at our laboratory.
> I'm supposed to verify this certain paper dealing with the
> exploitation of residual redundancies of a particular
> source coder's bitstream. I'd like to verify the paper first by
> using it on standard MELP and comparing my results
> with the results on the paper. However, I'm having difficulties
> on convincing myself that how I read the MELP
> bitstream is correct.
>
> I checked the seminal paper on the MELP codec and I've seen a
> table that describes the order of the 54 bits in the
> bitstream. However, the paper also mentions that there are 24
> MSB's which are not the first 24 bits of the total 54
> bits. I'm confused. I'm sorry if I didn't get that by reading
> the paper, sometimes it's because of the language
> barrier (misinterpretations, etc). But anyway, I tried doing an
> experiment by getting the bitstream from standard
> MELP by using a 3 second speech from the TIMIT database. First,
> what I got from the bitstream is not divisible by 54
> (is this okay?)... Second, when I check every 54th bit, it does
> not alternate (the sync bit alternates between 0 and
> 1, right? so maybe how i read the bitstream is wrong.) I'm using
> MATLAB by the way, i'm just invoking the MELP program
> through the dos function in MATLAB.
>
> Please elucidate on these issues. I can't seem to find the
> answer on the internet. Thank you very much and God
> bless.

Your first step should be to find the sync bit. Once you know that, you can figure out the rest of the frame by
knowing relative position of other bits.

It should be easy for you to locate the sync bit: find the one bit that toggles every frame. Basically, you can
writing a simple sync-acquisition routine. (Hint: use exclusive-OR.)

-Jeff
actually, right after I posted that query, I came across this letter
of yours
posted in the signalogic website. well, what can I say,
you're the only guy who can actually solve my problem! :D I already
figured it out yesterday, and I just followed what you said in the
letter,
144 bits based on 9 packets containing 16-bits (6 bits coefficients,
10 bits not used) and I just looked for the sync bit, found it in the
last packet and voila, I'm all set. Thanks Jeff, you're a speech
coding god. :D
--- In s..., "Jeff Brower" wrote:
>
> Eric-
>
> > I'm supposed to do some experiments on this particular wideband
> > speech coder that we're developing at our laboratory.
> > I'm supposed to verify this certain paper dealing with the
> > exploitation of residual redundancies of a particular
> > source coder's bitstream. I'd like to verify the paper first by
> > using it on standard MELP and comparing my results
> > with the results on the paper. However, I'm having difficulties
> > on convincing myself that how I read the MELP
> > bitstream is correct.
> >
> > I checked the seminal paper on the MELP codec and I've seen a
> > table that describes the order of the 54 bits in the
> > bitstream. However, the paper also mentions that there are 24
> > MSB's which are not the first 24 bits of the total 54
> > bits. I'm confused. I'm sorry if I didn't get that by reading
> > the paper, sometimes it's because of the language
> > barrier (misinterpretations, etc). But anyway, I tried doing an
> > experiment by getting the bitstream from standard
> > MELP by using a 3 second speech from the TIMIT database. First,
> > what I got from the bitstream is not divisible by 54
> > (is this okay?)... Second, when I check every 54th bit, it does
> > not alternate (the sync bit alternates between 0 and
> > 1, right? so maybe how i read the bitstream is wrong.) I'm using
> > MATLAB by the way, i'm just invoking the MELP program
> > through the dos function in MATLAB.
> >
> > Please elucidate on these issues. I can't seem to find the
> > answer on the internet. Thank you very much and God
> > bless.
>
> Your first step should be to find the sync bit. Once you know that,
you can figure out the rest of the frame by
> knowing relative position of other bits.
>
> It should be easy for you to locate the sync bit: find the one bit
that toggles every frame. Basically, you can
> writing a simple sync-acquisition routine. (Hint: use exclusive-OR.)
>
> -Jeff
>
Federico-

> actually, right after I posted that query, I came across this letter
> of yours
> posted in the signalogic website. well, what can I say,
> you're the only guy who can actually solve my problem! :D I already
> figured it out yesterday, and I just followed what you said in the
> letter,
> 144 bits based on 9 packets containing 16-bits (6 bits coefficients,
> 10 bits not used) and I just looked for the sync bit, found it in the
> last packet and voila, I'm all set. Thanks Jeff, you're a speech
> coding god. :D

Ok... now I realize that you mean the file output generated by one of the MELPe test/reference PC programs. I thought
you meant an actual compressed bitstream (no unused bits), in which case the initial position of the sync bit can
vary.

Glad to hear you got the file output format pinned down.

-Jeff

> --- In s..., "Jeff Brower" wrote:
>>
>> Eric-
>>
>> > I'm supposed to do some experiments on this particular wideband
>> > speech coder that we're developing at our laboratory.
>> > I'm supposed to verify this certain paper dealing with the
>> > exploitation of residual redundancies of a particular
>> > source coder's bitstream. I'd like to verify the paper first by
>> > using it on standard MELP and comparing my results
>> > with the results on the paper. However, I'm having difficulties
>> > on convincing myself that how I read the MELP
>> > bitstream is correct.
>> >
>> > I checked the seminal paper on the MELP codec and I've seen a
>> > table that describes the order of the 54 bits in the
>> > bitstream. However, the paper also mentions that there are 24
>> > MSB's which are not the first 24 bits of the total 54
>> > bits. I'm confused. I'm sorry if I didn't get that by reading
>> > the paper, sometimes it's because of the language
>> > barrier (misinterpretations, etc). But anyway, I tried doing an
>> > experiment by getting the bitstream from standard
>> > MELP by using a 3 second speech from the TIMIT database. First,
>> > what I got from the bitstream is not divisible by 54
>> > (is this okay?)... Second, when I check every 54th bit, it does
>> > not alternate (the sync bit alternates between 0 and
>> > 1, right? so maybe how i read the bitstream is wrong.) I'm using
>> > MATLAB by the way, i'm just invoking the MELP program
>> > through the dos function in MATLAB.
>> >
>> > Please elucidate on these issues. I can't seem to find the
>> > answer on the internet. Thank you very much and God
>> > bless.
>>
>> Your first step should be to find the sync bit. Once you know that,
> you can figure out the rest of the frame by
>> knowing relative position of other bits.
>>
>> It should be easy for you to locate the sync bit: find the one bit
> that toggles every frame. Basically, you can
>> writing a simple sync-acquisition routine. (Hint: use exclusive-OR.)
>>
>> -Jeff