euclid algorithm
TRANSCRIPT
-
7/29/2019 Euclid Algorithm
1/15
37RESONANCE April 2007
GENERAL ARTICLE
Decoding ReedSolomon Codes UsingEuclids Algorithm
Priti Shankar
Keywords
Error correcting codes, Reed
Solomon codes, decoding algo-
rithms.
Priti Shankar is with the
Department of Computer
Science and Automation at
the Indian Institute of
Science, Bangalore. Her
interests are in theoretical
computer science and
error correcting codes.
Irving Reed and
Gus Solomon
1 See Resonance, Vol.7, No.2,
2002.
R e e d { S o lo m o n c o d e s a re in d ee d a n e le g a n t illu s-
tr a tio n o f a v e ry p ra ctic a l a p p lic a tio n o f a b str a c t
a lg e b ra . A n in te re stin g d isco v e ry w a s th e fa c t
th a t E u c lid 's a lg o rith m fo r n d in g g re a te st c o m -
m o n d iv iso rs o f p o ly n o m ia ls, c o u ld b e u se d fo rd e c o d in g th e se c o d es. In th is a rtic le w e e x p la in
th is c o n n e c tio n .
1 . In tro d u c tio n
M an y o f u s w h o h av e seen th e p ictu res sen t b ack b y th esp a cecraft V oy ag er 2 , h av e b een stru ck b y th e n e q u al-ity of th e im ag es received . In 19 89 , w h en V oy ag er w asa b ou t 3 b illio n m iles a w ay from th e E arth , it w a s a b leto tran sm it h ig h resolu tio n im ag es o f T riton , N ep tu n e's
largest m oon (F igure 1 ). T h is g reat fea t w a s in n o sm a llm ea su re d u e to th e fa ct th a t th e sop h istica ted co m m u -n ication system o n V oya ger h ad an ela b orate error co r-rectin g sch em e b u ilt in to it. A R eed-S olom on cod e w asu sed to en h an ce th e re lia b ility o f th e tran sm issio n . E a chco d ew o rd co n tain ed 2 23 b y tes of d a ta (a b y te co n sistin go f 8 b its) a n d 3 2 b y tes o f red u n d a n cy. W ith ou t th e e rro rco rrection sch em e, V oy a ge r w o u ld n o t h av e b een ab le tosen d th e v olu m e o f d a ta th a t it d id , u sin g a tran sm ittin gp ow e r o f on ly 2 0 w a tts. T h e sp a cecra fts G alileo (19 9 1 ),M ars G lob al S u rv eyo r (19 97 ), M ars P ath n d er (19 97 )
an d M ars E x p lora tio n R o ve r (2 00 4) h av e a ll u sed R e ed {S olom on co d es in th eir d ata tran sm ission sch em es. Itw ou ld n o t b e ou t of p la ce to say th at R eed -S olom onco d es h av e g o n e to th e fu rth est rea ch es o f th e solar sys-tem an d b eyon d !
W e ow e to th e ge n iu s o f C lau d e S h a n n on1, o n e of th e
-
7/29/2019 Euclid Algorithm
2/15
38 RESONANCE April 2007
GENERAL ARTICLE
Figure 1. Image of Triton
transmitted by Voyager 2.
(Courtesy: NASA/JPL-Caltech)
Figure 2. Shannons sche-
matic of a communication
system.
n est scien ti c m in d s of th e la st cen tu ry, th e rem ark -ab le d iscovery th a t reliab le co m m u n ica tio n is p ossib le,even over an u n reliab le m ediu m . In 19 48 , S h an n on ,th en a yo u n g m a th em a ticia n , sh ow ed th a t arb itrarily re-lia b le co m m u n ica tio n is p o ssib le a t an y rate b elow som e-th in g ca lled th echannelcapacity. R ou g h ly sp ea k in g, th ech a n n el ca p a city is its u ltim a te ca p a b ility to tran sm itin fo rm a tio n , an d on e ca n p u sh th e ch a n n el to th is lim it
an d ye t co rrect a ll th e errors it m a ke s u sin g erro r co r-rection . T h e illu stratio n in F igure 2 sh ow s S h a n n on 'ssch em e for co m m u n ica tin g relia b ly ov er a n u n relia b lech a n n el. T h e m essag e is sen t ov er th e ch a n n el, b u t b e-fo re it is sen t it is p ro cessed b y an encoder. T h e en co d erco m b in es th e m essa ge w ith som e redundancy, in ord erto create a codew o rd . T h is m akes it p ossib le to d etector correct errors in tro d u ced by th e ch an n el. A t th e re-ceive r's en d , th e co d ew o rd , w h ich m ay b e co rru p ted b yerrors is decoded to recover the m essage.
-
7/29/2019 Euclid Algorithm
3/15
39RESONANCE April 2007
GENERAL ARTICLE
The encoder is analgorithm that the
sender uses to
pad the message
u with redundant
information.
The received word
y 2 Fnq
is the output of the
channel which is a
possibly corrupted
version of the
codeword c.
In m ath em a tical term s th e im p o rtan t co m p o n ents of aco d in g sch em e a re as fo llow s.
T h e in p u t a lp h a b e t is th e set from w h ich sym -b o ls to b e tran sm itted a re d raw n . W e a ssu m e th a tth e in p u t alp h a b et size is q an d th at th e sym b olsare fromFq th e eld o f q elem en ts. T h e o u tp u t a l-p h a b et is th e set o f sy m b ols from w h ich th e ch a n -n el p rod u ces ou tp u ts. H ere w e a ssu m e th a t th eo u tp u t a lp h a b e t set is also Fq.
T h e m e s s a g e u is a b lo ck o f sy m b o ls th at th esen d er w ish es to tran sm it. F o r o u r p u rp o ses, u isan arb itrary w ord of k sy m b o ls fro m th e n ite eldFq, th a t is u 2 F
kq.
T h e e n c o d e r is a n algo rith m th a t th e sen d er u sesto p a d th e m essag eu w ith red u n d an t in form a tio n .It can b e lo ok ed u p on as a fu n ction en c : Fkq !Fnq th at tra n sform s a m essa ge of k sym b ols to ac o d e w o rd o f n sy m b o ls.
T h e c o d e C is th e set o f a ll p ossib le co d ew o rd s.T h a t is, C = fen c(u) : u 2 Fkqg.
T h ree im p o rtan t p a ram eters o f a co d e are
T h e b lo ck le n g th o f th e co d e is th e len g th n o fth e co d ew o rd s o u tp u t b y th e en co d er.
T h e d im e n sio n k of th e co d e is th e len gth o f am essag e w o rd . T h is term is ty p ica lly u sed fo r lin -ear codes w h en th e cod e form s a vector sp ace.
T h e ra te R o f a co d e is th e ratio o f its d im en sio nto its b lo ck len g th , or R = k = n.
T h e r e c e iv e d w o r d y 2 Fnq is th e o u tp u t o f th ech a n n el w h ich is a p o ssib ly co rru p ted v ersion o fth e co d ew o rd c.
-
7/29/2019 Euclid Algorithm
4/15
40 RESONANCE April 2007
GENERAL ARTICLE
In 1975 Sugiyamaet al. discovered the
beautiful fact that one
can use Euclids
algorithm to decode a
class of codes called
Goppa codes and
hence also Reed
Solomon codes.
T h e d e c o d e r is an alg orith m th at th e receiveru ses to recove r th e origin al m essag e u from th ereceiv ed w ord y. It can b e lo ok ed u p on as a fu n c-tion dec :Fnq ! F
kq th a t estim a tes a m essag e w o rd
o f k sym b ols from th e receiv ed w ord y of n sym -b ols.
T h e p rim a ry o b jectiv e in co d in g th eo ry is to d esig n co d -in g sch em es w ith th e b est p ossib le p a ram eters a n d e -cien t en co d in g / d eco d in g a lg o rith m s. L in ea r b lo ck co d esd e n ed b elow , a re th e b est k n ow n error co rrectin g co d es
an d are th e co d es o f ch oice in m ost p ractica l a p p lica-tio n s.
A co d e C w ith b lo ck len g th n ov er a n alp h a b et Fq isa lin e a r b lo c k c o d e if it is a lin ea r su b sp ace o f Fnq,th e ve ctor sp ac e of n-tu p les ov er Fq. If C h as d im en sionk, w e w ill call th e co d e a n (n ; k)q lin ea r b lo ck co d e o ra n (n ; k) co d e if th e u n d erly in g eld is a ssu m ed to b ek n ow n .
R eed {S olom on co d es are a class o f lin ear b lo ck co d es
d iscovered b y Irvin g R eed an d G u s S olom on in 19 60.W h ile th e co d es w ere n otab le b ecau se of th eir eleg an tm a th em a tica l stru ctu re, th eir p rac tica l v ersatility b e-cam e ap p aren t on ly after th e d iscov ery in 19 68 , of a ne cien t d eco d in g algo rith m b y E lw yn B erleka m p [1].In 197 5 S u giya m a et al. [2 ] d isco v ered th e b ea u tifu l fa ctth at o n e ca n u se E u clid 's a lgo rith m to d eco d e a cla ss o fco d es ca lled G o p p a co d es a n d h en ce a lso R eed -S o lo m onco d es. W e w ill d escrib e th is a lg orith m p resen tly, b u t w e rst p resent som e b a ckg rou n d m ateria l.
2 . B a ck g ro u n d
T h e H am m in g distan ce b etw een tw o n sym b ol w o rd sis th e n u m b er o f co rresp o n d in g p ositio n s in w h ich th eyd i er. T h u s if d sym b ol erro rs o ccu r in a tra n sm ittedco d ew o rd , th e H am m in g d ista n ce b etw een th e c o d ew o rdan d th e receive d w ord is d. T h em in im u m distan ceo f a
-
7/29/2019 Euclid Algorithm
5/15
41RESONANCE April 2007
GENERAL ARTICLE
B o x 1 . C o n str u c tio n o f F in ite F ie ld s
The basic building blocks for these large elds or extension elds, as they are called,are the prime elds. F
p
is the eld whose elements are the set f0;1 ;2;:::p 1g wherep is prime and all arithmetic is performed modulo p. We illustrate with the construc-tion of a eld with p = 2 and with 23 = 8 elements. Let V3(F2) be the set of 3-tuplesa = (a2a1a0) over F2 , with addition being dened component wise. Thus V3(F2) is theset f00 0; 001;01 0;01 1; 100;101 ;110;111g, and, for example, (101) + (110) = (011) . Wecan make V3(F2) into a eld as follows. Assume f(x) is of degree 3 over F2 and has noroots in F2 . For example f(x) = x
3 + x + 1: (No roots in F2 would mean f(1) andf(0) are both non-zero modulo 2. ) In such a case, f(x) is said to be irredu cible over F2.Associate with each tuple a = (a2;a1;a0) in V3(F2) the polynomial a2x
2 + a1x + a0, anddene the product of tuples a and b to be the tuple c dened uniquely by the equationa(x) b(x) = c(x) m o d(f(x) ) . (c(x) is the remainder when the product a(x) b(x) is dividedby f(x) . ) For example (010)(101) = (001) as (x) (x2 + 1) 1 m o d(f(x) ) . The eldconstructed above, has 23 elements. Of course, since there may b e several irreducible
polynomials of degree 3, there will be dierent ways to dene the multiplication above.But all these elds are isomorphic and we can talk of the eld with 23 elements calledG F(23). (We will refer to this eld as F8.) Every eld has what is called a p rim itiveelement, powers of which generate all the non-zero elements of the eld. For example,the element corresponding to the residue class fxg or the tuple (010), is a primi-tive element of this eld, consecutive powers of generating the sequence of elements(010) ;(100);(011);(110);(111);(101);(001) . We denote the multiplicative inverse of aeld element by 1:
co d e is th e m in im u m o f th e H a m m in g d istan ces b etw eena ll p a irs o f d istin ct co d ew o rd s. F or lin ea r co d es, th is isa lso th e m in im u mH am m ing w eight o f a co d ew ord (th atis, th e n u m b er o f n on -zero co m p o n en ts o f th e w o rd ). Ing en eral, if u p tot sym b ol errors in an arb itrary co d ew o rdh av e to b e co rrected , th e m in im u m d ista n ce dm in m u stsa tisfy
dm in 2t + 1:
2 .1 . R eed { S o lo m o n C o d e s
F rom n ow on w e w ill con cen trate o n eld s w ith q
m
el-em en ts. T h e co n stru ction o f th ese la rge eld s is illu s-trated in B ox 1 .
W e w ill u se th e fa ct th a t th e n o n -zero elem en ts o f everysu ch eld ca n b e g en erated b y p ow e rs o f a sin gle elem en tcalled a prim itive elem en t o f th e eld .
-
7/29/2019 Euclid Algorithm
6/15
42 RESONANCE April 2007
GENERAL ARTICLE
A (255,223)ReedSolomon code
has a redundancy of
32 symbols per
codeword, a
minimum distance
33, and can correct
any combination of
16 symbol errors,
each symbol being
made up of 8 bits.
R eed { S olom on co d es w o rk w ith elem en ts in a eld Fqm
.W e con sid er th e ca se w ith q = 2 h ere. R eed -S olo m oncod es h av e p a ram eters (n ; k) w h ere n is at m ost 2m 1 ,m is th e n u m b er of b its p er sym b o l, a n d k = n 2tw h ere t is th e sy m b o l error co rrectio n ca p a b ility o f th eco d e. T h u s, o n ly 2t red u n d a n t sy m b ols a re req u ired , tob e a b le to co rrect t errors. F or exa m p le, a (25 5,22 3)R eed {S olom on cod e h as a red u n d an cy of 32 sy m b olsp er c o d ew o rd , a m in im u m d istan ce 33 , an d ca n correctan y co m b in atio n of 16 sym b ol errors, ea ch sym b o l b ein gm ad e u p of 8 b its. W e d e n e a R eed -S o lom on cod e a s
follow s. L et a co d ew ord c = (c0;c1;:::cn1) b e rep re-sented b y a p o ly n o m ial w h ich w e h en ceforth refer to a sa co d e p o ly n o m ial c(x) given b y
c(x) = c0 + c1x + :::cn1xn1: (1 )
T h e p o ly n om ial c(x) rep resents a cod ew ord of th e R Sco d e if an d o n ly if ;2;::::::2t a re its ro o ts w h ere isp rim itiv e in th e m u ltip lica tiv e g ro u p o f F2m.
T h u s every cod e p oly n om ial h as th e ab ove 2t co n sec-
u tive p ow ers of as roo ts. It is n o t d i cu lt to sh ow(see th e a rticle o n R e ed { S o lo m o n co d es in [3 ]) th a t th em in im u m d ista n ce o f su ch a co d e is a t lea st 2t + 1 . W e illu strate w ith a n ex a m p le b orrow ed from a n a rticle b yth e au th o r o n R ee d { S olom on co d es [3].
S u p p ose on e w ish ed to tran sm it m essag es in E n glish u p -p erca se. T h en w e w o u ld n eed a t lea st 5 b its (w h ich givea total of 25 = 32 co m b in a tio n s) to en co d e a ll 2 6 letters,w ith 6 co m b in ation s left o ver to u se fo r b la n k s a n d o th ersp ecia l sym b o ls like p u n ctu a tio n m a rk s, etc. W e co u ld
u se a (25 1;15 ) R eed { S olom on cod e for ou r p u rp ose.T h is co d e h a s sy m b o ls in F3 2 ea ch req u irin g 5 b its fo ren cod in g. T h e cod e h as a len gth of 31 sy m b o ls, w ith15 m essag e sy m b o ls a n d 16 check sym b ols, a m in im u m d ista n ce o f 1 7, a n d h en ce a n erro r c o rrectio n ca p ab ilityof 8 sy m b ols. S u p p ose w e w a n ted to tra n sm it th e fteench ara cters, (in clu d in g th e b la n k ).
-
7/29/2019 Euclid Algorithm
7/15
43RESONANCE April 2007
GENERAL ARTICLE
Thus if thetransmitted codeword
is an n-tuple of
symbols from the field
Fq, the received n-
tuple is also made up
of elements from the
same field. If
transmission errors
have occurred, some
of the received
symbols may differ
from those that were
transmitted.
R E A D R E S O N A N C E !
T h e en cod er w ou ld a d d 1 6 m ore p a rity ch eck sy m b olsof its ow n to form a co d ew ord . A ssu m e fo r th e sa ke ofarg u m en t th at th e resu ltan t co d ew o rd is
R E A D R E S O N A N C E !Q T B P J !T L .,Z B F A L K
N ow even if th e m essag e is ch an ged to
R O A D R E P A I R S C E !S T O P J !T L .,Z B F A L K
w h ere errors o ccu r in b o th th e m essa ge, a s w ell as th ech eck sy m b ols, th e d eco d er w o u ld b e a b le to co rrect a llof th ese (as th ere are n ot m ore th an 8 of th em ) an drecov er th e o rig in a l m essag e!
2 .2 D eco d in g a n E r ro r-C o rrectin g C o d e
R eca ll th e a ssu m p tio n th a t th e ch a n n el in p u t a n d o u t-
p u t alp h ab ets are th e sam e. T h u s if th e tra n sm ittedco d ew o rd is an n-tu p le of sym b ols from th e eld Fq, th ereceived n-tu p le is also m ad e u p o f elem en ts from th esam e eld . If tra n sm issio n erro rs h av e o ccu rred , som eof th e receiv ed sy m b o ls m ay d i er from th o se th a t w eretran sm itted . If x is tran sm itted a n d y receive d , th e d if-feren c e z = y x is ca lled th e error pattern. If th eith com p on ent zi of th e vector z is n ot equ al to 0, a nerror is said to h av e o ccu rred in th e ith p ositio n . T h ed eco d in g p rob lem is to id en tify th e error p a ttern g iv en
th e receiv ed vec tor.L et x b e th e estim a te of th e tran sm itted co d ew ord xou tp u t b y th e d eco d er. T h u s, a d eco d in g error o ccu rs ifan d o n ly if x 6= x.
It is rea son a b le to assu m e th a t g iven a receive d v ector,an error p attern w ith th e sm a llest H a m m in g w eig h t is
-
7/29/2019 Euclid Algorithm
8/15
44 RESONANCE April 2007
GENERAL ARTICLE
The problem to beaddressed is: Given
the received vector,
which may be seen as
the corruption of any
one of the codewords
with the appropriate
error pattern, find the
most likely transmitted
codeword.
th e m o st lik ely error p attern . T h e p rob lem to b e a d -d ressed is: G iven th e received vector, w h ich m ay b eseen a s th e co rru p tion o f a n y on e o f th e co d ew o rd s w ithth e a p p rop ria te error p a ttern , n d th e m o st lik ely tran s-m itted co d ew ord . (O n ce w e h av e th is estim ate w e ca nea sily recove r th e m essag e). If th e H a m m m in g w eigh tof th e error p attern is a t m ost t, a n d th e m in im u m d is-tan ce o f th e co d e is a t lea st 2t + 1 it is ea sy to see th atth ere is ex a ctly o n e co d ew o rd th at is clo sest in term s o fth e H a m m in g d istan ce to th e receiv ed ve ctor a n d th isis th e o n e th e d eco d er sh ou ld ou tp u t. T h is k in d o f d e-co d in g is k n ow n as bounded distance decoding. A b ru teforce a p p roa ch w o u ld in v o lv e ch eck in g th e H am m in g d is-tan ces o f all cod ew o rd s from th e receiv ed v ector, w h ichis clea rly in fea sib le. W e th erefo re search fo r m o re e -cien t solu tio n s to th is p ro b lem .
3 . T h e K e y E q u a t io n
A s w e sh all p resen tly see, th e b o u n d ed d istan ce d eco d in gp rob lem ca n b e fo rm u la ted so th a t it red u ces to th e so-lu tio n of a n eq u a tio n th a t is p o p u la rly k n ow n a s th eK eyE quation. W e rst d eriv e th is e q u ation an d th en sh owh ow E u clid 's a lg o rith m for n d in g th e g reatest co m m o nd iv isor (gcd ), can b e u sed to g et th e solu tio n . L et aco d ew o rd c = c0;c1;:::cn1 b e rep resen ted b y th e co d e-w ord p oly n om ia l c(x) d e n ed ea rlier.
A ssu m e w e receive th e p olyn om ial r(x) w h en c(x) istran sm itted . W e d e n e th e error p o ly n om ial e(x) a se(x) = r(x) c(x)
T h is p o ly n om ia l w ill h av e n o n -zero co e cien ts in p osi-tio n s w h ere tra n sm issio n errors h av e o ccu rred .
F o r e x a m p le if e(x) = 1 + x4 th en errors h av e o ccu rredin th e 0 th a n d 4 th p o sitio n s.
T h e p rob lem is to n d th e m ost likely erro r p oly n o -m ial e(x) g ive n r(x). R eca ll th a t th e m o st lik ely ' error
-
7/29/2019 Euclid Algorithm
9/15
45RESONANCE April 2007
GENERAL ARTICLE
Now if there were noerrors then all the 2t
syndromes defined
above would be zero.
Thus if one or more
of these syndromes
is non-zero it is an
indication that errors
have occurred in
transmission.
p attern m ea n s th e error p a ttern of m in im u m H a m m in gw eigh t. D e n e
Si = e(i);i = 1;2;:::n 1: (2 )
A s every cod ew ord h as i;i = 1;2;:::2t as roo ts, an da s r = c + e for som e co d ew ord c w e h ave
Si = r(i);i = 1;2;:::2t; (3 )
w h ere Si is c a lled th e ith syn d rom e.
N ow if th ere w e re n o errors th en all th e 2t syn d rom es d e- n ed a b ov e w o u ld b e zero. T h u s if on e o r m ore of th esesy n d rom es is n on -zero it is a n in d ica tio n th a t errors h av eo ccu rred in tran sm issio n .
T h e d eco d in g p rob lem ca n b e resta ted a s fo llow s:
G iven S1;S2;:::S 2t n d e(x). W h en resta ted in th ism an n er, th e d eco d in g p rob lem lo o k s like a p rob lem inin terp o la tio n . W e w ill ob tain a fo rm u la tio n th at a llow sth e a p p lica tio n o f E u clid 's p oly n o m ia l gc d a lg o rith m .
L et th e H a m m in g w eig h t of th e error p attern e b e atm ost t, th a t is, th ere a re a t m o st t n o n -zero co m p on entso f th e error p a ttern . R eca ll th at w e a re th en g u ara n teedth at th ere is e x a ctly o n e clo sest' co d ew ord .
If th e j th n o n -zero co m p o n en t (cou n tin g from th e left)o f th e error p attern is th e d ig it ek (w h ere th e su b scrip tso f e b eg in w ith 0 ) th en d e n e Xj =
k.
F or ex am p le, say n = 7 . T h en e(x) can b e w ritten ase(x) = e0 + e1x + e2x
2 + :::+ e6x6. If th e rst a n d th ird
co e cien ts a re n o n -zero , i.e. e1 a n d e3 are n on -zero,th en th e rst n o n -zero co e cien t is e1 an d th e secon dis e3. T hu s X1 =
1 a n d X2 = 3, w h ere ge n erates
th e cy clic gro u p of o rd er n in th e m u ltip lica tiv e gro u po f G F(2m). T h e Xj's a re c alled th e error location s as ifj is k n ow n th en j can b e fo u n d . N ote th at th is d o esn o t solv e th e d eco d in g p rob lem co m p letely, as th e error
-
7/29/2019 Euclid Algorithm
10/15
46 RESONANCE April 2007
GENERAL ARTICLE
We define the errormagnitude Y
jat
locationXj
to be ek,
where as mentioned
earlier, ekis thej th
non-zero component
of the error vector.
m agnitudes a lso n eed to b e d eterm in ed . W e d e n e th eerror m a g n itu d e Yj at location Xj to b e ek, w h ere a sm en tio n ed ea rlier, ek is th e j
th n on -zero com p o n ent ofth e error v ector.
F rom eq u a tio n (3), u sin g th e d e n itio n s o f Xj an d Yjan d th e assu m p tio n th at at m ost t errors h av e o ccu rredw e h ave
Si =
tX
j= 1
YjXi
j;i = 1;2;:::n 1: (4 )
D e n e th e follow in g series
1
1 Xjx= 1 + Xjx + X
2j x
2 + :: : (5 )
M u ltip ly in g b oth sid es of eq u a tio n 5 b y YjXj an d su m -m in g b oth sid es from 1 to t w e h av e, u sin g eq u ation(4 )
t
Xj= 1
YjXj
1 Xjx= S
1+ S
2x + ::: :S
2tx2t1 + ::: (6 )
C o m b in in g th e term s o n th e left h a n d sid e of e q u atio n(6) in to a sin gle fractio n it ca n b e w ritten a s
Ptj= 1 YjXj
Qtk= 1;k6=j(1 Xkx)Qt
j= 1(1 Xjx): (7 )
R ep lacin g th e nu m erator of eq u ation (7) b y !(x) an dth e d en o m in a tor b y (x) w e ca n rew rite eq u a tio n (6) a s
!(x)(x)
= S1 + S2x + S3x2 + :::S2tx
2t1 + ::: : (8 )
E q u a tio n (8) h a s th e fo llow in g p rop erties;
1. T h e d en om in ator (x) o n th e left h a n d sid e is o fd eg ree o n e grea ter th a n th a t o f th e n u m erator.
-
7/29/2019 Euclid Algorithm
11/15
47RESONANCE April 2007
GENERAL ARTICLE
The numerator anddenominator on the
left hand side are
relatively prime
polynomials. This
can be verified by
checking that none
of the roots of the
denominator are
roots of the
numerator.
2. T h e roo ts of th e p o ly n om ial in th e d en om in a tora re th e in v erses o f th e erro r lo ca tion s. T h ereforeth is p o ly n o m ia l is ca lled th e error locator polyno-m ial.
3. T h e n u m erator a n d d en om in a tor o n th e left h a n dsid e are relatively p rim e p olyn om ials. T h is can b eve ri ed b y ch eck in g th at n o n e of th e roo ts o f th ed en om in a tor a re ro o ts of th e n u m erator.
4 . C o n sid er th e d eriva tiv e w rt x of th e d en om in a tor.
T h is is
0(x) =
tX
j= 1
XjY
k= 1;k6=j
(1 Xkx): (9 )
If th is is ev alu a ted a t a p a rticu la r va lu e X1l a n dw e form!(X1
l)
0(X1l
), w e g et
!(X1l )
0
(X1l )
=YlXl
Xl= Yl: (10)
T h e righ t h an d sid e is th e n eg a tiv e of th e errorm a gn itu d e at th e error lo ca tion l. T h e p olyn o-m ial !(x) is th erefore ca lled th e error eva lu atorpolyn om ial.
N ow su p p o se w e co m p u te b o th sid es o f eq u a tio n m o d u loth e p o ly n o m ia l x2t an d w e set
S(x) = S1 + S2x + S3x2 + :::S 2tx
2t; (11)
w e h av e th e eq u ation
!(x)
(x) S(x)(m od x2t): (12)
E q u ation (12) is ca lled th e k ey eq u a tion b eca u se if w eca n solve it a n d o b tain th e p o ly n o m ials (x) a n d !(x),
-
7/29/2019 Euclid Algorithm
12/15
48 RESONANCE April 2007
GENERAL ARTICLE
Euclids algorithm isan iterative algorithm
to find the gcd of a
pair of polynomials.
Our aim is to exploit
the properties of the
algorithm and those of
the polynomials in the
key equation so that
(x) and (x) fall out
at the i th stage of thealgorithm for some i.
th en u sin g p rop erties 2 a n d 4 ab ove, w e ca n g et th e er-ror lo ca tio n s a s w ell a s th e error m a g n itu d es o f th e errorp attern , a n d th u s a solu tion to th e d eco d in g p rob lem .N o te h ow ev er, th a t o n ly th e p o ly n o m ial S(x) of d egreeat m ost 2 t a n d w ith co e cien ts in F2m is k n ow n . W em ay p o se th e p rob lem a s fo llow s: G ive n an ap p rox im a -tion S(x) to a ratio n a l fu n ctio n (w h ich in th is ca se is!(x)(x)
w h ere b oth th e n u m erator a n d th e d en om in ator are
u n k n ow n to th e d eco d er), w h ich ag rees w ith th e p ow e rseries ex p a n sio n o f th e ration a l fu n ctio n to th e ord ero f th e rst 2t term s, n d a ratio n a l fu n ction w h ere th en u m erato r an d d en o m in a tor a re rela tive ly p rim e, th e d e-gree of th e d en om in a tor is at m ost t, an d th e d egree ofth e n u m erato r is o n e less th a n th a t o f th e d en o m in a tor.
In th e n ex t section w e sh ow h ow th e E u clid algo rith m for p oly n o m ia l gcd 's solv es th is p rob lem .
4 . D e c o d in g U sin g E u clid 's A lg o rith m
W e sta te th e g cd p rob lem fo r p o ly n o m ia ls a s fo llow s:
G iv en p o ly n o m ials a(x) an d b(x) w ith co e cien ts in a eld , a n d w h ere d egree (a(x)) d eg ree (b(x)), n d p oly -n om ials s(x) an d t(x) su ch tha t th e fo llow in g eq u atio nis sa tis ed :
s(x)a(x) + t(x)b(x) = r(x); (13)
w h ere r(x) is th e gc d of a(x) an d b(x).
E u clid 's a lg o rith m w h ich w e w ill p resen tly d escrib e, isan iterativ e a lg orith m to n d th e gc d of a p a ir o f p oly -
n om ials. O u r aim is to ex p loit th e p rop erties o f th ea lgo rith m an d th ose o f th e p o ly n o m ia ls in th e k ey eq u a -tio n so th a t (x) a n d !(x) fa ll o u t a t th e ith sta ge o f th ealgo rith m for som e i.
W e m a k e u se o f th e p rop erties o f th e E u clid a lg o rith m(n o t p rov ed h ere) d isp lay ed in B ox 2 .
-
7/29/2019 Euclid Algorithm
13/15
49RESONANCE April 2007
GENERAL ARTICLE
B o x 2 . P ro p e rtie s o f th e E u clid g c d A lg o rith m
At stage i of the iteration there will be four polynomials
si(x) ;ti(x) ;qi(x) and ri(x). The rst two are the ith multipliers, the next two are theith quotient and the ith remainder. The equations that hold at each stage are:
ri2(x) = qi(x) ri1(x) + ri(x) ; (a)
whered e g(ri(x) ) < d e g (ri1(x) ) ; (b)
si(x) = si2(x) qi(x) si1(x) ; (c )
ti(x) = ti2(x) qi(x) ti1(x) : (d)
The initial conditions are:
s1(x) = 1 t1(x) = 0 r1(x) = a(x)
s0(x) = 0 t0(x) = 1 r0(x) = b(x)
Three properties that hold during iteration are:
A: si(x) a(x) + ti(x) b(x) = ri(x)
B: degree(si(x))+ degree(ri1(x))= degree(b(x) )
C: degree(ti(x))+ degree(ri1(x)) = degree(a(x) )
P rop erty A (B ox 2) c an b e rew ritten as:
ti(x)b(x) ri(x)m o d (a(x)): (14)
E q u atio n (14 ) lo o k s lik e th e k ey eq u a tio n w ith a(x) p lay -in g th e role of x2t, a n d ti(x);b(x) an d ri(x) th e roles o f(x);S(x) a n d !(x) resp ectiv ely. A s ca n b e seen , th e d e-gree o f th e ti(x)'s in crea ses w ith th e itera tio n i w h ereasth e d eg ree o f th e ri's d ecrea ses w ith i. U sin g th is fact,w e g et from p rop erty C
d e g r e e (ti(x)) + d e g r e e (ri(x)) < d e g r e e (a(x)): (15)
T h e n ex t lem m a a n d th eo rem h elp id en tify th e step atw h ich w e sh o u ld h alt w h en u sin g E u clid 's a lg o rith m for
-
7/29/2019 Euclid Algorithm
14/15
50 RESONANCE April 2007
GENERAL ARTICLE
Lemma 4.1 indicatesthat if there is any pair
of integers whose
sum is one less than
the degree of a(x),
and where one of
them is greater than
the degree of the gcd,
then there is a unique
stage i in the Euclid
algorithm where thedegree of t
i(x) is
bounded above by
one of the integers
and the degree of ri(x)
bounded above by the
other.
d eco d in g . W e p resen t th ese resu lts w ith o u t p ro o fs. R ea d -ers in terested in th e p roo fs ca n lo o k th em u p in th e e x -cellent b ook by M cE liece [4].
L e m m a 4 .1 G iven tw o n on -n egative in tegers u an d vw ith v degree(gcd(a(x);b(x))), sa tisfyin g u + v = de-gree a(x) 1, there exists a unique index j , 0 j nsuch that
d e g r e e (tj(x)) u ; (16)
an d
d e g r e e (rj(x)) v : (17)
T h e lem m a in d ica tes th a t if th ere is a n y p air of in te-ge rs w h ose su m is o n e less th a n th e d eg ree o f a(x), an dw h ere on e o f th em is g reater th a n th e d eg ree o f th e g cd ,th en th ere is a u n iq u e sta g e i in th e E u clid algo rith m w h ere th e d egree o f ti(x) is b ou n d ed ab ov e b y on e ofth e in tegers a n d th e d eg ree of ri(x) b ou n d ed ab ove byth e o th er. In o th er w o rd s, a t lea st o n e o f th e b ou n d s isv io la ted b efo re o r after th is u n iq u e in d ex is rea ch ed in
th e itera tive p ro cess. T h is is tru e fo r a ll p airs o f in teg erssatisfy in g th e a ssu m p tion s. N ow ri(x) p lay s th e role o f!(x) an d w e k n ow th a t its d eg ree o f th e latter is a t m o stt 1 . T h is g iv es u s a clu e a s to w h en to stop th e iter-ation . H ow ev er w e n eed th e n ex t th eorem to in d icateh ow th e p o ly n om ia ls o b tain ed from E u clid 's algo rith m a re rela ted to th e o n es o f in terest to u s.
T h e o re m 4 .2 . L et r(x) an d t(x) be polynom ials satis-fying
t(x)b(x) r(x)m o d (a(x)); (18)
w here degree(t(x))+ degree (r(x))
-
7/29/2019 Euclid Algorithm
15/15
51RESONANCE April 2007
GENERAL ARTICLE
Suggested Reading
[1] Elwyn Berlekamp,Algebraic Coding Theory, McGraw-Hill, New York,
1968.
[2] Y Sugiyama, M Kasahara, S Hirasawa and T Namekawa, A method for
solving key equation for decoding Goppa codes, Information and Control,
Vol.27, pp. 8799, 1975.[3] Priti Shankar, Error Correcting Codes: The ReedSolomon Codes,
Resonance, Vol.2, No.3, pp.33-47, 1997.
[4] R J McEliece, The Theory of Information and Coding,Encyclopedia of
Mathematics and its Applications , Addison Wesley, 1977.
Address for Correspondence
Priti Shankar
Department of Computer
Science and Automation
Indian Institute of ScienceBangalore 560 012, India.
Email:
r(x) = (x)rj(x): (20)
W e n ow h av e a ll th e resu lts w e n eed to a p p ly E u clid 'sa lgo rith m to th e solu tio n o f th e k ey eq u atio n . W e stateth is a s a th eo rem .
T h e o re m 4 .3 . If(x) an d !(x) are the error locatoran d the error evalu ator polyn om ials for an (n ; n 2t)R eed{S olom on code, an d the error pattern ha s w eight atm ost t, then
(x) = tj(x); (21)
!(x) = rj(x); (22)
w he rerj an d tj are the po lyn om ials obtain ed from the ap-plication of E uclid's algo rithm to the polyn om ials a(x) =x2t an d b(x) = S(x), w here j is the rst index at w hichthe degree ofrj(x) drop s to below t. T he constant ischosen so that tj(x) has con stan t term 1.
T h u s th e erro r lo ca tor p oly n o m ial (x) an d th e errorev a lu ato r p o ly n o m ial !(x) ca n b e fou n d b y sim p ly a p -p ly in g E u clid 's a lg o rith m to x2t a n d S(x) a n d stop p in gw h en th e d eg ree of th e rem a in d er d rop s to b elow t!