5.0

5.0 | 1 rating Rate this file 88 downloads (last 30 days) File Size: 832.81 KB File ID: #24755

G.723.1 Speech Coder and Decoder

by Peter Kabal

 

16 Jul 2009

Code covered by the BSD License  

Matlab implementation of ITU-T G.723.1 speech coder and decoder

Download Now | Watch this File

File Information
Description

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.

MATLAB release MATLAB 7.8 (R2009a)
Zip File Content  
Other Files
G.723.1/ACB/DecodeACB.m,
G.723.1/ACB/DecodeACBSF.m,
G.723.1/ACB/FixForbiddenCodes.m,
G.723.1/ACB/GetACB.m,
G.723.1/ACB/PitchContrib.m,
G.723.1/ACB/private/GetGainRange.m,
G.723.1/ACB/private/GetRtx.m,
G.723.1/ACB/private/UpdatePitchTame.m,
G.723.1/ACB/RepExc.m,
G.723.1/ACB/SetPitchpar.m,
G.723.1/ACB/SetSineDetpar.m,
G.723.1/ACB/SineDetector.m,
G.723.1/ACELP/ACELPContrib.m,
G.723.1/ACELP/GenExcACELP.m,
G.723.1/ACELP/private/DecodeStreamACELP.m,
G.723.1/ACELP/SetACELPpar.m,
G.723.1/Audio/OpenAudioFile.m,
G.723.1/Audio/private/AFrawRead.m,
G.723.1/Audio/ReadAudioData.m,
G.723.1/Audio/WriteAudio.m,
G.723.1/BitStream/ApplyErrorFile.m,
G.723.1/BitStream/private/GetQCodes.m,
G.723.1/BitStream/private/SetQCodes.m,
G.723.1/BitStream/ReadG7231Stream.m,
G.723.1/BitStream/test/MA01_02.bit,
G.723.1/BitStream/test/tBitStream.m,
G.723.1/BitStream/WriteG7231Stream.m,
G.723.1/CNG/CNGUpdate.m,
G.723.1/CNG/GenExcNull.m,
G.723.1/CNG/GenExcSID.m,
G.723.1/CNG/private/CNGMP.m,
G.723.1/CNG/private/CNGPitch.m,
G.723.1/CNG/private/GenExcCNG.m,
G.723.1/CNG/private/QuantL.m,
G.723.1/CNG/private/RandIntV.m,
G.723.1/CNG/SetCNGpar.m,
G.723.1/DataFile/GenExcDAT.m,
G.723.1/DataFile/ReadG7231Data.m,
G.723.1/Documentation/G.723.1-Impl-2009-07.pdf,
G.723.1/Filter/PZFilter.m,
G.723.1/G7231Coder.m,
G.723.1/G7231Decoder.m,
G.723.1/InitCoderMem.m,
G.723.1/InitDecoderMem.m,
G.723.1/LP/LPanal.m,
G.723.1/LP/LPanalFrame.m,
G.723.1/LP/LPFilt.m,
G.723.1/LP/LPxLSFQ.m,
G.723.1/LP/LSFCxLPI.m,
G.723.1/LP/LSFxLPI.m,
G.723.1/LP/private/LSFxLP.m,
G.723.1/LP/SetLPpar.m,
G.723.1/LP/SetLSFpar.m,
G.723.1/LP/WSyn.m,
G.723.1/LP/WSynInit.m,
G.723.1/Misc/ClipSignal.m,
G.723.1/Misc/CodeGain.m,
G.723.1/Misc/CombineVals.m,
G.723.1/Misc/ExtractVals.m,
G.723.1/Misc/FullName.m,
G.723.1/Misc/NullStruct.m,
G.723.1/Misc/RepShift.m,
G.723.1/Misc/ShiftVector.m,
G.723.1/Misc/test/tExtractVals.m,
G.723.1/Misc/TickTock.m,
G.723.1/MultiPulse/GenExcMP.m,
G.723.1/MultiPulse/MPCode.m,
G.723.1/MultiPulse/MPContrib.m,
G.723.1/MultiPulse/MultiPulse.m,
G.723.1/MultiPulse/private/DecodeStreamMP.m,
G.723.1/MultiPulse/SetMPpar.m,
G.723.1/MultiPulse/test/SumComb.m,
G.723.1/MultiPulse/test/tAdjRange.m,
G.723.1/MultiPulse/test/TestCombCode.m,
G.723.1/PLC/GenExcPLC.m,
G.723.1/PLC/PLCUpdate.m,
G.723.1/PostFilter/FPostFilter.m,
G.723.1/PostFilter/PFPitchval.m,
G.723.1/PostFilter/PPostFilter.m,
G.723.1/PostFilter/SetPFpar.m,
G.723.1/PrintQCodes.m,
G.723.1/SetCoderPar.m,
G.723.1/SetDecoderPar.m,
G.723.1/Tables/ACBb170.dat,
G.723.1/Tables/ACBb85.dat,
G.723.1/Tables/ACBbb170.dat,
G.723.1/Tables/ACBbb85.dat,
G.723.1/Tables/ACBg170.dat,
G.723.1/Tables/ACBg85.dat,
G.723.1/Tables/ACELPPg170.dat,
G.723.1/Tables/ACELPPOffs170.dat,
G.723.1/Tables/CNGGain64.dat,
G.723.1/Tables/CNGGainDec63.dat,
G.723.1/Tables/Convert/ACBconvert.m,
G.723.1/Tables/Convert/C-CodeData/ACB170.dat,
G.723.1/Tables/Convert/C-CodeData/ACB85.dat,
G.723.1/Tables/Convert/C-CodeData/LSFmean0.dat,
G.723.1/Tables/Convert/C-CodeData/LSFVQ10.dat,
G.723.1/Tables/Convert/C-CodeData/LSFVQ20.dat,
G.723.1/Tables/Convert/C-CodeData/LSFVQ30.dat,
G.723.1/Tables/Convert/C-CodeData/PG24.dat,
G.723.1/Tables/Convert/CNGQuant.m,
G.723.1/Tables/Convert/LSFconvert.m,
G.723.1/Tables/Convert/PulseGconvert.m,
G.723.1/Tables/Convert/tACELPP.m,
G.723.1/Tables/Cos512.dat,
G.723.1/Tables/LagWin.dat,
G.723.1/Tables/LSFECWin.dat,
G.723.1/Tables/LSFMean.dat,
G.723.1/Tables/LSFVQ1.dat,
G.723.1/Tables/LSFVQ2.dat,
G.723.1/Tables/LSFVQ3.dat,
G.723.1/Tables/PFECWinD.dat,
G.723.1/Tables/PFECWinN.dat,
G.723.1/Tables/PLCPG24x24.dat,
G.723.1/Tables/PulseG24.dat,
G.723.1/Tables/PWECWinD.dat,
G.723.1/Tables/PWECWinN.dat,
G.723.1/Tables/Win180.dat,
G.723.1/Target/GenTarget.m,
G.723.1/Target/private/PitchOL.m,
G.723.1/Target/SetHNWpar.m,
G.723.1/Target/SetPitchOLpar.m,
G.723.1/Target/SetPWpar.m,
G.723.1/test/TestFiles/FE27_04.wav,
G.723.1/test/TestFiles/FE27_04_Cref53.bit,
G.723.1/test/TestFiles/FE27_04_Mref63.bit,
G.723.1/test/TestFiles/FE27_04_Mref63.dat,
G.723.1/test/TestFiles/MA01_02.wav,
G.723.1/test/TestFiles/MA01_02_dec.wav,
G.723.1/test/TestFiles/MA01_02_Mref63.bit,
G.723.1/test/TestFiles/ReadMe.txt,
G.723.1/test/tG7231CodeDecode.m,
G.723.1/VAD/SetVADpar.m,
G.723.1/VAD/test/MakeVADState.m,
G.723.1/VAD/VADOrig.m,
license.txt
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
28 Sep 2009 Vlad

Nice job!

28 Dec 2009 Ibraheem

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.

28 Dec 2009 Ibraheem

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,

09 Feb 2010 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).

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
speech coder decoder g7231 Peter Kabal 17 Jul 2009 10:03:34
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com