Digital cellular telecommunications system (Phase 2+) (GSM); Adaptive Multi Rate (AMR) speech; ANSI-C code for the AMR speech codec (GSM 06.73 version 7.3.1 Release 1998)

REN/SMG-110673Q7R2

Digitalni celični telekomunikacijski sistem (faza 2+) – Prilagodljivi večhitrostni (AMR) govor – Kod ANSI-C za AMR govorni kodek (GSM 06.73, različica 7.3.1, izdaja 1998)

General Information

Status
Published
Publication Date
04-Jul-2000
Technical Committee
Current Stage
12 - Completion
Due Date
26-May-2000
Completion Date
05-Jul-2000
Mandate

Buy Standard

Standard
EN 301 712 V7.3.1:2003
English language
25 pages
sale 10% off
Preview
sale 10% off
Preview
e-Library read for
1 day

Standards Content (Sample)

2003-01.Slovenski inštitut za standardizacijo. Razmnoževanje celote ali delov tega standarda ni dovoljeno.Digital cellular telecommunications system (Phase 2+) (GSM); Adaptive Multi Rate (AMR) speech; ANSI-C code for the AMR speech codec (GSM 06.73 version 7.3.1 Release 1998)33.070.50Globalni sistem za mobilno telekomunikacijo (GSM)Global System for Mobile Communication (GSM)ICS:Ta slovenski standard je istoveten z:EN 301 712 Version 7.3.1SIST EN 301 712 V7.3.1:2003en01-december-2003SIST EN 301 712 V7.3.1:2003SLOVENSKI
STANDARD



SIST EN 301 712 V7.3.1:2003



ETSIEN301712V7.3.1(2000-06)EuropeanStandard(Telecommunicationsseries)Digitalcellulartelecommunicationssystem(Phase2+);AdaptiveMultiRate(AMR)speech;ANSI-CcodefortheAMRspeechcodec(GSM06.73version7.3.1Release1998)GLOBALSYSTEMFORMOBILECOMMUNICATIONSRSIST EN 301 712 V7.3.1:2003



ETSIETSIEN301712V7.3.1(2000-06)2(GSM06.73version7.3.1Release1998)ReferenceREN/SMG-110673Q7R2KeywordsDigitalcellulartelecommunicationssystem,GlobalSystemforMobilecommunications(GSM)AMR,ANSICCodeETSI650RoutedesLuciolesF-06921SophiaAntipolisCedex-FRANCETel.:+33492944200Fax:+33493654716SiretN°34862356200017-NAF742CAssociationàbutnonlucratifenregistréeàlaSous-PréfecturedeGrasse(06)N°7803/88ImportantnoticeIndividualcopiesofthepresentdocumentcanbedownloadedfrom:http://www.etsi.orgThepresentdocumentmaybemadeavailableinmorethanoneelectronicversionorinprint.Inanycaseofexistingorperceiveddifferenceincontentsbetweensuchversions,thereferenceversionisthePortableDocumentFormat(PDF).Incaseofdispute,thereferenceshallbetheprintingonETSIprintersofthePDFversionkeptonaspecificnetworkdrivewithinETSISecretariat.Usersofthepresentdocumentshouldbeawarethatthedocumentmaybesubjecttorevisionorchangeofstatus.InformationonthecurrentstatusofthisandotherETSIdocumentsisavailableathttp://www.etsi.org/tb/status/Ifyoufinderrorsinthepresentdocument,sendyourcommentto:editor@etsi.frCopyrightNotificationNopartmaybereproducedexceptasauthorizedbywrittenpermission.Thecopyrightandtheforegoingrestrictionextendtoreproductioninallmedia.©EuropeanTelecommunicationsStandardsInstitute2000.Allrightsreserved.SIST EN 301 712 V7.3.1:2003



ETSIETSIEN301712V7.3.1(2000-06)3(GSM06.73version7.3.1Release1998)ContentsIntellectualPropertyRights.4Foreword.41Scope.52References.53Definitionsandabbreviations.63.1Definitions.63.2Abbreviations.64Ccodestructure.64.1ContentsoftheCsourcecode.64.2Programexecution.74.3Codingstyle.74.4Codehierarchy.74.5Variables,constantsandtables.114.5.1DescriptionofconstantsusedintheC-code.114.5.2DescriptionoffixedtablesusedintheC-code.114.5.3StaticvariablesusedintheC-code.135Homingprocedure.176Fileformats.236.1Speechfile(encoderinput/decoderoutput).236.2Modecontrolfile(encoderinput).236.3Parameterbitstreamfile(encoderoutput/decoderinput).23AnnexA(informative):ChangeRequestHistory.24History.25SIST EN 301 712 V7.3.1:2003



