您好,欢迎访问三七文档
Chapter5LosslessSourceCodingInformationTheoryandCodingGeneralmodelofdiscrete,lossless(无失真),non-memorysource:InputsymbolsetCodesymbolsetCodewordset12(,,...,);1,2,...,liiiiiiilsWxxxiq12{,,...,)irXxxx5.1LosslessencoderHowtocodelosslessly?Assumingthatthestatisticalcharacteristicsofthesourcecanbeignored,itmustsatisfythefollowingcondition.Togetthetargetoflosslesscoding,itmustconformtothecondition,whichguaranteesthatthereareplentyofcodesymbolstobeused.NlqrFromtheconditionwecangetaninequality,rqNlrqlNloglogE.g.5.1SupposeweonlyhavethefirsteightlettersofEnglishalphabet(AtoH)inourvocabulary.TheFixedLengthCode(FLC)forthissetofletterswouldbeLetterCodewordLetterCodewordA000E100B001F101C010G110D011H111FixedLengthCodeAVariableLengthCode(VLC)forthesamesetofletterscanbeLetterCodewordLetterCodewordA00E101B010F110C011G1110D100H1111VariableLengthCode1(Huffmancoding)Supposewehavetocodetheseriesofletters:”ABADCAB”.Thefixedlengthcodeandvariablelengthcoderepresentationsofthe7lettersareFixedLengthCode000001000011010000001Totalbits=21VariableLengthCode000100010001100010Totalbits=18ItcanbeseenthattheVLCusesafewernumberofbitsthanFLCsincetheletters,forexample,A,appearingmorefrequentlyinthesentencearerepresentedwithafewernumberofbits‘00’.Instantaneouscode(prefixcode)(1)Itisakindofuniquelydecodablecode(2)Inanunfixedlengthcode,thereisnoonecodebeingprefixtoothercodes.(3)Whendecoding,itdoesnotneedtorefertoitsfollowingcodes,andcanmakethejudgmentimmediately,carryingoutnon-delaydecoding.LetushavealookatExample5.1again.NowweconsideranotherVLCforthefirst8lettersofEnglishalphabet:LetterCodewordLetterCodewordA0E10B1F11C00G000D01H111VariableLengthCode2Thissecondvariablelengthcodeappearstobemoreefficientthanthefirstoneintermsofrepresentationoftheletters.VariableLengthCode1000100010001100010Totalbits=18VariableLengthCode2010010001Totalbits=9However,ithasdecodingproblems:Original:010010001--ABADCABNow:010010001--AEABAADOr010010001--ABAABAAABDefinition5.1APrefixCodeisoneinwhichnocodewordformstheprefixofanyothercodeword.SuchcodesarealsocalledUniquelyDecodableorInstantaneousCodes.TheoptimalcodeItisakindofuniquelydecodablecodeItsaveragecodelengthislessthanthatofanyotheruniquelydecodablecode.5.2.1Fixedlengthcodingtheorem5.2LosslesssourcecodingFixedlengthsourcecodingtheorem:Astothediscrete,non-memory,stationary,ergodicsourcesymbolsequenceS=(S1,S2…..Sq),wecanuserdifferentsymbolsX=(x1,x2….xr)toperformfixedlengthcode.Foranyε0andδ0,astotheN-expansionsource,Ifissatisfied,andwhenNisbigenough,thedecodingerrorcanbelessthanδ.Thefixedlengthcodingtheoremhaspresentedatheoreticallimitofthecodelengthusedforfixedlengthcoding.log()(0)lrHSNIftheequallengthcodeisdemandedtobeuniquelydecodable,thenitmusthas:IfN=1,then:Conclusion:foruniquedecoding,eachsourcesymbolneedsatleastcodesymbolstoberepresented.Whenusedual-codesymboltocode,r=2,then:Conclusion:whenuseequallengthdual-code,thelimitcodelengthofeachsourcesymbolislog/logqr1loglog()NlqlqbitNlog()qbitloglogNllqqrNrloglogqlrExample5.2.2Unfixedlength(Variablelength)sourcecodingSeveralconceptsofcodetype(Eg.2.4.2)Non-singularcodeandsingularcodeUniquelydecodablecodePrefixcode(instantaneouscode,non-delaycode)KrafttheoremUnfixedlengthcodingtheorem(ShannonFirstTheorem)Krafttheoremquestion:findreal-time,uniquelydecodablecodemethod:researchthecodepartitionconditionofthereal-timeuniquelydecodablecodeintroduction:conceptof“codetree”conclusion:presenttheconditionthatthereal-timeuniquelydecodablecode(prefixcode)exists,thatis,theKrafttheoremcodetreeThecorrespondingrelationshipbetweenVLCandcodetree:(1)Treeroot↔Startingpointofacodeword(2)Numberofbranchesfromatreenode↔Codedimension(3)Node↔Partofacodeword(4)Terminalnode↔Endofacodeword(5)Numberofbranches↔Codelength(6)Non-fullbranchtree↔Variablelengthcode(7)Fullbranchtree↔FixedlengthcodeBinarynon-fullbranchtreeBinaryfullbranchtreeTrinaryfullbranchtreeTheorem5.1(KraftInequality)AnecessaryandsufficientconditionfortheexistenceofabinaryprefixcodesetwhosecodewordshavelengthsisLnnn...21121Lknk000111CodetreemapforproofAveragelengthoftheprefixcodeAdiscretenon-memorystationarysourceItslimitsourceentropyisandthenumberofinputsymbolsetis.Thecodelengthofeachcodewordis,thentheaveragecodelengthofprefixcodeis)(SH11,...,...,...,iqiqSsSsSsSpppP,1,2,...,iliqql5.3.3Losslessunfixedlength(variablelength)sourcecodingtheorem1qiiillpLosslessunfixedlengthsourcecodingtheorem(ShannonFirstTheorem)Fordiscretenon-memorystationarysourceS,itslimitentropyisanditscodesignalsareX={x1,…,xr}.WecanalwayscodethesourceSbyusingacodingmethodtoconstructuniquelydecodablecode.Thustheaveragecodelengthofeachsourcesignalsatisfies:)(SH()()1loglogHsHslrrTheorem5.3(SourceCodingTheorem)LetXbethesetoflettersfromaDMSwithfiniteentropyH(X)andxk,k=1,2,…,Ltheoutputsymbols,occurringwithprobabilities.Giventheseparameters,itispossibletoconstructacodethatsatisfiestheprefixconditionandhasanaveragelengthRthatsatisfiesthefollowinginequalitykxP()()1HxRHxExample:discret
本文标题:第5章-无失真编码
链接地址:https://www.777doc.com/doc-7382206 .html