Home Tekniikka Koodisana

Koodisana



Konsepti

Koodisana viittaa Huffmancoden koodaamaan signaaliin.

Aframecontainsmdatabits(message)andrredundantbits(checkbits).Thetotallengthoftheframe=databits+redundantbits.TheX-thbitunitcontainingdataandcheckbitsusuallybecomesanX-bitcodeword.Thecodewordiscomposedofseveralcodeelements,andthecommunicationincomputercommunicationisrepresentedbyseveralbitsofbinarycode.

Becauseelectronicequipmentcanonlyrepresenttwostatesof0and1,sowhenprocessingsymbolselectronically,thesymbolsneedtobebinarycoded.Forexample,theASCIIcodeusedinthecomputeristhe8-bitbinarycodeofthecommonlyusedsymbolsinthecomputer.Inpractice,thecharacterscanalsobespecificallycodedaccordingtothesituation.

Toimintaperiaate

Olettaessaan, että tietyllä lähteellä on viisi symboliasu1,u2,u3,u4andu5,vastaava todennäköisyys onP1=0.4,P2=0.1,P3=P4=0.2,P5=0.1. aloita kahdesta pienimmällä todennäköisyydellä olevasta symbolista ja valitse yksihaara0jamuut oksat1.Valitsemme0ylemmälle haaralle1alahaaralle .Yhdistä sittenkahden koodatun haaran todennäköisyydet ja jono uudelleen.Käytä yllä olevaa menetelmää toistuvasti, kunnes yhdistetty todennäköisyys normalisoituu.Kuvista(a)ja(b)voidaan nähdä, että vaikka keskimääräinenkoodinpituus voi olla Hatis,koodausmenetelmä ei ole ainutkertainen.,Saattaa olla useita haaroja yhtä todennäköisyydellä, mikä johtaa ei-yksilöityyn jonotusmenetelmään. Yleensä jos uusi yhdistetty haara järjestetään ylempään haaraan yhtä todennäköisyydellä, se auttaa lyhentämään koodia ja lyhentämään koodinpituutta. kuvan koodaus(a)onparempi kuin(b).

ThecodewordoftheHuffmancode(thecodeofeachsymbol)isadifferentprefixcodeword,thatis,anycodewordwillnotbethefrontpartofanotherWhentransmittingtogether,thereisnoneedtoaddanisolationsymbolinthemiddle.Aslongasthereisnoerrorduringtransmission,thereceivingendcanstillseparateeachcodewordwithoutconfusion.

Inpracticalapplications,inadditiontousingregularcleaningtoeliminateerrordiffusionandbufferstoragetosolveratematching,themainproblemistosolvethestatisticalmatchingofsmallsymbolsets,suchasblack(1),white(0)Thestatisticalmatchingoffaxsourcesuses0and1runsofdifferentlengthstoformanenlargedsymbolsetsource.Runlengthreferstothelengthofthesamecodeelement(suchasthelengthornumberofacontinuousstringof0orastringof1inabinarycode).AccordingtotheCCITTstandard,itisnecessarytocount2×1728kindsofrunlengths(lengths),sothatthestoragecapacityduringimplementationistoolarge.Infact,theprobabilityofalongrunisverysmall,soCCITTalsostipulates:iflrepresentsthelengthoftherun,thenl=64q+r.Amongthem,qiscalledthemaincode,andristhebasecode.Whenencoding,therunlengthofnotlessthan64iscomposedofthemaincodeandthebasecode.Whenlisanintegermultipleof64,onlythecodeofthemaincodeisused,andthecodeofthebasecodenolongerexists.

ThemaincodeandbasecodeofthelongrunarebothcodedbyHuffmanrules,whichiscalledmodifiedHuffmancode,andtheresultsareavailableinatable.Thismethodhasbeenwidelyusedindocumentfaxmachines.

This article is from the network, does not represent the position of this station. Please indicate the origin of reprint
TOP