Reed Solomon Codes

6
18/02/12 reed-solomon codes 1/6 www.cs.cmu.edu/aguyb/realworld/reedsolomon/reed_solomon_codes.html Reed-Solomon CodeV An inWUodXcWion Wo Reed-Solomon codeV: pUincipleV, aUchiWecWXUe and implemenWaWion 1. InWUodXcWion Reed-Solomon codeV aUe block-baVed eUUoU coUUecWing codeV ZiWh a Zide Uange of applicaWionV in digiWal commXnicaWionV and VWoUage. Reed-Solomon codeV aUe XVed Wo coUUecW eUUoUV in man\ V\VWemV inclXding: SWoUage deYiceV (inclXding Wape, CompacW DiVk, DVD, baUcodeV, eWc) WiUeleVV oU mobile commXnicaWionV (inclXding cellXlaU WelephoneV, micUoZaYe linkV, eWc) SaWelliWe commXnicaWionV DigiWal WeleYiVion / DVB High-Vpeed modemV VXch aV ADSL, [DSL, eWc. A W\pical V\VWem iV VhoZn heUe: The Reed-Solomon encodeU WakeV a block of digiWal daWa and addV e[WUa "UedXndanW" biWV. EUUoUV occXU dXUing WUanVmiVVion oU VWoUage foU a nXmbeU of UeaVonV (foU e[ample noiVe oU inWeUfeUence, VcUaWcheV on a CD, eWc). The Reed-Solomon decodeU pUoceVVeV each block and aWWempWV Wo coUUecW eUUoUV and UecoYeU Whe oUiginal daWa. The nXmbeU and W\pe of eUUoUV WhaW can be coUUecWed dependV on Whe chaUacWeUiVWicV of Whe Reed-Solomon code. 2. PUopeUWieV of Reed-Solomon codeV Reed Solomon codeV aUe a VXbVeW of BCH codeV and aUe lineaU block codeV. A Reed-Solomon code iV Vpecified aV RS(n,k ) ZiWh V-biW V\mbolV. ThiV meanV WhaW Whe encodeU WakeV k daWa V\mbolV of V biWV each and addV paUiW\ V\mbolV Wo make an n V\mbol codeZoUd. TheUe aUe n-k paUiW\ V\mbolV of V biWV each. A Reed-Solomon decodeU can coUUecW Xp Wo W V\mbolV WhaW conWain eUUoUV in a codeZoUd, ZheUe 2W = n-k . The folloZing diagUam VhoZV a W\pical Reed-Solomon codeZoUd (WhiV iV knoZn aV a S\VWemaWic code becaXVe Whe daWa iV lefW Xnchanged and Whe paUiW\ V\mbolV aUe appended): E[ample: A popXlaU Reed-Solomon code iV RS(255,223) ZiWh 8-biW V\mbolV. Each codeZoUd conWainV 255 code ZoUd b\WeV, of Zhich 223 b\WeV aUe daWa and 32 b\WeV aUe paUiW\. FoU WhiV code:

description

Reed Solomon codes

Transcript of Reed Solomon Codes

  • 18/02/12 reed-solomon codes

    1/6www.cs.cmu.edu/aguyb/realworld/reedsolomon/reed_solomon_codes.html

    Reed-Solomon CodeV

    An inWUodXcWion Wo Reed-Solomon codeV: pUincipleV, aUchiWecWXUe and implemenWaWion

    1. InWUodXcWion

    Reed-Solomon codeV aUe block-baVed eUUoU coUUecWing codeV ZiWh a Zide Uange of applicaWionV in digiWal

    commXnicaWionV and VWoUage. Reed-Solomon codeV aUe XVed Wo coUUecW eUUoUV in man\ V\VWemV inclXding:

    SWoUage deYiceV (inclXding Wape, CompacW DiVk, DVD, baUcodeV, eWc)

    WiUeleVV oU mobile commXnicaWionV (inclXding cellXlaU WelephoneV, micUoZaYe linkV, eWc)

    SaWelliWe commXnicaWionV

    DigiWal WeleYiVion / DVB

    High-Vpeed modemV VXch aV ADSL, [DSL, eWc.

    A W\pical V\VWem iV VhoZn heUe:

    The Reed-Solomon encodeU WakeV a block of digiWal daWa and addV e[WUa "UedXndanW" biWV. EUUoUV occXU

    dXUing WUanVmiVVion oU VWoUage foU a nXmbeU of UeaVonV (foU e[ample noiVe oU inWeUfeUence, VcUaWcheV on a CD,eWc). The Reed-Solomon decodeU pUoceVVeV each block and aWWempWV Wo coUUecW eUUoUV and UecoYeU Whe

    oUiginal daWa. The nXmbeU and W\pe of eUUoUV WhaW can be coUUecWed dependV on Whe chaUacWeUiVWicV of Whe

    Reed-Solomon code.

    2. PUopeUWieV of Reed-Solomon codeV

    Reed Solomon codeV aUe a VXbVeW of BCH codeV and aUe lineaU block codeV. A Reed-Solomon code iV

    Vpecified aV RS(n,k) ZiWh V-biW V\mbolV.

    ThiV meanV WhaW Whe encodeU WakeV k daWa V\mbolV of V biWV each and addV paUiW\ V\mbolV Wo make an n

    V\mbol codeZoUd. TheUe aUe n-k paUiW\ V\mbolV of V biWV each. A Reed-Solomon decodeU can coUUecW Xp Wo

    W V\mbolV WhaW conWain eUUoUV in a codeZoUd, ZheUe 2W = n-k.

    The folloZing diagUam VhoZV a W\pical Reed-Solomon codeZoUd (WhiV iV knoZn aV a S\VWemaWic code

    becaXVe Whe daWa iV lefW Xnchanged and Whe paUiW\ V\mbolV aUe appended):

    E[ample: A popXlaU Reed-Solomon code iV RS(255,223) ZiWh 8-biW V\mbolV.

    Each codeZoUd conWainV 255 code ZoUd b\WeV, of Zhich 223 b\WeV aUe daWa and

    32 b\WeV aUe paUiW\. FoU WhiV code:

  • 18/02/12 reed-solomon codes

    2/6www.cs.cmu.edu/aguyb/realworld/reedsolomon/reed_solomon_codes.html

    Q = 255, N = 223, V = 8

    2W = 32, W = 16

    The decRdeU caQ cRUUecW aQ\ 16 V\PbRO eUURUV iQ Whe cRde ZRUd: i.e. eUURUV iQ XS

    WR 16 b\WeV aQ\ZheUe iQ Whe cRdeZRUd caQ be aXWRPaWicaOO\ cRUUecWed.

    GiYeQ a V\PbRO Vi]e V, Whe Pa[iPXP cRdeZRUd OeQgWh (Q) fRU a Reed-SRORPRQ cRde iV n = 2s 1

    FRU e[aPSOe, Whe Pa[iPXP OeQgWh Rf a cRde ZiWh 8-biW V\PbROV (V=8) iV 255 b\WeV.

    Reed-SRORPRQ cRdeV Pa\ be VhRUWeQed b\ (cRQceSWXaOO\) PaNiQg a QXPbeU Rf daWa V\PbROV ]eUR aW Whe

    eQcRdeU, QRW WUaQVPiWWiQg WheP, aQd WheQ Ue-iQVeUWiQg WheP aW Whe decRdeU.

    E[aPSOe: The (255,223) cRde deVcUibed abRYe caQ be VhRUWeQed WR (200,168).

    The eQcRdeU WaNeV a bORcN Rf 168 daWa b\WeV, (cRQceSWXaOO\) addV 55 ]eUR b\WeV,

    cUeaWeV a (255,223) cRdeZRUd aQd WUaQVPiWV RQO\ Whe 168 daWa b\WeV aQd 32SaUiW\ b\WeV.

    The aPRXQW Rf SURceVViQg "SRZeU" UeTXiUed WR eQcRde aQd decRde Reed-SRORPRQ cRdeV iV UeOaWed WR Whe

    QXPbeU Rf SaUiW\ V\PbROV SeU cRdeZRUd. A OaUge YaOXe Rf W PeaQV WhaW a OaUge QXPbeU Rf eUURUV caQ becRUUecWed bXW UeTXiUeV PRUe cRPSXWaWiRQaO SRZeU WhaQ a VPaOO YaOXe Rf W.

    S\PbRO EUURUV

    OQe V\PbRO eUURU RccXUV ZheQ 1 biW iQ a V\PbRO iV ZURQg RU ZheQ aOO Whe biWV iQ a V\PbRO aUe ZURQg.

    E[aPSOe: RS(255,223) caQ cRUUecW 16 V\PbRO eUURUV. IQ Whe ZRUVW caVe, 16 biWeUURUV Pa\ RccXU, each iQ a VeSaUaWe V\PbRO (b\We) VR WhaW Whe decRdeU cRUUecWV

    16 biW eUURUV. IQ Whe beVW caVe, 16 cRPSOeWe b\We eUURUV RccXU VR WhaW Whe decRdeUcRUUecWV 16 [ 8 biW eUURUV.

    Reed-SRORPRQ cRdeV aUe SaUWicXOaUO\ ZeOO VXiWed WR cRUUecWiQg bXUVW eUURUV (ZheUe a VeUieV Rf biWV iQ Whe

    cRdeZRUd aUe UeceiYed iQ eUURU).

    DecRdiQg

    Reed-SRORPRQ aOgebUaic decRdiQg SURcedXUeV caQ cRUUecW eUURUV aQd eUaVXUeV. AQ eUaVXUe RccXUV ZheQ WheSRViWiRQ Rf aQ eUUed V\PbRO iV NQRZQ. A decRdeU caQ cRUUecW XS WR W eUURUV RU XS WR 2W eUaVXUeV. EUaVXUe

    iQfRUPaWiRQ caQ RfWeQ be VXSSOied b\ Whe dePRdXOaWRU iQ a digiWaO cRPPXQicaWiRQ V\VWeP, i.e. Whe dePRdXOaWRU"fOagV" UeceiYed V\PbROV WhaW aUe OiNeO\ WR cRQWaiQ eUURUV.

    WheQ a cRdeZRUd iV decRded, WheUe aUe WhUee SRVVibOe RXWcRPeV:

    1. If 2V + U < 2W (V eUURUV, U eUaVXUeV) WheQ Whe RUigiQaO WUaQVPiWWed cRde ZRUd ZiOO aOZa\V be UecRYeUed,

    OTHERWISE

    2. The decRdeU ZiOO deWecW WhaW iW caQQRW UecRYeU Whe RUigiQaO cRde ZRUd aQd iQdicaWe WhiV facW.

    OR

  • 18/02/12 reed-solomon codes

    3/6www.cs.cmu.edu/aguyb/realworld/reedsolomon/reed_solomon_codes.html

    3. The decRdeU ZiOO PiV-decRde aQd UecRYeU aQ iQcRUUecW cRde ZRUd ZiWhRXW aQ\ iQdicaWiRQ.

    The SURbabiOiW\ Rf each Rf Whe WhUee SRVVibiOiWieV deSeQdV RQ Whe SaUWicXOaU Reed-SRORPRQ cRde aQd RQ WheQXPbeU aQd diVWUibXWiRQ Rf eUURUV.

    CRdiQg GaiQ

    The adYaQWage Rf XViQg Reed-SRORPRQ cRdeV iV WhaW Whe SURbabiOiW\ Rf aQ eUURU UePaiQiQg iQ Whe decRded daWa

    iV (XVXaOO\) PXch ORZeU WhaQ Whe SURbabiOiW\ Rf aQ eUURU if Reed-SRORPRQ iV QRW XVed. ThiV iV RfWeQ deVcUibedaV coding gain.

    E[aPSOe: A digiWaO cRPPXQicaWiRQ V\VWeP iV deVigQed WR RSeUaWe aW a BiW EUURU

    RaWiR (BER) Rf 10-9, i.e. QR PRUe WhaQ 1 iQ 109 biWV aUe UeceiYed iQ eUURU. ThiV caQbe achieYed b\ bRRVWiQg Whe SRZeU Rf Whe WUaQVPiWWeU oU b\ addiQg Reed-SRORPRQ

    (RU aQRWheU W\Se Rf FRUZaUd EUURU CRUUecWiRQ). Reed-SRORPRQ aOORZV Whe V\VWePWR achieYe WhiV WaUgeW BER ZiWh a ORZeU WUaQVPiWWeU RXWSXW SRZeU. The SRZeU

    "VaYiQg" giYeQ b\ Reed-SRORPRQ (iQ decibeOV) iV Whe coding gain.

    3. AUchiWecWXUeV foU encoding and decoding Reed-Solomon codeV

    Reed-SRORPRQ eQcRdiQg aQd decRdiQg caQ be caUUied RXW iQ VRfWZaUe RU iQ VSeciaO-SXUSRVe haUdZaUe.

    FiQiWe (GaORiV) FieOd AUiWhPeWic

    Reed-SRORPRQ cRdeV aUe baVed RQ a VSeciaOiVW aUea Rf PaWhePaWicV NQRZQ aV GaORiV fieOdV RU fiQiWe fieOdV. AfiQiWe fieOd haV Whe SURSeUW\ WhaW aUiWhPeWic RSeUaWiRQV (+,-,[,/ eWc.) RQ fieOd eOePeQWV aOZa\V haYe a UeVXOW iQ Whe

    fieOd. A Reed-SRORPRQ eQcRdeU RU decRdeU QeedV WR caUU\ RXW WheVe aUiWhPeWic RSeUaWiRQV. TheVe RSeUaWiRQVUeTXiUe VSeciaO haUdZaUe RU VRfWZaUe fXQcWiRQV WR iPSOePeQW.

    GeQeUaWRU PRO\QRPiaO

    A Reed-SRORPRQ cRdeZRUd iV geQeUaWed XViQg a VSeciaO SRO\QRPiaO. AOO YaOid cRdeZRUdV aUe e[acWO\

    diYiVibOe b\ Whe geQeUaWRU SRO\QRPiaO. The geQeUaO fRUP Rf Whe geQeUaWRU SRO\QRPiaO iV:

    aQd Whe cRdeZRUd iV cRQVWUXcWed XViQg:

    c([) = g([).i([)

    ZheUe g([) iV Whe geQeUaWRU SRO\QRPiaO, i([) iV Whe iQfRUPaWiRQ bORcN, c([) iV a YaOid cRdeZRUd aQd a iV

    UefeUUed WR aV a SUiPiWiYe eOePeQW Rf Whe fieOd.

    E[aPSOe: GeQeUaWRU fRU RS(255,249)

    3.1 EncodeU aUchiWecWXUe

    The 2t SaUiW\ V\PbROV iQ a V\VWePaWic Reed-SRORPRQ cRdeZRUd aUe giYeQ b\:

  • 18/02/12 reed-solomon codes

    4/6www.cs.cmu.edu/aguyb/realworld/reedsolomon/reed_solomon_codes.html

    The folloZing diagUam VhoZV an aUchiWecWXUe foU a V\VWemaWic RS(255,249) encodeU:

    Each of Whe 6 UegiVWeUV holdV a V\mbol (8 biWV). The aUiWhmeWic opeUaWoUV caUU\ oXW finiWe field addiWion oUmXlWiplicaWion on a compleWe V\mbol.

    3.2 Decoder architecture

    A geneUal aUchiWecWXUe foU decoding Reed-Solomon codeV iV VhoZn in Whe folloZing diagUam.

    Ke\

    U([) ReceiYed codeZoUd

    Si S\ndUomeV

    L([) EUUoU locaWoU pol\nomial

    Xi EUUoU locaWionV

    Yi EUUoU magniWXdeV

    c([) RecoYeUed code ZoUd

    Y NXmbeU of eUUoUV

    The UeceiYed codeZoUd U([) iV Whe oUiginal (WUanVmiWWed) codeZoUd c([) plXV eUUoUV:

    U([) = c([) + e([)

    A Reed-Solomon decodeU aWWempWV Wo idenWif\ Whe poViWion and magniWXde of Xp Wo W eUUoUV (oU 2W eUaVXUeV)

    and Wo coUUecW Whe eUUoUV oU eUaVXUeV.

    S\ndUome CalcXlaWion

    ThiV iV a VimilaU calcXlaWion Wo paUiW\ calcXlaWion. A Reed-Solomon codeZoUd haV 2W s\ndromes WhaW depend

  • 18/02/12 reed-solomon codes

    5/6www.cs.cmu.edu/aguyb/realworld/reedsolomon/reed_solomon_codes.html

    only on errors (not on the transmitted code word). The syndromes can be calculated by substituting the 2troots of the generator polynomial g(x) into r(x).

    Finding the Symbol Error Locations

    This involves solving simultaneous equations with t unknowns. Several fast algorithms are available to do this.

    These algorithms take advantage of the special matrix structure of Reed-Solomon codes and greatly reduce

    the computational effort required. In general two steps are involved:

    Find an error locator polynomial

    This can be done using the Berlekamp-Massey algorithm or Euclids algorithm. Euclids

    algorithm tends to be more widely used in practice because it is easier to implement: however,the Berlekamp-Massey algorithm tends to lead to more efficient hardware and software

    implementations.

    Find the roots of this polynomial

    This is done using the Chien search algorithm.

    Finding the Symbol Error Values

    Again, this involves solving simultaneous equations with t unknowns. A widely-used fast algorithm is the

    Forney algorithm.

    4. Implementation of Reed-Solomon encoders and decoders

    Hardware Implementation

    A number of commercial hardware implementations exist. Many existing systems use "off-the-shelf" integrated

    circuits that encode and decode Reed-Solomon codes. These ICs tend to support a certain amount of

    programmability (for example, RS(255,k) where t = 1 to 16 symbols). A recent trend is towards VHDL or

    Verilog designs (logic cores or intellectual propert\ cores). These have a number of advantages overstandard ICs. A logic core can be integrated with other VHDL or Verilog components and synthesized to an

    FPGA (Field Programmable Gate Array) or ASIC (Application Specific Integrated Circuit) this enables

    so-called "System on Chip" designs where multiple modules can be combined in a single IC. Depending onproduction volumes, logic cores can often give significantly lower system costs than "standard" ICs. By using

    logic cores, a designer avoids the potential need to do a "lifetime buy" of a Reed-Solomon IC.

    Software Implementation

    Until recently, software implementations in "real-time" required too much computational power for all but the

    simplest of Reed-Solomon codes (i.e. codes with small values of t). The major difficulty in implementing

    Reed-Solomon codes in software is that general purpose processors do not support Galois field arithmeticoperations. For example, to implement a Galois field multiply in software requires a test for 0, two log table

    look-ups, modulo add and anti-log table look-up. However, careful design together with increases in

    processor performance mean that software implementations can operate at relatively high data rates. The

    following table gives some example benchmark figures on a 166MHz Pentium PC:

  • 18/02/12 reed-solomon codes

    6/6www.cs.cmu.edu/aguyb/realworld/reedsolomon/reed_solomon_codes.html

    Code Data rate

    RS(255,251) 12 Mbps

    RS(255,239) 2.7 Mbps

    RS(255,223) 1.1 Mbps

    These data rates are for decoding onl\: encoding is considerabl\ faster since it requires less computation.

    5. FXUWheU Ueading

    In this paper we have deliberatel\ avoided discussing the theor\ and implementation of Reed-Solomon codesin detail. For more detail please see the following books:

    1.Wicker, "Error Control S\stems for Digital Communication and Storage", Prentice-Hall 1995

    2. Lin and Costello, "Error Control Coding: Fundamentals and Applications", Prentice-Hall 1983

    3. Clark and Cain, "Error Correction Coding for Digital Communications", Plenum 1988

    4. Wilson, "Digital Modulation and Coding", Prentice-Hall 1996

    6. AboXW Whe aXWhoUV

    This paper was written b\ Mart\n Rile\ and Iain Richardson. For more details about the authors click here.

    Copyright 4i2i Communications Ltd 1996, 1997, 1998