/
Chapter  Cyclic Codes Among the rst codes used practic Chapter  Cyclic Codes Among the rst codes used practic

Chapter Cyclic Codes Among the rst codes used practic - PDF document

lois-ondreau
lois-ondreau . @lois-ondreau
Follow
506 views
Uploaded On 2015-05-24

Chapter Cyclic Codes Among the rst codes used practic - PPT Presentation

It was quickly noticed by Prange that the class of cyclic codes has a rich algebraic structure the 64257rst indication that algebra would be a valuable tool in code design The linear code of length is a cyclic code if it is invariant under a cyclic ID: 73349

was quickly noticed

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "Chapter Cyclic Codes Among the rst code..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

Chapter8CyclicCodesAmongthe rstcodesusedpracticallywerethecycliccodeswhichweregen-eratedusingshiftregisters.ItwasquicklynoticedbyPrangethattheclassofcycliccodeshasarichalgebraicstructure,the rstindicationthatalgebrawouldbeavaluabletoolincodedesign.ThelinearcodeCoflengthnisacycliccodeifitisinvariantunderacycliccycliccodeshift:c=(c0;c1;c2:::;cn�2;cn�1)2Cifandonlyif~c=(cn�1;c0;c1:::;cn�3;cn�2)2C:AsCisinvariantunderthissinglerightcyclicshift,byiterationitisinvariantunderanynumberofrightcyclicshifts.Asasingleleftcyclicshiftisthesameasn�1rightcyclicshifts,Cisalsoinvariantunderasingleleftcyclicshiftandhenceallleftcyclicshifts.ThereforethelinearcodeCiscyclicpreciselywhenitisinvariantunderallcyclicshifts.Therearesomeobviousexamplesofcycliccodes.The0-codeiscertainlycyclicasisFn.Lesstrivially,repetitioncodesarecyclic.Thebinaryparitycheckcodeisalsocyclic,andthisgoesovertothesum-0codesoverany eld.Noticethatthisshiftinvariancecriteriondoesnotdependatalluponthecodebeinglinear.Itispossibletode nenonlinearcycliccodes,butthatisrarelydone.Thehistoryofcycliccodesasshiftregistercodesandthemathematicalstructuretheoryofcycliccodesbothsuggestthestudyofcyclicinvarianceinthecontextoflinearcodes.8.1BasicsItisconvenienttothinkofcycliccodesasconsistingofpolynomialsaswellascodewords.Witheveryworda=(a0;a1;:::;ai;:::;an�2;an�1)2Fn101 102CHAPTER8.CYCLICCODESweassociatethepolynomialofdegreelessthanna(x)=a0+a1x++aixi++an�1xn�12F[x]n:(Weseeherewhyinthischapterweindexcoordinatesfrom0ton�1.)IfcisacodewordofthecodeC,thenwecallc(x)theassociatedcodepolynomial.codepolynomialWiththisconvention,theshiftedcodeword~chasassociatedcodepolynomial~c(x)=cn�1+c0x+c1x2++cixi+1++cn�2xn�1:Thus~c(x)isalmostequaltotheproductpolynomialxc(x).Moreprecisely,~c(x)=xc(x)�cn�1(xn�1):Therefore~c(x)alsohasdegreelessthannandisequaltotheremainderwhenxc(x)isdividedbyxn�1.Inparticular~c(x)=xc(x)(modxn�1):Thatis,~c(x)andxc(x)areequalintheringofpolynomialsF[x](modxn�1),wherearithmeticisdonemodulothepolynomialxn�1.Ifc(x)isthecodepolynomialassociatedwithsomecodewordcofC,thenwewillallowourselvestoabusenotationbywritingc(x)2C:Indeed,iff(x)isanypolynomialofF[x]whoseremainder,upondivisionbyxn�1,belongstoCthenwemaywritef(x)2C(modxn�1):Withthesenotationalconventionsinmind,weseethatourde nitionofthecycliccodeChasthepleasingpolynomialformc(x)2C(modxn�1)ifandonlyifxc(x)2C(modxn�1):SinceadditionalshiftsdonottakeusoutofthecycliccodeC,wehavexic(x)2C(modxn�1);foralli.Bylinearity,foranyai2F,aixic(x)2C(modxn�1)andindeeddXi=0aixic(x)2C(modxn�1);Thatis,foreverypolynomiala(x)=Pdi=0aixi2F[x],theproducta(x)c(x)(ormoreproperlya(x)c(x)(modxn�1))stillbelongstoC.Thisobservation,duetoPrange,openedthewayfortheapplicationofalgebratocycliccodes. 8.1.BASICS103(8.1.1)Theorem.LetC6=f0gbeacycliccodeoflengthnoverF.(1)Letg(x)beamoniccodepolynomialofminimaldegreeinC.Theng(x)isuniquelydeterminedinC,andC=fq(x)g(x)jq(x)2F[x]n�rg;wherer=deg(g(x)).Inparticular,Chasdimensionn�r.(2)Thepolynomialg(x)dividesxn�1inF[x].Proof.AsC6=f0g,itcontainsnonzerocodepolynomials,eachofwhichhasauniquemonicscalarmultiple.Thusthereisamonicpolynomialg(x)inCofminimaldegree.Letthisdegreeber,uniqueevenifg(x)isnot.Bytheremarksprecedingthetheorem,thesetofpolynomialsC0=fq(x)g(x)jq(x)2F[x]n�rgiscertainlycontainedinC,sinceitiscomposedofthosemultiplesofthecodepolynomialg(x)withtheadditionalpropertyofhavingdegreelessthann.UnderadditionandscalarmultiplicationC0isanF-vectorspaceofdimensionn�r.Thepolynomialg(x)istheuniquemonicpolynomialofdegreerinC0.Toprove(1),wemustshowthateverycodepolynomialc(x)isanF[x]-multipleofg(x)andsoisinthesetC0.BytheDivisionAlgorithmA.2.5wehavec(x)=q(x)g(x)+r(x);forsomeq(x);r(x)2F[x]withdeg(r(x))r=deg(g(x)).Thereforer(x)=c(x)�q(x)g(x):Byde nitionc(x)2Candq(x)g(x)isinC0(asc(x)hasdegreelessthann).Thusbylinearity,therighthandsideofthisequationisinC,hencetheremaindertermr(x)isinC.Ifr(x)wasnonzero,thenitwouldhaveamonicscalarmultiplebelongingtoCandofsmallerdegreethanr.Butthiswouldcontradicttheoriginalchoiceofg(x).Thereforer(x)=0andc(x)=q(x)g(x),asdesired.Nextletxn�1=h(x)g(x)+s(x);forsomes(x)ofdegreelessthandeg(g(x)).Then,asbefore,s(x)=(�h(x))g(x)(modxn�1)belongstoC.Again,ifs(x)isnotzero,thenithasamonicscalarmultiplebelongingtoCandofsmallerdegreethanthatofg(x),acontradiction.Thuss(x)=0andg(x)h(x)=xn�1,asin(2).2Thepolynomialg(x)iscalledthegeneratorpolynomialforthecodeC.generatorpolynomialThepolynomialh(x)2F[x]determinedbyg(x)h(x)=xn�1 104CHAPTER8.CYCLICCODESisthecheckpolynomialofC.checkpolynomialUndersomecircumstancesitisconvenienttoconsiderxn�1tobethegeneratorpolynomialofthecycliccode0oflengthn.Thenbythetheorem,thereisaone-to-onecorrespondencebetweencycliccodesoflengthnandmonicdivisorsofxn�1inF[x].Example.Considerlength7binarycycliccodes.Wehavethefactor-izationintoirreduciblepolynomialsx7�1=(x�1)(x3+x+1)(x3+x2+1):Sincewearelookingatbinarycodes,alltheminussignscanbereplacedbyplussigns:x7+1=(x+1)(x3+x+1)(x3+x2+1):Asthereare3irreduciblefactors,thereare23=8cycliccodes(in-cluding0andF72).The8generatorpolynomialsare:(i)1=1(ii)x+1=x+1(iii)x3+x+1=x3+x+1(iv)x3+x2+1=x3+x2+1(v)(x+1)(x3+x+1)=x4+x3+x2+1(vi)(x+1)(x3+x2+1)=x4+x2+x+1(vii)(x3+x+1)(x3+x2+1)=x6+x5+x4+x3+x2+x+1(viii)(x+1)(x3+x+1)(x3+x2+1)=x7+1Herein(i)thepolynomial1generatesallF72.In(ii)we ndtheparitycheckcodeandin(vii)therepetitioncode.Asmentionedbefore,in(viii)weviewthe0-codeasbeinggeneratedbyx7+1.Thepolynomialsof(iii)and(iv)havedegree3andsogenerate[7;4]codes,whichweshalllaterseeareHammingcodes.The[7;3]codesof(v)and(vi)arethedualsoftheHammingcodes.(8.1.2)Problem.Howmanycycliccodesoflength8overF3arethere?Giveageneratorpolynomialforeachsuchcode.(8.1.3)Problem.Provethatthereisnocycliccodethatis(equivalentto)an[8;4]extendedbinaryHammingcode.(8.1.4)Problem.LetcycliccodeChavegeneratorpolynomialg(x).ProvethatCiscontainedinthesum-0codeifandonlyifg(1)=0.(8.1.5)Problem.LetCbeacycliccode.LetC�bethecoderesultingfromshorteningCatasingleposition,andletC�bethecoderesultingfrompuncturingCatasingleposition.(a)GiveallCforwhichC�iscyclic.(b)GiveallCforwhichC�iscyclic.Thecheckpolynomialearnsitsnamebythefollowing 8.1.BASICS105(8.1.6)Proposition.IfCisthecycliccodeoflengthnwithcheckpolynomialh(x),thenC=fc(x)2F[x]njc(x)h(x)=0(modxn�1)g:Proof.Thecontainmentinonedirectioniseasy.Indeedifc(x)2C,thenbyTheorem8.1.1thereisaq(x)withc(x)=q(x)g(x).Butthenc(x)h(x)=q(x)g(x)h(x)=q(x)(xn�1)=0(modxn�1):Nowconsideranarbitrarypolynomialc(x)2F[x]nwithc(x)h(x)=p(x)(xn�1);say:Thenc(x)h(x)=p(x)(xn�1)=p(x)g(x)h(x);hence(c(x)�p(x)g(x))h(x)=0:Asg(x)h(x)=xn�1,wedonothaveh(x)=0.Thereforec(x)�p(x)g(x)=0andc(x)=p(x)g(x);asdesired.2Ifweareinpossessionofageneratorpolynomialg(x)=Prj=0gjxjforthecycliccodeC,thenwecaneasilyconstructageneratormatrixforC.ConsiderG=26666664g0g1gr�1gr00:::00g0g1gr�1gr0:::0........................................................................00:::0g0g1gr�1gr37777775ThematrixGhasncolumnsandk=n�rrows;sothe rstrow,rowg0, nisheswithastringof0'soflengthk�1.Eachsuccessiverowisthecyclicshiftofthepreviousrow:gi=~gi�1,fori=1;:::;k�1.Asg(x)h(x)=xn�1,wehaveg0h0=g(0)h(0)=0n�16=0:Inparticularg06=0(andh06=0).ThereforeGisinechelonform(althoughlikelynotreduced).Inparticularthek=dim(C)rowsofGarelinearlyinde-pendent.ClearlytherowsofGbelongtoC,soGisindeedageneratormatrixforC,sometimescalledthecyclicgeneratormatrixofC.cyclicgeneratormatrix 106CHAPTER8.CYCLICCODESForinstance,ifCisa[7;4]binarycycliccodewithgeneratorpolynomial1+x+x3,thenthecyclicgeneratormatrixis266411010000110100001101000011013775GiventhecyclicgeneratormatrixG,cyclicencodingistheprocessofen-cyclicencodingcodingthemessagek-tuplem=(m0;:::;mk�1)intothecodewordc=mG.Atthepolynomiallevel,thiscorrespondstoencodingthemessagepolynomialmessagepolynomialm(x)=Pk�1i=0mixiintothecodepolynomialc(x)=m(x)g(x).SincethecyclicgeneratorGisinechelonform,the rstkcoordinatepo-sitionsformaninformationset.ThereforecyclicChasastandardgeneratormatrix,althoughthecyclicgeneratormatrixisalmostneverstandard(orevensystematic).(8.1.7)Problem.(a)Describeallsituationsinwhichthecyclicgeneratormatrixforacycliccodeisthestandardgeneratormatrix.(b)Describeallsituationsinwhichthecyclicgeneratormatrixforacycliccodeissystematic.WenextpresentforcyclicCalinearencodingmethodcorrespondingtothestandardgeneratormatrix.Namelym=(m0;:::;mk�1)7!c=(m0;:::;mk�1;�s0;�s1;:::;�sr�1);wheres(x)=Pr�1j=0sjxjistheremainderupondividingxrm(x)byg(x).Thatis,xrm(x)=q(x)g(x)+s(x);withdeg(s(x))deg(g(x))=r.Toseethatthisisthecorrectstandardencod-ing, rstnotethatxrm(x)�s(x)=q(x)g(x)=b(x)2Cwithcorrespondingcodewordb=(�s0;�s1;:::;�sr�1;m0;:::;mk�1):AsthisisacodewordofcyclicC,everycyclicshiftofitisalsoacodeword.Inparticularthecgivenaboveisfoundafterkrightshifts.ThuscisacodewordofC.SinceCissystematiconthe rstkpositions,thiscodewordistheonlyonewithmonthosepositionsandsoistheresultofstandardencoding.Toconstructthestandardgeneratormatrixitself,weencodethekdi erentk-tuplemessages(0;0;:::;0;1;0;:::;0)ofweight1correspondingtomessagepolynomialsxi,for0ik�1.Thesearetherowsofthestandardgeneratormatrix.Whenwetrythisforthe[7;4]binarycycliccodewithgeneratorx3+x+1(sor=7�4=3),we nd,forinstance,x3x2=(x2+1)(x3+x+1)+(x2+x+1) 8.1.BASICS107sothatthethirdrowofthestandardgeneratormatrix,correspondingtomessagepolynomialx2,is(m0;m1;m2;m3;�s0;�s1;�s2)=(0;0;1;0;1;1;1):Proceedinginthisway,we ndthatthestandardgeneratormatrixis266410001100100011001011100011013775ByProblem4.1.9,CisaHammingcode(althoughthiscanalsobecheckedeasilybyhand).Thisprocessofsystematicencodingforcycliccodesisimportantinpractice,systematicencodingsinceamachinecanbetransmittingtheinformationsymbolsfrommduringthetimeitiscalculatingthechecksymbolssj.(8.1.8)Problem.(a)Findthecyclicandstandardgeneratormatricesforthe[7;4]binarycycliccodeDwithgeneratorpolynomialx3+x2+1.(b)Findthecyclicandstandardgeneratormatricesforthe[15;11]binarycycliccodeEwithgeneratorpolynomialx4+x+1.(c)ProvethatDandEareHammingcodes.Acodeequivalenttoacycliccodeneednotbecyclicitself.Forinstance,thereare30distinctbinary[7;4]Hammingcodes;but,aswesawintheexampleabove,onlytwoofthemarecyclic.Onepermutationdoestakecycliccodestocycliccodes.ThereversecodereversecodeC[�1]ofacycliccodeC,gottenbyreversingeachcodeword,isstillcyclic.Wehave(c0;c1;:::;ci;:::;;cn�1)2C()(cn�1;:::;cn�1�i;:::;c1;c0)2C[�1]:Inpolynomialnotation,thisbecomesc(x)2C()xn�1c(x�1)2C[�1]:Forthepolynomialp(x)ofdegreed,weletitsreciprocalpolynomialbegivenbyreciprocalpolynomialp[�1](x)=dXi=0pd�ixi=xdp(x�1):Therootsofthereciprocalpolynomialarethereciprocalsofthenonzerorootsoftheoriginalpolynomial.(8.1.9)Lemma.Ifg(x)generatescyclicC,theng�10g[�1](x)generatesC[�1],thereversecodeofC. 108CHAPTER8.CYCLICCODESProof.StartingfromthecyclicgeneratormatrixforC,wereversealltherowsandthenwritethemfrombottomtotop.Theresultis26666664grgr�1g1g000:::00grgr�1g1g00:::0........................................................................00:::0grgr�1g1g037777775:TherowsofthismatrixcertainlybelongtoC[�1].Asbefore,theyarelinearlyindependentsinceg06=0.ThereforewehaveageneratormatrixforC[�1].Its rstrowvisiblycorrespondstoanonzerocodepolynomialofdegreelessthanr,whichisseentobeg[�1](x).ByTheorem8.1.1themonicscalarmultipleg�10g[�1](x)isthegeneratorpolynomial.(Infact,wehaveascalarmultipleofthecyclicgeneratormatrixforC[�1].)2ItiseasytoseethatthedualofacycliccodeCisagainacycliccode.Proposition8.1.6suggeststhatthedualisassociatedwiththecheckpolynomialofC.LetthecycliccodeCoflengthnhavegeneratorpolynomialg(x)ofdegreerandcheckpolynomialh(x)ofdegreek=n�r=dimC.Ash(x)isadivisorofxn�1,itisthegeneratorpolynomialforacycliccodeDoflengthnanddimensionn�k=n�(n�r)=r.WehaveC=fq(x)g(x)jq(x)2F[x]kgandD=fp(x)h(x)jp(x)2F[x]rg:Letc(x)=q(x)g(x)2C,sothatdeg(q(x))k�1;andletd(x)=p(x)h(x)2D,sothatdeg(p(x))r�1.Considerc(x)d(x)=q(x)g(x)p(x)h(x)=q(x)p(x)(xn�1)=s(x)(xn�1)=s(x)xn�s(x);wheres(x)=q(x)p(x)withdeg(s(x))(k�1)+(r�1)=r+k�2=n�2n�1:Thereforethecoecientofxn�1inc(x)d(x)is0.Ifc(x)=Pn�1i=0cixiandd(x)=Pn�1j=0djxj,theningeneralthecoecientofxminc(x)d(x)isPi+j=mcidj.In 8.2.CYCLICGRSCODESANDREED-SOLOMONCODES109particular,thetwodeterminationsofthecoecientofxn�1inc(x)d(x)give0=Xi+j=n�1cidj=n�1Xi=0cidn�1�i=c0dn�1+c1dn�2++cidn�i++cn�1d0=cd:wherec=(c0;c1;:::;ci;:::;cn�1)andd=(dn�1;dn�2;:::;dn�i;:::;d0):Thatis,eachcodewordcofChasdotproduct0withthereverseofeachcodeworddofD.ThereforeC?containsD[�1].Alsodim(C?)=n�dim(C)=n�k=r=n�deg(h[�1](x))=dim(D[�1]);sofromLemma8.1.9weconclude(8.1.10)Theorem.IfCisthecycliccodeoflengthnwithcheckpolynomialh(x),thenC?iscyclicwithgeneratorpolynomialh�10h[�1](x).28.2CyclicGRScodesandReed-SolomoncodesFor aprimitiventhrootofunityinthe eldF,set (a)=(( 0)a;:::;( j)a;:::;( n�1)a)=(( a)0;:::;( a)j;:::;( a)n�1):Inparticular, = (1)and (0)=1,theall1-vector.Thebasicobservationisthat~ (a)=(( n�1)a;( 0)a;:::;( j)a;:::;( n�2)a)= �a(( 0)a;( 1)a;:::;( j)a;:::;( n�1)a)= �a (a):Thusacyclicshiftof (a)isalwaysascalarmultipleof (a).(8.2.1)Proposition.GRSn;k( ; (a))iscyclic.Proof.For0ik�1and0jn�1,the(i;j)-entryofthecanonicalgeneratormatixisvj ij=( j)a( j)i= ja ji=( j)a+i: 110CHAPTER8.CYCLICCODESThereforethecanonicalgeneratormatrixhasasrowsthekcodewords (a+i),fori=0;:::;k�1.Wehaveseenabovethatshiftinganyoftheseonlygivesscalarmultiples,sothecodeitselfisinvariantundershifting.2AcycliccodeGRSn;k( ; (a))asinProposition8.2.1isaReed-Solomoncode.Itissaidtobeprimitiveifn=jFj�1andofnarrow-senseifa=0(soReed-Solomoncodeprimitivenarrow-sensethatv= (a)=1).(8.2.2)Lemma.If n=1and =( 0;:::; n�1),thenGRSn;k( ; (a))?=GRSn;n�k( ; (1�a)):Proof.ByTheorem5.1.6GRSn;k( ; (a))?=GRSn;n�k( ;u);where,for0jn�1andv= (a),wehaveuj=v�1jLj( j)�1.ByProblem5.1.5(c),Lj( j)=n( j)�1(6=0).Thusuj=(( j)a)�1(n( j)�1)�1=n�1 �ja j=n�1( j)1�aThereforeu=n�1 (1�a),sobyProblem5.1.3(a)GRSn;k( ; (a))?=GRSn;n�k( ;n�1 (1�a))=GRSn;n�k( ; (1�a))asdesired.2(8.2.3)Theorem.An[n;k]Reed-SolomoncodeoverFisacycliccodewithgeneratorpolynomialtYj=1(x� j+b)wheret=n�k,theintegerbisa xedconstant,and isaprimitiventhrootofunityinF.ThisReed-Solomoncodeisprimitiveifn=jFj�1andnarrow-senseifb=0.Proof.LetC=GRSn;k( ; (a)).TherowsofthecanonicalgeneratormatrixofthedualcodeC?are,byLemma8.2.2andapreviouscalculation,thevectors (j�a),for1jt.Therefore,forc=(c0;:::;ci;:::;cn�1)and 8.3.CYLICALTERNANTCODESANDBCHCODES111c(x)=Pn�1i=0cixi,c2C()c (j�a)=0;1jt()n�1Xi=0ci( i)j�a=0;1jt()n�1Xi=0ci( j�a)i=0;1jt()c( j�a)=0;1jt:Thus,writingcyclicCintermsofpolynomials,wehavebyLemmaA.2.8c(x)2C()c( j�a)=0;1jt()tYj=1(x� j+b)dividesc(x);forb=�a.AsQtj=1(x� j+b)ismonicandhasdegreet=n�k,itisthegeneratorpolynomialofCbyTheorem8.1.1.Also isaprimitiveelementofFwhenn=jFj�1;andCisnarrow-sensewhena=0,thatis,whenb=�a=0.2Inmostplaces,thestatementofTheorem8.2.3istakenasthede nitionofaReed-Solomoncode.ItisthenproventhatsuchacodeisMDSwithdmin=t+1=n�k+1.OurdevelopmentissomewhatclosertotheoriginalpresentationofReedandSolomonfrom1960.(8.2.4)Problem.ProvethatEGRSq+1;k( ; ;w),wherejFj=q,ismonomiallyequivalenttoacycliccodewhenqisevenandtoanegacycliccodewhenqisodd.HereacodeCisnegacyclicprovidednegacyclic(c0;c1;c2:::;cn�2;cn�1)2Cifandonlyif(�cn�1;c0;c1:::;cn�3;cn�2)2C:(Hint:SeeTheorem6.3.4.)8.3CylicalternantcodesandBCHcodesLetKFbe elds.StartingwiththeReed-SolomoncodeGRSn;k( ; (a))overF,thecyclic,alternantcodeC=Kn\GRSn;k( ; (a))iscalledaBCHcodeofdesigneddistancet+1,wheret=n�k.Cisprimitiveifn=jFj�1andnarrow-senseifa=0(thatistosay,v=1). 112CHAPTER8.CYCLICCODES(8.3.1)Theorem.ABCHcodeCoflengthnanddesigneddistancet+1overKisacycliccodecomposedofallthosecodepolynomialsc(x)2K[x]ofdegreelessthannsatisfyingc( b+1)=c( b+2)=c( b+3)==c( b+t)=0;wherebisa xedintegerand isaprimitiventhrootofunityinthe eldFK.Thecodeisprimitiveifn=jFj�1andisnarrow-senseifb=0.ThecodeCislinearandcyclicwithgeneratorpolynomiallcm1jtfm j+b;K(x)g:Ithasminimumdistanceatleastt+1anddimensionatleastn�mt,wherem=dimKF.Proof.The rstparagraphisanimmediateconsequenceofTheorem8.2.3andthede nitions.AsCisthealternantcodeKn\GRSn;k( ; (a)),itisbyTheorem7.5.1linearofminimumdistanceatleastn�k+1=t+1anddimensionatleastn�m(n�k)=n�mt.Theformtakenbythegeneratorpolynomialfollowsfromthe rstparagraphandLemmaA.3.19oftheAppendix.2AswithReed-Solomoncodes,the rstparagraphofthistheoremconsistsoftheusualde nitionofaBCHcode.Indeed,thatisessentiallytheoriginaldef-initionasgivenbyBoseandRay-Chaudhuri(1960)andHocquenghem(1959).(Thecodeswerethengiventhesomewhatinaccurateacronymasname.)ItthenmustbeproventhatthedesigneddistanceofaBCHcodegivesalowerboundfortheactualminimumdistance.InmanyplacesReed-Solomoncodesarede nedasthoseBCHcodesinwhichthe eldsFandKarethesame.Historically,thetwoclassesofcodeswerediscoveredindependentlyandtheconnectionsonlynoticedlater.Sometimesonetakesadi erentviewofTheorem8.3.1,viewingitinsteadasageneralboundoncycliccodesintermsofrootpatternsforthegeneratorpolynomial.(8.3.2)Corollary.(BCHBound.)LetCbeacycliccodeoflengthnoverKwithgeneratorpolynomialg(x).Supposethatg( j+b)=0,forsome xedband1jt,where isaprimitiventhrootofunityinthe eldFK.Thendmin(C)t+1.Proof.Inthiscase,CisasubcodeofaBCHcodewithdesigneddistancet+1.2Thiscorollaryadmitsmanygeneralizations,thegeneralformofwhichstatesthatacertainpatternofrootsforthegeneratorpolynomialofacycliccodeimpliesalowerboundfortheminimumdistance. 8.3.CYLICALTERNANTCODESANDBCHCODES113(8.3.3)Problem.AssumethatthecycliccodeChasgeneratorpolynomialg(x)withg(1)6=0.Provethat(x�1)g(x)isthegeneratorpolynomialofthesum-0subcodeofC(thosecodewordsofCwhosecoordinateentriessumto0).ThelastsentenceinthetheoremgivesustwolowerboundsforBCHcodes,onefortheminimumdistance(theBCHbound)andoneforthedimension.Aswepreferlargedistanceanddimension,wewouldhopeto ndsituationsinwhichoneorbothoftheseboundsarenotmetexactly.Foranycycliccode,thegeneratorpolynomialhasdegreeequaltotheredundancyofthecode.InTheorem8.3.1thatdegree/redundancyisboundedabovebymt.Thisboundwillbemetexactlyifandonlyifeachoftheminimalpolynomialsm j+b;K(x)hasthemaximumpossibledegreemand,additionally,allofthesepolynomials,for1jt,aredistinct.Thissoundsanunlikelyeventbutcan,infact,happen.Converselyweoftencanmakeourchoicessoastoguaranteethatthedegreeofthegeneratorisdramaticallylessthanthismaximum.Weshallseebelowthatthetwoboundsofthetheoremareindependentandcanbeeithermetorbeaten,dependinguponthespeci ccircumstances.(BothboundsaretightforReed-Solomoncodes,butthereareothercasesaswellwherethishappens.)(8.3.4)Corollary.(1)Abinary,narrow-sense,primitiveBCHcodeofdesigneddistance2isacyclicHammingcode.(2)Abinary,narrow-sense,primitiveBCHcodeofdesigneddistance3isacyclicHammingcode.Proof.Letn=2m�1andK=F2F2m=F.Let beaprimitiveelementinF2m(soithasordern).Thentheassociateddesigneddistance2codeC2hasgeneratorpolynomialm(x)=m (x)=m ;F2(x)ofdegreem,theminimalpolynomialof overtheprimesub eldF2.Thecorrespondingdesigneddistance3codeC3hasgeneratorpolynomiallcmfm (x);m 2(x)g:FromTheoremA.3.20welearnthatm 2(x)=m (x).Thereforethislcmisagainequaltom(x),andC2andC3bothhavegeneratorpolynomialm(x)ofdegreem.ThusC2=C3hasdimensionn�m=2m�1�mandminimumdistanceatleast3.ItisthereforeaHammingcodebyProblem4.1.3orProblem4.1.9.(AlternativelyC2is,byLemma8.2.2,equaltothealternantcodeFn2\GRSn;1( ; )?,whichwehavealreadyidenti edasaHammingcodeinSection7.5.)2Fromthiscorollarywelearnthatitispossibleto ndBCHcodeswithinequalityinthedistancebound(BCHbound)andequalityinthedimensionboundofTheorem8.3.1(dmin(C2)=3�1+1anddim(C2)=n�m1)andalsoBCHcodeswithequalityinthedistanceboundandinequalityinthedimensionbound(dmin(C3)=3=2+1anddim(C3)=n�m�n�m2). 114CHAPTER8.CYCLICCODESAsinthecorollary,narrow-sensecodesfrequentlyhavebetterparametersthanthosethatarenot.Forinstance,inthesituationofthecorollary,thedesigneddistance2codewithb=�1hasgeneratorpolynomialm 1�1;F2(x)=x�1.Thiscodeistheparitycheckcodewithdminindeedequalto2anddimensionn�1(�n�m).Whenn=15(sothatm=4),thedesigneddistance2codewithb=2hasgeneratorpolynomialm 1+2;F2(x)=x4+x3+x2+x+1=(x5�1)=(x�1);since( 3)5= 15=1.Thereforethiscodemeetsbothboundsexactly,hav-ingdimension11=15�4andminimumdistance2,asitcontainsthecodepolynomialx5�1.Considernextthebinary,narrow-sense,primitiveBCHcodewithlength15anddesigneddistance5,de nedusingasprimitiveelement arootoftheprimitivepolynomialx4+x+1.Thegeneratorpolynomialis,byTheorem8.3.1,g(x)=lcm1j4fm j(x)g:Byde nitionm (x)=x4+x+1,andwefoundm 3(x)=x4+x3+x2+x+1above.ByTheoremA.3.20oftheAppendix,m (x)=m 2(x)=m 4(x);thereforeg(x)=m (x)m 3(x)=(x4+x+1)(x4+x3+x2+x+1)=x8+x7+x6+x4+1:Inparticular,thecodehasdimension15�8=7,whereastheboundofTheorem8.3.1isuseless,claimingonlythatthedimensionisatleast15�44=�1.Furthermoreg(x)itselfhasweight5,sointhiscasethedesigneddistance5codehasminimumdistanceexactly5.(Althoughthegeneratorpolynomialalwayshasrelativelylowweight,ingeneralitwillnothavetheminimumweight.Stillitisoftenworthchecking.)Weseeagainheretheadvantageoflookingatnarrow-sensecodes.ByTheoremA.3.20,whenever iisarootofm(x),then 2iisaswell(inthebinarycase).Inparticular,thebinary,narrow-sense,designeddistance2dcode,givenbyroots j,for1j2d�1,isalsoequaltothedesigneddistance2d+1code,givenbyroots j,for1j2d,since darootimplies 2disaswell.(WesawaparticularcaseofthisinCorollary8.3.4.)SimilarbutweakerstatementscanbemadefornonbinaryBCHcodesbyappealingtoTheoremA.3.20orthemoregeneralProblemA.3.21.WealsoseethatTheoremA.3.20andProblemA.3.21canbeusede ec-tivelytocalculatetheparametersandgeneratorpolynomialsofBCHcodes.Considernextabinary,narrow-sense,primitiveBCHcodeCoflength31withdesigneddistance8.ThepreviousparagraphalreadytellsusthatCisalsothecorrespondingdesigneddistance9code,butmoreistrue.Wehavegeneratorpolynomialg(x)=lcm1j8fm j(x)g=m (x)m 3(x)m 5(x)m 7(x); 8.3.CYLICALTERNANTCODESANDBCHCODES115where isanarbitrarybut xedprimitive31strootofunityinF32.ByTheoremA.3.20m (x)=(x� )(x� 2)(x� 4)(x� 8)(x� 15);m 3(x)=(x� 3)(x� 6)(x� 12)(x� 24)(x� 17);m 5(x)=(x� 5)(x� 10)(x� 20)(x� 9)(x� 18);m 7(x)=(x� 7)(x� 14)(x� 28)(x� 25)(x� 19):ThereforeChasdimension31�45=11.Wealsodiscoverthatwehavegottentheroots 9and 10`forfree',sothatthedesigneddistance8(9)BCHcodeisactuallyequaltothedesigneddistance11code(sointhiscase,neitheroftheboundsofTheorem8.3.1holdwithequality).ItisworthnotingthatwecancalculatethisdimensionandimprovedBCHboundwithoutexplicitly ndingthegeneratorpolynomial.Thecalculationsarevalidnomatterwhichprimitiveelement wechoose.Examplesbelow ndexplicitgeneratorpolynomials,usingsimilarcalculationsbaseduponTheoremA.3.20.Thegoodfortuneseeninthepreviousparagraphcanoftenbedramatic.Berlekamphasnotedthatthebinary,narrow-sense,primitiveBCHcodeoflength212�1anddesigneddistance768isequaltothecorrespondingdesigneddistance819code.Ontheotherhand,therearemanysituationswheretheBCHboundstilldoesnotgivethetrueminimumdistance.Roos,VanLint,andWilsonhavenotedthatthebinarylength21codewithgeneratorpolynomialm (x)m 3(x)m 7(x)m 9(x);whichhasasroots j( a21strootofunity)forj2f1;2;3;4;6;7;8;9;11;12;14;15;16;18g;hastrueminimumdistance8,whereastheBCHboundonlyguaranteesdistanceatleast5.Examples.(i)Let bearootoftheprimitivepolynomialx4+x3+12F2[x].Whatisthegeneratorofthebinary,narrow-sense,primitiveBCHcodeC1oflength15anddesigneddistance5?Thecodeiscomposedofallpolynomialsc(x)2F2[x]thathaveeachof 1; 2; 3; 4asaroot.Thereforec(x)isdivisiblebym (x)=(x� 1)(x� 2)(x� 4)(x� 8)=x4+x3+1andalsobym 3(x)=(x� 3)(x� 6)(x� 12)(x� 9)=x4+x3+x2+x+1:SoC1hasgeneratorg1(x)=(x4+x3+1)(x4+x3+x2+x+1)=x8+x4+x2+x+1: 116CHAPTER8.CYCLICCODESAsg1(x)hasdegree8,thecodehasdimension15�8=7.(Hereagainthegeneratorhasweight5,sotheminimaldistanceofthiscodeequals5.)(ii)Let bearootoftheprimitivepolynomialx5+x2+12F2[x].Whatisthegeneratorofthebinary,narrow-sense,primitiveBCHcodeC2oflength31anddesigneddistance5?Againthecodeiscomposedofallpolynomialsc(x)2F2[x]thathaveeachof 1; 2; 3; 4asaroot.Thereforec(x)isdivisiblebym (x)=(x� 1)(x� 2)(x� 4)(x� 8)(x� 16)=x5+x2+1andalsom 3(x)=(x� 3)(x� 6)(x� 12)(x� 24)(x� 17)=x5+x4+x3+x2+1:SoC2hasgeneratorg2(x)=(x5+x2+1)(x5+x4+x3+x2+1)=x10+x9+x8+x6+x5+x3+1:Asg2(x)hasdegree10,thecodehasdimension31�10=21.(Butnoticethatheretheweightofthegeneratorislargerthan5.)(iii)MaintainingthenotationofExample(ii), ndthegeneratoroftheBCHcodeC3oflength31withdesigneddistance7.Thecodepolynomialsc(x)mustsatisfyc( 1)=c( 2)=c( 3)=c( 4)=c( 5)=c( 6)=0:Inparticularc(x)mustbeamultipleofg2(x),calculatedinthepreviousexample.Butc(x)mustalsobeamultipleofm 5(x)=(x� 5)(x� 10)(x� 20)(x� 9)(x� 18)=x5+x4+x2+x+1:(ThiscalculationisdoneindetailinsectionA.3.3oftheAppendixonalgebra.)Thusthegeneratorg3(x)forC3isg2(x)(x5+x4+x2+x+1)=x15+x11+x10+x9+x8+x7+x5+x3+x2+x+1:Thiscodehasdimension31�15=16.(iv)Let bearootoftheirreduciblebutimprimitivepolynomialx3+2x+22F3[x]sothat isa13throotofunity.Wecan,using , ndthegeneratorpolynomialoftheternary,narrow-senseBCHcodeD1oflength13withdesigneddistance4.Thecodepolynomialsmusthaveasroots , 2,and 3.Thustheymustbemultiplesofm (x)=m 3(x)=(x� )(x� 3)(x� 9)=x3+2x+2andofm 2(x)=(x� 2)(x� 6)(x� 5)=x3+x2+x+2: 8.4.CYCLICHAMMINGCODESANDTHEIRRELATIVES117ThereforeD1hasgeneratorg4(x)=(x3+2x+2)(x3+x2+x+2)=x6+x5+x2+1:Inparticularthecodehasdimension13�6=7.Alsoitsgeneratorhasweight4,soitsminimaldistanceisequaltoitsdesigneddistance4.(8.3.5)Problem.Givethegeneratorpolynomialoftheternary,narrow-senseBCHcodeD2oflength13withdesigneddistance5,using ofExample(iv)aboveasaprimitive13throotofunity.WhatisthedimensionofD2?(8.3.6)Problem.Givethegeneratorpolynomialoftheternary,narrow-sense,primitive,BCHcodeD3oflength26withdesigneddistance4,usingasprimitiveelement arootofthepolynomialx3+2x+12F3[x].WhatisthedimensionofD3?(8.3.7)Problem.(a)Whatisthedimensionofabinary,narrow-sense,primitiveBCHcodeoflength63anddesigneddistance17.(b)Doesthiscodecontainanycodewordsofweight17?Explainyouranswer.(8.3.8)Problem.Provethatanarrow-sense,primitiveBCHcodeoflength24overF5withdesigneddistance3hasminimumdistance3anddimension20=24�2(3�1).8.4CyclicHammingcodesandtheirrelativesCyclicbinaryHammingcodesandcodesrelatedtothemareofparticularin-terest.(8.4.1)Theorem.Foreverym,thereisacyclic,binaryHammingcodeofredundancym.IndeedanyprimitivepolynomialofdegreeminF2[x]generatesacyclicHammingcodeofredundancym.Proof.ThisisessentiallyequivalenttoCorollary8.3.4(inviewofTheoremsA.3.8andA.3.10onthegeneralstructureandexistenceof nite elds).2(8.4.2)Theorem.Thepolynomialg(x)2F2[x]generatesacyclic,binaryHammingcodeifandonlyifitisprimitive.Proof.InTheorem8.4.1wehaveseenthatabinaryprimitivepolynomialgeneratesacyclicHammingcode.NowletCbeabinary,cyclicHammingcodeoflength2m�1=n.Letg(x)=Qri=1gi(x),wherethegi(x)aredistinctirreduciblepolynomialsofdegreemi,sothatPri=1mi=m=degg(x).Thengi(x)dividesxni�1withni=2mi�1,henceg(x)dividesxn0�1wheren0=Qri=1ni.Nown+1=2m�1+1=rYi=12mi=rYi=1(ni+1):Ifr6=1,thenn�n0andxn0�1isacodewordofweight2inC,whichisnotthecase.Thereforeg(x)=g1(x)isirreducibleanddividesxn�1.Indeedg(x)isprimitive,asotherwiseagaintherewouldbeacodepolynomialxp�1ofweight2.2 118CHAPTER8.CYCLICCODES(8.4.3)Problem.ProvethatthereexistsacyclicHammingcodeofredundancymandlength(qm�1)=(q�1)overFqifgcd((qm�1)=(q�1);q�1)=1.(Hint:Forconstructiontryasbeforeto ndsuchacodeasasub eldsubcodeofaReed-Solomoncode.)8.4.1Evensubcodesanderrordetection(8.4.4)Lemma.LetF=F2m(m�1),andletp(x)beaprimitivepolynomialofdegreeminF2[x].Thepolynomialg(x)=(x+1)p(x)generatestheevensubcodeEcomposedofallcodewordsofevenweightintheHammingcodewithgeneratorp(x).Inparticular,Ehasminimumweight4.Proof.ThegeneratorpolynomialforEisamultipleofthegeneratorpolynomialp(x)fortheHammingcode,andsoEiscontainedintheHammingcode.Foranyc(x)=a(x)q(x)=a(x)(x+1)p(x)2E;wehavec(1)=a(1)(1+1)p(1)=0:ThereforeEiscontainedintheevensubcodeoftheHammingcode.Asthecodeshavethesamedimension,theyareequal.TheHammingcodehasminimumweight3,soEhasminimumweight4.2TheevencyclicHammingsubcodeslikeEhaveoftenbeenusedfordetectingerrorsincomputerapplications.Inthatcontext,theyareoftencalledCRCcodes(for`cyclicredundancychecking').WedevotesometimetodetectionCRCcodesissuesforgenerallinearandcycliccodes.Werecallthaterrordetectionistheparticularlysimpletypeoferrorcontrolinwhichareceivedwordisdecodedtoitselfifitisacodewordandotherwiseadecodingdefaultisdeclared.(SeeProblems2.2.2and2.2.3.)Foralinearcode,thiscanbegaugedbywhetherornotthereceivedwordhassyndrome0.(8.4.5)Lemma.LetCbealinearcode.(1)Cdetectsanyerrorpatternthatisnotacodeword.(2)Cdetectsanynonzeroerrorpatternwhosenonzeroentriesarerestrictedtothecomplementofaninformationset.Proof.Anerrorpatternthatisnotacodewordhasnonzerosyndromeasdoesanywordinitscoset.Ifacodewordis0onaninformationset,thenitisthe0codeword.Thusanynonzerowordthatis0onaninformationsetisnotacodeword.2(8.4.6)Lemma.Acycliccodeofredundancyrdetectsallnonzeroburstsoflengthatmostr.Proof.ByLemma8.4.5,wemustshowthatacodewordthatisaburstoflengthrorlessmustbe0.Letcbesuchacodeword.Thenithasacyclic 8.4.CYCLICHAMMINGCODESANDTHEIRRELATIVES119shiftthatrepresentsanonzerocodepolynomialofdegreelessthanr.ButbyTheorem8.1.1,thegeneratorpolynomialisanonzeropolynomialofminimaldegreeandthatdegreeisr.Thereforec=0,asdesired.2Thesameargumentshowsthat`wraparound'bursterrors,whosenonzeroerrorsoccurinaburstatthefrontofthewordandaburstattheend,arealsodetectedprovidedthecombinedlengthofthetwoburstsisatmostr.(8.4.7)Problem.IfCisacycliccodeofredundancyr,provethattheonlyburstsoflengthr+1thatarecodewords(andsoarenotdetectableerrorpatterns)areshiftsofscalarmultiplesofthegeneratorpolynomial.(8.4.8)Problem.StartingwithacycliccodeCofredundancyr,shortenCinitslastscoordinates(or rstscoordinates)bychoosingallcodewordsthatare0inthosepositionsandthendeletingthosepositions.ProvethattheresultingcodeDstillcanbeusedtodetectallburstsoflengthatmostr.(Remark.ThecodeDwillnolongerbecyclicandcannotberelieduponfordetectingbursterrorsthat`wraparound'.)(8.4.9)Problem.Haveanexistentialistdiscussion(orwritesuchanessay)astowhetherornotlinearcodesshouldbesaidtodetectthe0errorpattern.NowwereturntotheCRCcodeEofLemma8.4.4,theevensubcodeofabinarycyclicHammingcode.Ehasredundancyr=1+m,wheremistheredundancyoftheHammingcode.ThusEcanbeusedtodetect:(i)alloddweighterrors,(ii)allweight2errors,(iii)mostweight4errors,(iv)allnonzerobursterrorsoflengthatmostr,(v)mostbursterrorsoflengthr+1.HereCdetects`most'weight4errorsbecause(atleastforreasonablylarger)thecodewordsofweight4formonlyasmallfractionofthetotalnumberofwordsofweight4.(SeeProblem7.3.7;thetotalnumberofwordsofweight4isquarticinn=2r�1�1,whilethenumberofcodewordsofweight4iscubicinn.)Theonlyburstsoflengthr+1thatarecodewordsarethenshiftsofthegeneratorpolynomialg(x).(SeeProblem8.4.7.)Soweseethatthevariousmostlikelyerrorpatternsarealldetected.Examples.(i)CRC-12oflength2047=211�1withgeneratorpoly-nomial(x+1)(x11+x2+1)=x12+x11+x3+x2+x+1:(ii)CRC-ANSIoflength32767=215�1withgeneratorpolynomial(x+1)(x15+x+1)=x16+x15+x2+1:(iii)CRC-CCITToflength32767=215�1withgeneratorpolyno-mial(x+1)(x15+x14+x13+x12+x4+x3+x2+x+1)=x16+x12+x5+1: 120CHAPTER8.CYCLICCODESThelasttwoexampleshavegeneratorpolynomialsoftheminimumweight4.Thisisadvantageoussincethelinearfeedbackcircuitryrequiredtoimplementencodinganddecodingissimplerforgeneratorpolynomialsofsmallweight.AsinProblem8.4.8thedetectionproperties(i)-(v)arenotlostbyshorteningE,sovariousshortenedversionsofevensubcodesofbinarycyclicHammingcodesarealsousedasCRCcodes.Ifthecodeisshortenedinitslastspositions,then`cyclic'encodingisstillavailable,encodingthemessagepolynomiala(x)ofdegreelessthank�s(thedimensionoftheshortenedcode)intothecodepolynomiala(x)g(x)ofdegreelessthanr+k�s=n�s(thelengthoftheshortenedcode).8.4.2Simplexcodesandpseudo-noisesequencesAstherearecyclic,binaryHammingcodesofeveryredundancym,therearealsocyclic,binarydualHammingcodesofeverydimensionm.Recallthatthesecodesarecalledsimplexcodes(orshortened rstorderReed-Mullercodes).TheywerestudiedpreviouslyinSection4.3.ByTheorem8.4.2theyarepreciselythosecyclic,binarycodeswhosecheckpolynomialsareprimitive.(8.4.10)Theorem.LetCbeacyclicsimplexcodeofdimensionmandlengthn=2m�1.ThenCiscomposedofthecodeword0plusthendistinctcyclicshiftsofanynonzerocodeword.Proof.LetChavegeneratorpolynomialg(x)andprimitivecheckpoly-nomialh(x),sothatg(x)h(x)=xn�1.SincejCj=2m=n+1,weneedonlyprovethatthencyclicshiftsofg(x)aredistinct.Supposeg(x)=xjg(x)(modxn�1),forsome0jn.Thus(xj�1)g(x)=q(x)(xn�1)(xj�1)g(x)=q(x)g(x)h(x)xj�1=q(x)h(x):Ash(x)isprimitive,wemusthavejnhencej=n.Thereforethenshiftsxjg(x)(modxn�1),for0jn,arealldistinct,asdesired.2(8.4.11)Corollary.Let06=c2C,acyclicsimplexcodeofdimensionm.Then,foreverynonzerom-tuplem,thereisexactlyonesetofmconsecutivecoordinateentriesinc(includingthosethatwraparound)thatisequaltom.Proof.AsCiscyclic,its rstmcoordinatepositionsformaninformationset.Everymoccursinthesepositionsinexactlyonecodewordb.Bythetheo-rem,bisacyclicshiftofcwhenmisoneofthe2m�1nonzerom-tuples.Thenonzerocodewordchasonlyn=2m�1setsofmconsecutivepositions.There-forenonzeromoccursexactlyonceamongthesetsofmconsecutivepositionsinc.2Thepropertydescribedinthecorollarycanbethoughtofasarandomnessproperty.Ifwewereto ipanunbiasedcoinanynumberoftimes,thenno 8.4.CYCLICHAMMINGCODESANDTHEIRRELATIVES121particularcombinationofmconsecutiveheads/tailswouldbeexpectedtooccurmoreoftenthananyother.Wewillcallabinarysequenceoflength2m�1inwhicheachnonzerom-tupleoccursexactlyonceinconsecutivepositionsapseudo-noisesequenceorPN-sequence,forshort.(Hereandbelow,whenwepseudo-noisesequencePN-sequencespeakofconsecutivepositions,weallowthesepositionstowraparoundfromtheendofthewordtothefront.)Wecallitasequenceratherthanwordbecause,whenwerepeatitanynumberoftimes,wegetasequenceof0'sand1'swhosestatisticalpropertiesmimic,inpart,thoseofarandomsequence,thatis,thoseofnoise.Thelengthn=2m�1isthentheperiodofthesequence.periodWiththesede nitionsinhand,thecorollarycanberestatedas(8.4.12)Corollary.AnonzerocodewordfromacyclicsimplexcodeofdimensionmisaPN-sequenceofperiod2m�1.2ThereareotherconsequencesofthePNde nitionthataresimilartoprop-ertiesofrandomsequences.Arunisamaximalsetofconsecutiveentriescon-runsistingentirelyof0'sorentirelyof1's.Thelengthofarunisthenumberofitsentries.Inarandomsequence,onewouldexpect,fora xedlength,thesamenumberofrunsof0'sas1'sandthatrunsoflengthpwouldbetwiceaslikelyasrunsoflengthp+1.(8.4.13)Proposition.LetsbeaPN-sequenceofperiod2m�1.(1)(Runbalance)Thereareexactly2m�p�2runsof0'soflengthp(m�2)andexactly2m�p�2runsof1'soflengthp(m�2).Thesequencescontainsexactly2m�1runs.(2)(Generalbalance)Ifpisanonzerop-tuplewithpm,thenpoccursinconsecutivepositionsofsexactly2m�ptimes.Ifpisap-tupleof0's,thenitoccursinconsecutivepositionsexactly2m�p�1times.Inparticular,shasweight2m�1.Proof.For(2),thep-tuplepistheinitialsegmentof2m�pdistinctm-tuples.Ifpisnonzero,theneachofthesem-tuplesoccurswithins.Ifp=0,thenthem-tuple0istheonlycompletionofpthatdoesnotoccurwithins.Inparticular,the1-tuple1occursexactly2m�1times,completing(2).Arunaaaaoflengthp(m�2)correspondstoa(p+2)-tuplebaaaabwithfa;bg=f0;1g(whichisnever0).Thereforeby(2),thenumberofrunsaaaaoflengthpis2m�(p+2)=2m�p�2.Ifm=1,thencertainlythereisonlyonerun.Form2,atransitionbetweentworunsoccurspreciselywhenweencountereither01or10.By(2)thereare2m�2ofeach.Thereforethenumberofruns,beingequaltothenumberoftransitions,is2m�2+2m�2=2m�1.2Althoughpseudo-noiseandpseudo-randomsequenceshavebeenstudiedagreatdeal,thereisnoconsensusabouttheterminologyorde nitions.InsomeplacesthereisnodistinctionmadebetweenPN-sequencesingeneralandthosespecialonescomingfromsimplexcodes(sothatCorollary8.4.12becomesthe 122CHAPTER8.CYCLICCODESde nition).Wewillcallthenonzerocodewordsofcyclicsimplexcodesm-sequences.(Thisisanabbreviationformaximallengthfeedbackshiftregisterm-sequencessequences.)Itmightseemmorenaturaltoconsidersequencesoflength2minwhicheverym-tupleoccurs.SuchsequencesarecalledDeBruijncycles.ThetwoconceptsDeBruijncyclesareinfactequivalent.IfinaPN-sequencesofperiod2m�1welocatetheuniquerunofm�10's,thenwecanconstructaDeBruijncyclebyinsertingonefurther0intotherun.Conversely,ifwedeletea0fromtheuniquerunofm0'sinaDeBruijncycle,weareleftwithaPN-sequence.Giventheconnectionwithsimplexcodes,wepreferthepresentformulation.(8.4.14)Problem.ProvethateveryPN-sequenceoflength7isanm-sequence.(Remark.Uptocycling,thereare16PN-sequencesoflength15,only2ofwhicharem-sequences.)Animportantpropertyofm-sequencesisnotsharedbyallPN-sequences.(8.4.15)Lemma.(Shift-and-addproperty)Ifsisanm-sequenceands0isacyclicshiftofs,thens+s0isalsoacyclicshiftofs(or0).Inparticularnonzeros+s0isitselfanm-sequence.Proof.ThisisadirectconsequenceofTheorem8.4.10.2(8.4.16)Problem.ProvethataPN-sequencepossessingtheshift-and-addpropertymustbeanm-sequence.Onelastpropertyismorestrikingifwechangetothe-versionofthesimplexcode,asdescribedinSection4.3.Witheachbinarysequencesweassociatethe1-sequencesbyreplacingeach0withtherealnumber1andeach1withtherealnumber�1.Ifsisanm-sequence,thenweabuseterminologybyalsoreferringtotheassociatedsequencesasanm-sequence.(8.4.17)Proposition.(Perfectautocorrelation)If(s0;:::;sn�1)=s2f1gnRnisanm-sequencewithn=2m�1,thenPn�1i=0sisi+p=nforp=0=�1for0pn;whereindicesareallreadmodulon.Proof.Thesummationisthedotproductofswithacyclicshiftofitself.Theassociatedbinaryvectorsarealsocyclicshiftsandareeitherequal(whenp=0)oratHammingdistance2m�1byProposition8.4.13(2)andLemma8.4.15.ByLemma4.3.4thedotproductisn(=2m�1)whenp=0andotherwise(2m�1)�22m�1=�1:(InfactthispropositionisnearlyequivalenttoLemma4.3.5.)2Thefunctiona(p)=Pn�1i=0sisi+p,for0pn,ofthepropositionistheautocorrelationfunctionfors.Asnisodd,thesequencescouldneverbeautocorrelationfunction 8.4.CYCLICHAMMINGCODESANDTHEIRRELATIVES123orthogonal;sothepropositionsays,inasense,thatsanditsshiftsareasclosetobeingorthogonalaspossible.Thisiswhytheautocorrelationfunctioniscalledperfect.Thusthe1m-sequencesareveryunlikenontrivialshiftsofthemselves.Forthisreason,theyareattimesusedforsynchronizationofsignals.Theyarealsousedformodulationofdistinctsignalsinmultipleusersituations.Thisisanexampleofspreadspectrumcommunication.TheideaisthatmultiplicationbyaPN-sequencewillmakeacoherentsignallooknoise-like(takingitsusualspikedfrequencyspectrumandspreadingitouttowardthe atspectrumofnoise).Forsuchapplications,itisoftenhelpfultohavenotjustonesequencewithgoodautocorrelationpropertiesbutlargefamiliesofthemwithgoodcrosscor-relationproperties.Theconstructionsofsuchfamiliesmaystartfromnicem-sequences.Theirinvestigationisofon-goinginterest.Pseudo-randombinarysequencesarealsoimportantforcryptography.Inthatcontextm-sequencesarebad,sincetheshift-and-addpropertyimpliesthattheyhavelowcomputationalcomplexity.