ETSIETSIEN301712V7.3.1(2000-06)4(GSM06.73version7.3.1Release1998)IntellectualPropertyRightsIPRsessentialorpotentiallyessentialtothepresentdocumentmayhavebeendeclaredtoETSI.TheinformationpertainingtotheseessentialIPRs,ifany,ispubliclyavailableforETSImembersandnon-members,andcanbefoundinETSISR000314:"IntellectualPropertyRights(IPRs);Essential,orpotentiallyEssential,IPRsnotifiedtoETSIinrespectofETSIstandards",whichisavailablefromtheETSISecretariat.LatestupdatesareavailableontheETSIWebserver(http://www.etsi.org/ipr).PursuanttotheETSIIPRPolicy,noinvestigation,includingIPRsearches,hasbeencarriedoutbyETSI.NoguaranteecanbegivenastotheexistenceofotherIPRsnotreferencedinETSISR000314(ortheupdatesontheETSIWebserver)whichare,ormaybe,ormaybecome,essentialtothepresentdocument.ForewordThisEuropeanStandard(Telecommunicationsseries)hasbeenproducedbytheSpecialMobileGroup(SMG).ThepresentdocumentprovidesthebitexactdefinitionoftheAdaptiveMultiRate(AMR)speechtrafficcodecforthedigitalcellulartelecommunicationssystem.ThepresentdocumentcontainsanelectroniccopyoftheANSI-CcodefortheGSMAdaptiveMulti-Ratecodec,givenintheassociatedfile"en_301712v070301p0.zip".TheANSI-CcodeisnecessaryforabitexactimplementationoftheAdaptiveMultiRatespeechtranscoder(GSM06.90[3]),VoiceActivityDetection(GSM06.94[7]),comfortnoise(GSM06.92[5]),DiscontinuousTransmission(GSM06.93[6])andexamplesolutionsforsubstitutingandmutingoflostframes(GSM06.91[4]).Theassociatedfile"en_301712v070301p0.zip"containsa"readme.txt"file,whichexplainstheprocedureforinstallationandusageoftheANSI-Ccodefiles.ThecontentsofthepresentdocumentissubjecttocontinuingworkwithinSMGandmaychangefollowingformalSMGapproval.ShouldSMGmodifythecontentsofthepresentdocumentitwillbere-releasedwithanidentifyingchangeofreleasedateandanincreaseinversionnumberasfollows:Version7.x.ywhere:7indicatesRelease1998ofGSMPhase2+.xtheseconddigitisincrementedforallchangesofsubstance,i.e.technicalenhancements,corrections,updates,etc.ythethirddigitisincrementedwheneditorialonlychangeshavebeenincorporatedinthespecification.NationaltranspositiondatesDateofadoptionofthisEN:19May2000DateoflatestannouncementofthisEN(doa):31August2000DateoflatestpublicationofnewNationalStandardorendorsementofthisEN(dop/e):28February2001DateofwithdrawalofanyconflictingNationalStandard(dow):28February2001SIST EN 301 712 V7.3.1:2003



ETSIETSIEN301712V7.3.1(2000-06)5(GSM06.73version7.3.1Release1998)1ScopeThepresentdocumentcontainsanelectroniccopyoftheANSI-CcodefortheGSMAdaptiveMulti-Ratecodec.TheANSI-CcodeisnecessaryforabitexactimplementationoftheAdaptiveMultiRatespeechtranscoder(GSM06.90[3]),VoiceActivityDetection(GSM06.94[7]),comfortnoise(GSM06.92[5]),DiscontinuousTransmission(GSM06.93[6])andexamplesolutionsforsubstitutingandmutingoflostframes(GSM06.91[4]).2ReferencesThefollowingdocumentscontainprovisionswhich,throughreferenceinthistext,constituteprovisionsofthepresentdocument.• Referencesareeitherspecific(identifiedbydateofpublication,editionnumber,versionnumber,etc.)ornon-specific.• Foraspecificreference,subsequentrevisionsdonotapply.• Foranon-specificreference,thelatestversionapplies.• Anon-specificreferencetoanETSshallalsobetakentorefertolaterversionspublishedasanENwiththesamenumber.• ForthisRelease1998document,referencestoGSMdocumentsareforRelease1998versions(version7.x.y).[1]GSM01.04:"Digitalcellulartelecommunicationssystem(Phase2+);Abbreviationsandacronyms".[2]GSM06.74:"Digitalcellulartelecommunicationssystem(Phase2+);TestsequencesfortheGSMAdaptiveMulti-Rate(AMR)speechcodec".[3]GSM06.90:"Digitalcellulartelecommunicationssystem(Phase2+);AdaptiveMulti-Rate(AMR)speechtranscoding".[4]GSM06.91:"Digitalcellulartelecommunicationssystem(Phase2+);SubstitutionandmutingoflostframeforAdaptiveMulti-Rate(AMR)speechtrafficchannels".[5]GSM06.92:"Digitalcellulartelecommunicationssystem(Phase2+);ComfortnoiseaspectsforAdaptiveMulti-Rate(AMR)speechtrafficchannels".[6]GSM06.93:"Digitalcellulartelecommunicationssystem(Phase2+);Discontinuoustransmission(DTX)forAdaptiveMulti-Rate(AMR)speechtrafficchannels".[7]GSM06.94:"Digitalcellulartelecommunicationssystem(Phase2+);VoiceActivityDetector(VAD)forAdaptiveMulti-Rate(AMR)speechtrafficchannels".SIST EN 301 712 V7.3.1:2003



ETSIETSIEN301712V7.3.1(2000-06)6(GSM06.73version7.3.1Release1998)3Definitionsandabbreviations3.1DefinitionsDefinitionoftermsusedinthepresentdocument,canbefoundinGSM06.90[3],GSM06.91[4],GSM06.92[5],GSM06.93[6]andGSM06.94[7].3.2AbbreviationsForthepurposesofthepresentdocument,thefollowingabbreviationsapply:ANSIAmericanNationalStandardsInstituteETSEuropeanTelecommunicationStandardGSMGlobalSystemforMobilecommunicationsI/OInput/OutputRAMRandomAccessMemoryROMReadOnlyMemoryForabbreviationsnotgiveninthissubclauseseeGSM01.04[1].4CcodestructureThisclausegivesanoverviewofthestructureofthebit-exactCcodeandprovidesanoverviewofthecontentsandorganizationoftheCcodeattachedtothepresentdocument.TheCcodehasbeenverifiedonthefollowingsystems:-SunMicrosystemsworkstationsandGNUgcccompiler;-DECAlphaworkstationsandGNUgcccompiler;-IBMPC/ATcompatiblecomputerswithLinuxoperatingsystemandGNUgcccompiler;ANSI-C9899wasselectedastheprogramminglanguagebecauseportabilitywasdesirable.4.1ContentsoftheCsourcecodeTheCcodedistributionhasallfilesintherootlevel.Thedistributedfileswithsuffix"c"containthesourcecodeandthefileswithsuffix"h"aretheheaderfiles.TheROMdataiscontainedmostlyinfileswithsuffix"tab".TheCcodedistributionalsocontainsonespeechcoderinstallationverificationdatafile,"spch_dos.inp".Thereferenceencoderoutputfileisnamed"spch_dos.cod",thereferencedecoderinputfileisnamed"spch_dos.dec"andthereferencedecoderoutputfileisnamed"spch_dos.out".ThesefourfilesareformattedsuchthattheyarecorrectforanIBMPC/ATcompatiblecomputer.Thesamefileswithreversedbyteorderofthe16bitwordsarenamed"spch_unx.inp","spch_unx.cod","spch_unx."dec"and"spch_unx.out",respectively.FinalverificationistobeperformedusingtheGSMAdaptiveMulti-RatetestsequencesdescribedinGSM06.74[2].MakefilesareprovidedfortheplatformsinwhichtheCcodehasbeenverified(listedabove).Oncethesoftwareisinstalled,thisdirectorywillhaveacompiledversionofencoderanddecoder(thebit-exactCexecutablesofthespeechcodec)andalltheobjectfiles.SIST EN 301 712 V7.3.1:2003



ETSIETSIEN301712V7.3.1(2000-06)7(GSM06.73version7.3.1Release1998)4.2ProgramexecutionTheGSMAdaptiveMulti-Ratecodecisimplementedintwoprograms:-(encoder)speechencoder;-(decoder)speechdecoder.Theprogramsshouldbecalledlike:-encoder[encoderoptions];-decoder[decoderoptions].Thespeechfilescontain16-bitlinearencodedPCMspeechsamplesandtheparameterfilescontainencodedspeechdataandsomeadditionalflags.Theencoderanddecoderoptionswillbeexplainedbyrunningtheapplicationswithoption–h.Seethefilereadme.txtformoreinformationonhowtoruntheencoderanddecoderprograms.4.3CodingstyleTheCcodeiswrittenaccordingtothefollowingstructuringconventions.Eachfunctionfunc()thatneedsstaticvariablesisconsideredamodule.Amoduleconsistsof:-a'statestructure'(struct)combiningthestaticvariablesofthemodule-threeauxiliaryfunctionsfunc_init(),func_reset(),andfunc_exit().-theprocessingfunctionfunc()itselfTheinitializationfunctionfunc_init()allocates(fromtheheap)anewstatestructure,callsthefunc_reset()function,storesthepointertothenewlyallocatedstructureinitsfirstfunctionparameter,andreturnswithavalueof0ifcompletedsuccessfuloravalueof1otherwise.Theresetfunctionfunc_reset()takesapointertothestatestructureandresetsallmembersofthestructuretoapredefinedvalue('homing').Theexitfunctionfunc_exit()performsanynecessarycleanupandfreesthestatestructurememory.Theprocessingfunctionfunc()alsotakesapointertothestatestructureaswellasallothernecessaryparametersandperformsitstaskusing(andpossiblymodifying)thevaluesinthestatestructure.Ifamodulecallsothermodules,thehigherlevelstatestructurecontainsapointertothelowerlevelstatestructures,andtheinit,reset,andexitfunctionsrecursivelycallthecorrespondinglowerlevelfunctions.Bythisconvention,thecodebecomes"instantiable"(morethanonecopyofamodulecanbeusedinthesameprogram)andthestaticdatahierarchyisclearlyvisibleinthecode.4.4CodehierarchyFigures1to4arecallgraphsthatshowthefunctionsusedinthespeechcodec,includingthefunctionsofVAD,DTX,andcomfortnoisegeneration.Eachcolumnrepresentsacalllevelandeachcellafunction.Thefunctionscontaincallstothefunctionsinrightwardsneighbouringcells.Thetimeorderinthecallgraphsisfromthetopdownwardsastheprocessingofaframeadvances.AllstandardCfunctions:printf(),fwrite(),etc.havebeenomitted.Also,nobasicoperations(add(),L_add(),mac(),etc.)ordoubleprecisionextendedoperations(e.g.L_Extract())appearinthegraphs.TheinitialisationofthestaticRAM(i.e.callingthe_initfunctions)isalsoomitted.Thebasicoperationsarenotcountedasextendingthedepth,thereforethedeepestlevelinthissoftwareislevel7.Theencodercallgraphisbrokendownintothreeseparatecallgraphs,Table1to3.SIST EN 301 712 V7.3.1:2003



ETSIETSIEN301712V7.3.1(2000-06)8(GSM06.73version7.3.1Release1998)Table1:SpeechencodercallstructureSpeech_Encode_FramePre_Processcod_amrCopyVad11filter_bankfirst_filter_stagefilter5filter3level_calculationvad_decisioncomplex_estimate_adaptcomplex_vadnoise_estimate_updateupdate_cntrlhangover_additionVad21block_normr_fftc_fftfn10Log10Log2Log2_normPow2tx_dtx_handlerlpcAutocorrLag_windowLevinsonlspAz_lspChebpsQ_plsf_5Lsp_lsfLsf_wtVq_subvecVq_subvec_sReorder_lsfLsf_lspInt_lpc_1and3_2Lsp_azGet_lsp_polInt_lpc_1and3Lsp_azGet_lsp_polQ_plsf_3Lsp_lsfLsf_wtCopyVq_subvec3Vq_subvec4Reorder_lsfLsf_lspInt_lpc_1to3_2Lsp_azGet_lsp_polInt_lpc_1to3Lsp_azGet_lsp_polCopydtx_bufferCopyLog2Log2_normdtx_encLsp_lsfReorder_lsfLsf_lspSet_zerolsp_resetCopyQ_plsf_resetcl_ltp_resetPitch_fr_resetcheck_lsppre_bigWeight_AiResiduSyn_filtol_ltpPitch_olvad_tone_detection_update2Lag_maxvad_tone_detection2Inv_sqrtcomp_corr2hp_max2vad_complex_detection_update2Pitch_ol_wghcomp_corr2Lag_max2vad_tone_detection_update2vad_tone_detection2gmed_nhp_max2vad_complex_detection_update2vad_pitch_detectionLTP_flag_update3subframePreProcWeight_AiSyn_filtResiduCopycl_ltpPitch_frgetRangeNorm_CorrConvolveInv_sqrtsearchFracInterpol_3or6Enc_lag3Enc_lag6(continued)1OptiontocalloneortheotherVADoption2SpecifictoVADoption13SpecifictoVADoption2SIST EN 301 712 V7.3.1:2003



ETSIETSIEN301712V7.3.1(2000-06)9(GSM06.73version7.3.1Release1998)Table1(concluded):SpeechencodercallstructurePred_lt_3or6ConvolveG_pitchcheck_gp_clippingq_gain_pitchcbsearchseeTable2gainQuantseeTable3update_gp_clippingCopysubframePostProcSyn_filtPred_lt_3or6ConvolvePrm2bitsInt2binTable2:cbsearchcallstructurecbsearchcode_2i40_9bitscor_h_xset_signcor_hInv_sqrtsearch_2i40build_codecode_2i40_11bitscor_h_xset_signcor_hInv_sqrtsearch_2i40build_codecode_3i40_14bitscor_h_xset_signcor_hInv_sqrtsearch_3i40build_codecode_4i40_17bitscor_h_xset_signcor_hInv_sqrtsearch_4i40build_codecode_8i40_31bitscor_h_xset_sign12k2Inv_sqrtcor_hInv_sqrtsearch_10and8i40build_codecompress_codecompress10code_10i40_35bitscor_h_xset_sign12k2Inv_sqrtcor_hInv_sqrtsearch_10and8i40build_codeq_pTable3:gainQuantcallstructuregainQuantgc_pred_copyCopygc_predLog2Log2_normLog2_normcalc_filt_energiescalc_target_energyMR475_update_unq_predgc_pred_updateMR475_gain_quantMR475_quant_store_resultsLog2Log2_normgc_pred_updategc_predLog2Log2_normLog2_normG_codeq_gain_codePow2MR795_gain_quantq_gain_pitchMR795_gain_code_quant3calc_unfilt_energiesLog2Log2_normgain_adaptgmed_nMR795_gain_code_quant_modsqrt_l_expQua_gainPow2gc_pred_updateSIST EN 301 712 V7.3.1:2003



ETSIETSIEN301712V7.3.1(2000-06)10(GSM06.73version7.3.1Release1998)Table4:SpeechdecodercallstructureSpeech_Decode_FrameBits2prmBin2intDecoder_amrrx_dtx_handlerDecoder_amr_resetlsp_avg_resetD_plsf_resetec_gain_pitch_resetec_gain_code_resetgc_pred_resetBgn_scd_resetSet_zeroph_disp_resetdtx_dec_resetCopySet_zerodtx_decCopyLsf_lspInit_D_plsf_3CopyD_plsf_3Reorder_lsfCopyLsf_lsppseudonoiseLsp_lsfReorder_lsfLsp_AzGet_lsp_polA_ReflLog2Log2_normBuild_CN_codepseudonoiseSyn_filtLsf_lsplsp_avgCopyD_plsf_3Reorder_lsfCopyLsf_lspInt_lpc_1to3Lsp_AzGet_lsp_polD_plsf_5Reorder_lsfCopyLsf_lspInt_lpc_1and3Lsp_AzGet_lsp_polDec_lag3Pred_lt_3or6Dec_lag6decode_2i40_9bitsdecode_2i40_11bitsdecode_3i40_14bitsdecode_4i40_17bitsdecode_8i40_31bitsdecompress_codedecompress10ec_gain_pitchgmed_nd_gain_pitchec_gain_pitch_updatedecode_10i40_35bitsDec_gainLog2Log2_normgc_predLog2Log2_normLog2_normPow2gc_pred_updateec_gain_codegmed_ngc_pred_average_limetedgc_pred_updateec_gain_code_updated_gain_codegc_predLog2Log2_normLog2_normPow2gc_pred_updateInt_lsfCb_gain_averageph_disp_releaseph_disp_lockph_dispsqrt_l_expEx_ctrlgmed_nagc2Inv_sqrtSyn_filtBgn_scdgmed_ndtx_dec_activity_updateCopyLog2Log2_normlsp_avgPost_FilterCopyWeight_AiResiduSet_zeroSyn_filtPreemphasisagcenergy_oldenergy_newenergy_oldInv_sqrtPost_ProcessSIST EN 301 712 V7.3.1:2003



ETSIETSIEN301712V7.3.1(2000-06)11(GSM06.73version7.3.1Release1998)4.5Variables,constantsandtablesThedatatypesofvariablesandtablesusedinthefixedpointimplementationaresignedintegersin2'scomplementrepresentation,definedby:-Word1616bitvariable;-Word3232bitvariable.Furthermoresomeenumtypesareused,allpossibletorepresentwithonebyte,andabooleanFlag.4.5.1DescriptionofconstantsusedintheC-codeThissectioncontainsalistingofallglobalconstantsdefinedincnst.h.Table5:GlobalconstantsConstantValueDescriptionL_TOTAL320totalsizeofspeechbuffer.L_WINDOW240windowsizeinLPanalysisL_FRAME160framesizeL_FRAME_BY280framesizedividedby2L_SUBFR40subframesizeL_CODE40codevectorlengthNB_TRACK5numberoftracksSTEP5codebookstepsizeNB_TRACK_MR1024numberoftracksmodemr102STEP_MR1024codebookstepsizemodemr102M10orderofLPfilterMP1(M+1)orderofLPfilter+1LSF_GAP205minimumdistancebetweenLSFafterquantization;50Hz=205LSP_PRED_FAC_MR12221299MR122LSPpredictionfactor(0.65Q15)AZ_SIZE44sizeofarrayofLPfiltersin4subframes(4*M+4)PIT_MIN_MR12218minimumpitchlag(MR122mode)PIT_MIN20minimumpitchlag(allothermodes)PIT_MAX143maximumpitchlagL_INTERPOL(10+1)lengthoffilterforinterpolationL_INTER_SRCH4lengthoffilterforCLLTPsearchinterpolationMU26214factorfortiltcompensationfilter0.8AGC_FAC29491factorforautomaticgaincontrol0.9L_NEXT40overheadinLPanalysisSHARPMAX13017maximumvalueofpitchsharpeningSHARPMIN0minimumvalueofpitchsharpeningMAX_PRM_SIZE57max.num.ofparamsMAX_SERIAL_SIZE244max.num.ofserialbitsGP_CLIP15565pitchgainclipping=0.95N_FRAME7oldpitchgainsinaveragecalculationEHF_MASK816bitrepresentationofallsamplesintheencoderhomingframe(leftjustification)4.5.2DescriptionoffixedtablesusedintheC-codeThissectioncontainsalistingofallfixedtablessortedbysourcefilenameandtablename.AlltabledataisdeclaredasWord16.SIST EN 301 712 V7.3.1:2003



ETSIETSIEN301712V7.3.1(2000-06)12(GSM06.73version7.3.1Release1998)Table6:FixedtablesFileTablenameLengthDescriptionc2_9pf.ctrackTable4*5tracktableforalgebraiccodebooksearch(MR475,MR515)cod_amr.cgamma110spectralexpansionfactorscod_amr.cgamma1_12k210spectralexpansionfactorscod_amr.cgamma210spectralexpansionfactorsdtx_dec.clsf_hist_mean_scale10initializationvaluesforDTXlsfparametersdtx_dec.cdtx_log_en_adjust9leveladjustmentsforechmodeec_gains.ccdown7attenuationfactorsforcodebookgainec_gains.cpdown7attenuationfactorsforadaptivecodebookgaingc_pred.cpred4algebraiccodebookgainMApredictorcoefficientsgc_pred.cpred_MR1224algebraiccodebookgainMApredictorcoefficients(MR122)pitch_fr.cmode_dep_parm72parametersdefiningtheadaptivecodebooksearchpermodepost_pro.ca3HPfiltercoefficients(denominator)inPost_Processpost_pro.cb3HPfiltercoefficients(numerator)inPost_Processpre_proc.ca3HPfiltercoefficients(denominator)inPre_Processpre_proc.cb3HPfiltercoefficients(numerator)inPre_Processpred_lt.cinter_661interpolationfiltercoefficientspstfilt.cgamma3_MR12210spectralexpansionfactorspstfilt.cgamma310spectralexpansionfactorspstfilt.cgamma4_MR12210spectralexpansionfactorspstfilt.cgamma410spectralexpansionfactorsbitno.tabprmno9numberofbitsforeachmodebitno.tabprmnofsf8numberofparametersforLPCandfirstsubframeforeachmode(usedfordecoderhomingprocedure)bitno.tabbitno9pointerstothebitno_MR.tablesbitno.tabbitno_MR47517numberofbitsperparametertotransmit(MR475)bitno.tabbitno_MR51519numberofbitsperparametertotransmit(MR515)bitno.tabbitno_MR5919numberofbitsperparametertotransmit(MR59)bitno.tabbitno_MR6719numberofbitsperparametertotransmit(MR67)bitno.tabbitno_MR7419numberofbitsperparametertotransmit(MR74)bitno.tabbitno_MR79523numberofbitsperparametertotransmit(MR795)bitno.tabbitno_MR10239numberofbitsperparametertotransmit(MR102)bitno.tabbitno_MR12257numberofbitsperparametertotransmit(MR122)bitno.tabbitno_MRDTX5numberofbitsperparametertotransmit(MRDTX)c2_11pf.tabstartPos12trackstartsearchpositionforfirstpulsec2_11pf.tabstartPos24trackstartsearchpositionforsecondpulsec2_9pf.tabstartPos16trackstartsearchpositioncorrwght.tabcorrweight251weightingofthecorrelationfunctioninopenloopLTPsearch(MR102)d_homing.tabdhf8pointerstothedhf_MR…tablesd_homing.tabdhf_MR47517parametervaluesforthedecoderhomingframe(MR475)d_homing.tabdhf_MR51519parametervaluesforthedecoderhomingframe(MR515)d_homing.tabdhf_MR5919parametervaluesforthedecoderhomingframe(MR59)d_homing.tabdhf_MR6719parametervaluesforthedecoderhomingframe(MR67)d_homing.tabdhf_MR7419parametervaluesforthedecoderhomingframe(MR74)d_homing.tabdhf_MR79523parametervaluesforthedecoderhomingframe(MR795)d_homing.tabdhf_MR10239parametervaluesforthedecoderhomingframe(MR102)d_homing.tabdhf_MR12257parametervaluesforthedecoderhomingframe(MR122)gains.tabqua_gain_pitch16adaptivecodebookgainquantizationtable(MR122,MR795)gains.tabqua_gain_code96fixedcodebookgainquantizationtable(MR122,MR795)gray.tabgray8graycodingtablegray.tabdgray8graydecodingtablegrid.tabgrid61gridpointsatwichChebyshevpolynomialsareevaluatedinter_36.tabinter_625interpolationfiltercoefficientsinv_sqrt.tabtable49tableusedininversesquarerootcomputationlag_wind.tablag_h10highpartofthelagwindowtablelag_wind.tablag_l10lowpartofthelagwindowtable(continued)SIST EN 301 712 V7.3.1:2003



ETSIETSIEN301712V7.3.1(2000-06)13(GSM06.73version7.3.1Release1998)Table6(concluded):FixedtablesFileTablenameLengthDescriptionlog2.tabtable33tableusedinbase2logharithmcomputationlsp.tablsp_init_data10initializationtableforlsphistoryinDTXlsp_lsf.tabtable65tabletocomputecos(x)inLsf_lsp()lsp_lsf.tabslope64tabletocomputeacos(x)inLsp_lsf()ph_disp.tabph_imp_low_MR79540phasedispersionimpulseresponse(MR795)ph_disp.tabph_imp_mid_MR79540phasedispersionimpulseresponse(MR795)ph_disp.tabph_imp_low40phasedispersionimpulseresponse(MR475-MR67)ph_disp.tabph_imp_mid40phasedispersionimpulseresponse(MR475-MR67)pow2.tabtable33tableusedin2tothepowercomputationq_plsf_3.tabpast_rq_init80initializationtablefortheMApredictorinDTXq_plsf_3.tabmean_lsf10LSFmeans(notinMR122)q_plsf_3.tabpred_fac10LSFpredictionfactors(notinMR122)q_plsf_3.tabdico1_lsf3*2561stLSFquantizer(notinMR122andMR795)q_plsf_3.tabdico2_lsf3*5122ndLSFquantizer(notinMR122)q_plsf_3.tabdico3_lsf4*5123rdLSFquantizer(notinMR122,MR515andMR475)q_plsf_3.tabmr515_3_lsf4*1283rdLSFquantizer(MR515andMR475)q_plsf_3.tabmr795_1_lsf3*5121stLSFquantizer(MR795)q_plsf_5.tabmean_lsf10LSFmeans(MR122)q_plsf_5.tabdico1_lsf4*1281stLSFquantizer(MR122)q_plsf_5.tabdico2_lsf4*2562ndLSFquantizer(MR122)q_plsf_5.tabdico3_lsf4*2563rdLSFquantizer(MR122)q_plsf_5.tabdico4_lsf4*2564thLSFquantizer(MR122)q_plsf_5.tabdico5_lsf4*645thLSFquantizer(MR122)qgain475.tabtable_gain_MR4754*256gainquantizationtable(MR475)qua_gain.tabtable_gain_highrates128*4gainquantizationtable(MR67,MR74andMR102)qua_gain.tabtable_gain_lowrates64*4gainquantizationtable(MR515andMR59)R_fft.cphs_tbl128sine/cosinephasetableR_fft.cii_table8indexingtablesqrt_ltable49tabletocomputesqrt(x)Vad1.cch_tbl2*16channelenergycombinationtableVad1.cch_tbl_sh16channelenergyscalingtableVad1.cvm_tbl90voicemetrictableVad1.changover_table20usedtodeterminehangoverasafunctionofSNRVad1.cburstcount_table20usedtodetermineburstcountthresholdasafunctionofSNRVad1.cvm_thresh_table20usedtodeterminethevoicemetricthresholdasafunctionofSNRVad1.cenergystatetables2*6constantsasafunctionofscalingstatewindow.tabwindow_200_40240LPanalysiswindow(notinMR122)window.tabwindow_160_802401stLPanalysiswindow(MR122)window.tabwindow_232_82402ndLPanalysiswindow(MR122)4.5.3StaticvariablesusedintheC-codeInthissectiontwotablesthatspecifythestaticvariablesforthespeechencoderanddecoderrespectivelyareshown.AllstaticvariablesaredeclaredwithinaCstruct.SIST EN 301 712 V7.3.1:2003



ETSIETSIEN301712V7.3.1(2000-06)14(GSM06.73version7.3.1Release1998)Table7:SpeechencoderstaticvariablesStructnameVariableType[Length]DescriptionSpeech_Encode_FrameStatecod_amr_statecod_amrStateseebelowinthistablepre_statePre_ProcessStateseebelowinthistabledtxFlagIssetifDTXfunctionalityisusedcomplexityCounterintUsedforwMOPScountingPre_ProcessStatey2_hiWord16filterstate,upperwordy2_loWord16filterstate,lowerwordy1_hiWord16filterstate,upperwordy1_loWord16filterstate,lowerwordx0Word16filterstatex1Word16filterstatecod_amrStateold_speechWord16[320]speechbufferspeechWord16*pointertocurrentframeinold_speechp_windowWord16*pointertoLPCanalysiswindowinold_speechp_window_12k2Word16*pointertoLPCanalysiswindowwithnolookaheadinold_speech(MR122)new_speechWord16*pointertothelast160speechsamplesinold_speechold_wspWord16[303]bufferholdingspectralweightedspeechwspWord16*pointertothecurrentframeinold_wspold_lagsWord16[5]openloopLTPstatesol_gain_flgWord16[2]enablesopenlooppitchlagweighting(MR102)old_excWord16[314]excitationvectorexcWord16*currentexcitationai_zeroWord16[51]historyofweightedsynth.filterfollowedbyzerovectorzeroWord16*zerovectorh1Word16*impulseresponseofweightedsynthesisfilterhvecWord16[80]zerovectorfollowedbyimpulseresponselpcStlpcStateseebelowinthistablelspStlspStateseebelowinthistableclLtpStclLtpStateseebelowinthistablegainQuantStgainQuantStateseebelowinthistablepitchOLWghtStpitchOLWghtStateseebelowinthistabletonStabSttonStabStateseebelowinthistablevadStvadState1seebelowinthistablevadSt2vadState2seebelowinthistabledtxFlagissetifDTXfunctionalityisuseddtx_encStdtx_encStateseebelowinthistablemem_synWord16[10]synthesisfiltermemorymem_w0Word16[10]weightingfiltermemory(appliedtoerrorsignal)mem_wWord16[10]weightingfiltermemory(appliedtoinputsignal)mem_errWord16[50]filtermemoryforproductionoferrorvectorerrorWord16*errorsignal(inputminussynthesizedspeech)sharpWord16pitchsharpeninggainvadState1bckr_estWord16[9]backgroundnoiseestimateave_levelWord16[9]averagedinputcomponentsforstationaryestimationold_levelWord16[9]inputlevelsofthepreviousframesub_levelWord16[9]inputlevelscalculatedattheendofaframe(lookahead)a_data5Word16[6]memoryforthefilterbanka_data3Word16[5]memoryforthefilterbankburst_countWord16countslengthofaspeechbursthang_countWord16hangovercounterstat_countWord16stationarycountervadregWord1615flagsforintermediateVADdecisionspitchWord1615flagsforpitchdetectiontoneWord1615flagsfortonedetectioncomplex_highWord16flagsforcomplexdetectioncomplex_lowWord16flagsforcomplexdetectionoldlag_countWord16variablesforpitchdetectionoldlagWord16variablesforpitchdetectioncomplex_hang_countWord16complexhangovercounter,usedbyVADcomplex_hang_timerWord16hangoverinitiator,usedbyCADbest_corr_hpWord16filteredvaluespeech_vad_decisionWord16finaldecisioncomplex_warningWord16complexbackgroundwarningsp_burst_countWord16countslengthofaspeechburstinclHOadditioncorr_hp_fastWord16filteredvalue(continued)SIST EN 301 712 V7.3.1:2003



ETSIETSIEN301712V7.3.1(2000-06)15(GSM06.73version7.3.1Release1998)Table7(concluded):SpeechencoderstaticvariablesStructnameVariableType[Length]DescriptionvadState2pre_emp_memWord16inputpre-emphasismemoryupdate_cntWord16noiseupdatecounterhyster_cntWord16hysteresiscounterlast_update_cntWord16noiseupdatecountervalueforlastframech_enrg_long_dbWord16[16]longtermchannelenergyindBLframe_cntWord3210msframecounterLch_enrgWord32[16]channelenergyestimateLch_noiseWord32[16]channelnoiseestimatelast_normb_shiftWord16blockshiftfactorforlastframe,usedforpre_emp_memtsnrWord16totalestimatedpeakSNRindBhangoverWord16VADhangoverburstcountWord16numberofconsecutivevoiceactiveframesfupdate_flagWord16AflagtocontrolaforcedupdateofthenoiseestimatenegSNRvarWord16SNRvariabilitynegSNRbiasWord16sensitivitybiasshift_stateWord16indicatesscalingstateofchannelenergyestimateL_R0Word32LTPenergyL_RmaxWord32LTPmaxcorrelationLTP_flagFlagsetwhenopenlooppitchpredictiongain>thresholddtx_encStatelsp_histWord16[80]LSPhistory(8frames)log_en_histWord16[8]logarithmicframe
...

Questions, Comments and Discussion

Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.