File Exchange

image thumbnail

G.723.1 Speech Coder and Decoder

version 1.1.0.0 (834 KB) by Peter Kabal
Matlab implementation of ITU-T G.723.1 speech coder and decoder

23 Downloads

Updated 10 Feb 2010

View License

This package implements the ITU-T G.723.1 speech coder and decoder in Matlab. The goal of the package is to provide a well-documented and modular program that was designed to facilitate experimentation and research using a practical coder as a base.

The coder implements the multipulse mode of G.723.1 (running at 6.3 kb/s). The decoder can decode all modes of the coder (ACELP at 5.3 kb/s, multipulse at 6.3 kb/s, discontinuous-transmission, packet loss concealment).

The standard interface between the coder and decoder is a bit file (compatible with the bit files generated by the ITU-T reference code). A second option passes information between the coder and decoder using a Matlab data file. This option allows for testing by passing quantized or unquantized information between the coder and the decoder.

A report [1] describing the G.723.1 and the Matlab implementation is included with the distribution. ITU-T Recommendation G.723.1 [2] is available on-line. The recommendation includes reference code (in C) and test files.

1. P. Kabal, ITU-T G.723.1 Speech Coder: A Matlab Implementation, TSP Lab Technical Report, Dept. Electrical & Computer Engineering, McGill University, updated July 2009 (available on-line at http://www-mmsp.ece.mcgill.ca/Documents)

2. ITU-T Recommendation G.723.1, Dual Rate Speech Coder for Multimedia Communications Transmitting at 5.3 and 6.3 kbit/s, March 1996.

Comments and Ratings (23)

Milka Elias

What are the parameters that you can change/control from the "LPanal" and "LPanalFrame" functions? Can the number of samples "p" be changed? If yes, what is its impact on LP coefficients (and hence on prediction error)? On the decoding side, what is the impact of varying "n", which is the number previous samples?

zahra esmaeilbayg : please remove this variable " versn" in
[dirn name ext versn] = fileparts (File);
and remove it from the ligne after.

this how I'm using this encoder:

G7231Coder('test.wav','coded.bit');

but i get this error
Error using fileparts
Too many output arguments.

Error in FullName>ls_File (line 69)
[dirn name ext versn] = fileparts (File);

Error in FullName (line 46)

can you please tell me what is wrong?

Juan Baldan

there is any way to implement this in Simulink model?

Herman

Herman (view profile)

Small error
line 23 in LPanal.m file should be swapped to
ap = zeros(Np+1,1);

sheng

sheng (view profile)

Hossein

Hossein (view profile)

Thank you man. this is great

Thank you for the code.Can you please tell me the steps for the execution.I have problem with execution.

unnati shah

hello sir , i want to find section wise output,so suggest me , how its possible and i got error in tG7231CODER coderfile and

unnati shah

hello sir , i want to find section wise output,so suggest me , how its possible and i got error in coderfile

memory

memory (view profile)

thank you, it helps me a lot in my master degree studies.

T.

T. (view profile)

Dear,

I processed a WAV file with 128.044 bytes (sampling frequency 8000Hz, 16 bits/sample, 64000 samples (8s)).
The compressed file has a size of 154.497 bytes, but it should have not more than 6.3kbits/s * 8 s / 8 bits/bytes = 6300 bytes, should it?
What went wrong?
Regards,

memory

memory (view profile)

thanks a lot

hi!
thank u for providing the code but when i run, it doesn't work.
i am using Matlab 7 R14
can u please tell me the version u have used???
thank u

MP Sivakumar

hi kabal,

thank you for the code. well i have one question. after implimentation of the coder the data is written to a structure. i want the data to be written to a row matrix, thereafter i will be implementing QPSK modulation to this data..can u help me out

Hasa ERKAN

g raja

g raja (view profile)

Hi Kabal,

In post filter folder, you have an option like SetPFpar to setting up the parameter values for PFpar. Similarly, How to setting up the FPmem vaules? Is there any provision for it?

Thanks,
G.Raja.

sepehr

sepehr (view profile)

Peter Kabal

Hi Ibraheem,
G.723.1 only accepts 8 kHz sampling rate (the link in your message is to 16 kHz files). I will put an explicit check on the sampling rate if and when I update the code. I need to see an explicit case of a file that exhibits a problem with poly2lsf (Matlab build-in routine) to be able to diagnose the problem. I have not seen any problems with normal speech files (all files in the official G.723.1 test suite work).

hi again,
after fight with the wav files i found that after i deleted the first half second the problem is solved. looks like it happens when we have no sound at the beginning of the file.
hope you can solve it with the next edition of your package.
you may try these data sets :
http://www.itu.int/net/itu-t/sigdb/genaudio/AudioForm-g.aspx?val=1000050

regards,

hi,
I get this error when I have tried to code a file.
====================
??? Error using ==> roots at 30
Input to ROOTS must not contain NaN or Inf.

Error in ==> poly2lsf at 33
if (max(abs(roots(a))) >= 1.0),

Error in ==> LPxLSFQ at 8
lsf = poly2lsf (ap); % lsf's are in radians

Error in ==> G7231Coder at 98
LSFC = LPxLSFQ (a(:,LPpar.SFRef), CoderMem.lsfQ, LSFpar);
========================
the file is the same as the file in the TestFiles directory with these proprieties:
Bitrate=128 kbps
Audio Sample Size= 16 bit
Channels =1 (mono)
Audio Sample rate =8 KHz
Audio format = PCM

I wonder whats is the cause of the error ???

regards.

Vlad

Vlad (view profile)

Nice job!

Updates

1.1.0.0

Small changes:
- Check for 8 kHz sampling, error if not
- All zero frames: set the LP coefficients to [1, 0, ..., 0].

MATLAB Release Compatibility
Created with R2009a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.


Learn About Live Editor

G.723.1/

G.723.1/ACB/

G.723.1/ACB/private/

G.723.1/ACELP/

G.723.1/ACELP/private/

G.723.1/Audio/

G.723.1/Audio/private/

G.723.1/BitStream/

G.723.1/BitStream/private/

G.723.1/BitStream/test/

G.723.1/CNG/

G.723.1/CNG/private/

G.723.1/DataFile/

G.723.1/Filter/

G.723.1/LP/

G.723.1/LP/private/

G.723.1/Misc/

G.723.1/Misc/test/

G.723.1/MultiPulse/

G.723.1/MultiPulse/private/

G.723.1/MultiPulse/test/

G.723.1/PLC/

G.723.1/PostFilter/

G.723.1/Tables/Convert/

G.723.1/Target/

G.723.1/Target/private/

G.723.1/VAD/

G.723.1/VAD/test/

G.723.1/test/