Error correction code: Difference between revisions

Content deleted Content added
No edit summary
Tags: Mobile edit Mobile web edit
Citation bot (talk | contribs)
Removed URL that duplicated identifier. Removed parameters. | Use this bot. Report bugs. | Suggested by Headbomb | Linked from Wikipedia:WikiProject_Academic_Journals/Journals_cited_by_Wikipedia/Sandbox | #UCB_webform_linked 843/1032
 
(126 intermediate revisions by 84 users not shown)
Line 1:
{{short description|schemeScheme for controlling errors in data over noisy communication channels}}
{{redirect|Interleaver|the fiber-optic device|optical interleaver}}
{{Use dmy dates|date=JulyAugust 20132022}}
In [[computing]], [[telecommunication]], [[information theory]], and [[coding theory]], '''forward error correction''' ('''FEC''') or '''channel coding'''<ref>{{cite journal |author1=Charles Wang |author2=Dean Sklar |author3=Diana Johnson |title=Forward Error-Correction Coding |journal=Crosslink |publisher=The Aerospace Corporation |volume=3 |issue=1 |date=Winter 2001–2002 |url=http://www.aero.org/publications/crosslink/winter2002/04.html |access-date=5 March 2006 |archive-url=https://web.archive.org/web/20120314085127/http://www.aero.org/publications/crosslink/winter2002/04.html |archive-date=14 March 2012 |url-status=dead }}</ref><ref>{{cite journal |author1=Charles Wang |author2=Dean Sklar |author3=Diana Johnson |title=Forward Error-Correction Coding |journal=Crosslink |publisher=The Aerospace Corporation |volume=3 |issue=1 |date=Winter 2001–2002 |url=http://www.aero.org/publications/crosslink/winter2002/04_sidebar1.html | quote=How Forward Error-Correcting Codes Work] |access-date=5 March 2006 |archive-url=https://web.archive.org/web/20120314085127/http://www.aero.org/publications/crosslink/winter2002/04_sidebar1.html |archive-date=14 March 2012 |url-status=dead }}</ref><ref name=":0">{{Cite web|url=https://www.accelercomm.com/overview-channel-coding|title=Overview of Channel Coding|last=Maunder|first=Robert|date=2016}}</ref> is a technique used for [[error control|controlling errors]] in [[data transmission]] over unreliable or noisy [[communication channel]]s.
In [[computing]], [[telecommunication]], [[information theory]], and [[coding theory]], an '''error correction code,''' sometimes '''error correcting code,''' ('''ECC''') is used for [[error control|controlling errors]] in data over unreliable or noisy [[communication channel]]s.<ref> {{cite journal
| last1 = Glover | first1 = Neal
| last2 = Dudley | first2 = Trent
| title = Practical Error Correction Design For Engineers
| edition= Revision 1.1, 2<sup>nd</sup>
| publisher = Cirrus Logic
| ___location = CO, USA
| year = 1990
| isbn= 0-927239-00-0
}}</ref><ref name="Hamming">{{cite journal
| last = Hamming
| first = R. W.
| title = Error Detecting and Error Correcting Codes
| journal = Bell System Tech. J.
| volume = 29
| issue = 2
| pages = 147–160
| publisher = AT&T
| ___location = USA
| date = April 1950
| url = http://www3.alcatel-lucent.com/bstj/vol29-1950/articles/bstj29-2-147.pdf
| issn =
| doi = 10.1002/j.1538-7305.1950.tb00463.x
| id =
| accessdate = 4 December 2012}}</ref> The central idea is the sender encodes the message with a [[Redundancy (information theory)|redundant]] in the form of an ECC. The American mathematician [[Richard Hamming]] pioneered this field in the 1940s and invented the first error-correcting code in 1950: the [[Hamming (7,4) code]].<ref name="Hamming" />
The redundancy allows the receiver to detect a limited number of errors that may occur anywhere in the message, and often to correct these errors without retransmission. ECC gives the receiver the ability to correct errors without needing a [[reverse channel]] to request retransmission of data, but at the cost of a fixed, higher forward channel bandwidth. ECC is therefore applied in situations where retransmissions are costly or impossible, such as one-way communication links and when transmitting to multiple receivers in [[multicast]]. For example, in the case of a satellite orbiting around [[Uranus]], a retransmission because of decoding errors can create a delay of 5 hours. ECC information is usually added to [[mass storage]] devices to enable recovery of corrupted data, is widely used in [[modem]]s, and is used on systems where the primary memory is [[ECC memory]].
 
The central idea is that the sender encodes the message in a [[Redundancy (information theory)|redundant]] way, most often by using an '''error correction code''', or '''error correcting code''' ('''ECC''').<ref>{{cite book |author-last1=Glover |author-first1=Neal |author-last2=Dudley |author-first2=Trent |title=Practical Error Correction Design For Engineers |edition=Revision 1.1, 2nd |publisher=[[Cirrus Logic]] |___location=CO, USA |date=1990 |isbn=0-927239-00-0 }}</ref><ref name="Hamming">{{cite journal |author-last=Hamming |author-first=Richard Wesley |author-link=Richard Wesley Hamming |title=Error Detecting and Error Correcting Codes |journal=[[Bell System Technical Journal]] |volume=29 |issue=2 |pages=147–160 |publisher=[[AT&T]] |___location=USA |date=April 1950 |doi=10.1002/j.1538-7305.1950.tb00463.x|s2cid=61141773 |hdl=10945/46756 |hdl-access=free }}</ref> The redundancy allows the receiver not only to [[error detection|detect errors]] that may occur anywhere in the message, but often to correct a limited number of errors. Therefore a [[reverse channel]] to request re-transmission may not be needed. The cost is a fixed, higher forward channel bandwidth.
ECC processing in a receiver may be applied to a digital bit stream or in the demodulation of a digitally modulated carrier. For the latter, ECC is an integral part of the initial [[Analog-to-digital converter|analog-to-digital conversion]] in the receiver. The [[Viterbi decoder]] implements a [[Error correction code#Types of ECC|soft-decision algorithm]] to demodulate digital data from an analog signal corrupted by noise. Many ECC encoders/decoders can also generate a [[bit-error rate]] (BER) signal which can be used as feedback to fine-tune the analog receiving electronics.
 
The American mathematician [[Richard Hamming]] pioneered this field in the 1940s and invented the first error-correcting code in 1950: the [[Hamming (7,4) code]].<ref name="Hamming"/>
 
FEC can be applied in situations where re-transmissions are costly or impossible, such as one-way communication links or when transmitting to multiple receivers in [[multicast]].
 
Long-latency connections also benefit; in the case of satellites orbiting distant planets, retransmission due to errors would create a delay of several hours. FEC is also widely used in [[modem]]s and in [[cellular network]]s.
 
FEC processing in a receiver may be applied to a digital bit stream or in the demodulation of a digitally modulated carrier. For the latter, FEC is an integral part of the initial [[Analog-to-digital converter|analog-to-digital conversion]] in the receiver. The [[Viterbi decoder]] implements a [[Soft-decision decoder|soft-decision algorithm]] to demodulate digital data from an analog signal corrupted by noise. Many FEC decoders can also generate a [[bit-error rate]] (BER) signal which can be used as feedback to fine-tune the analog receiving electronics.
 
FEC information is added to [[mass storage]] (magnetic, optical and solid state/flash based) devices to enable recovery of corrupted data, and is used as [[ECC memory|ECC]] [[computer memory]] on systems that require special provisions for reliability.
The maximum fractionsproportion of errors or of missing bits that can be corrected is determined by the design of the ECC code, so different forward error correcting codes are suitable for different conditions. In general, a stronger code induces more redundancy that needs to be transmitted using the available bandwidth, which reduces the effective bit-rate while improving the received effective [[signal-to-noise ratio]]. The [[noisy-channel coding theorem]] of [[Claude Shannon]] answerscan thebe questionused ofto howcompute muchthe bandwidth is left formaximum dataachievable communication whilebandwidth usingfor thea mostgiven efficientmaximum code that turns the decodingacceptable error probability to zero. This establishes bounds on the theoretical maximum information transfer rate of a channel with some given base noise level. However, the proof is not constructive, and hence gives no insight of how to build a capacity achieving code. After years of research, some advanced ECCFEC systems nowadayslike [[Polar code (coding theory)|polar code]]<ref name=":0" /> come very close to the theoretical maximum given by the Shannon channel capacity under the hypothesis of an infinite length frame.
 
==How it worksMethod==
ECC is accomplished by adding [[redundancy (information theory)|redundancy]] to the transmitted information using an algorithm. A redundant bit may be a complexcomplicated function of many original information bits. The original information may or may not appear literally in the encoded output; codes that include the unmodified input in the output are '''[[systematic code|systematic]]''', while those that do not are '''non-systematic'''.
 
A simplistic example of ECC is to transmit each data bit 3three times, which is known as a (3,1) [[repetition code]]. Through a noisy channel, a receiver might see 8eight versions of the output, see table below.
 
{| class=wikitable
! width=50% |Triplet received
! width=50% |Interpreted as
|-
|- valign="top"
|000
|0 (error -free)
|-
|- valign="top"
|001
|0
|-
|- valign="top"
|010
|0
|-
|- valign="top"
|100
|0
|-
|- valign="top"
|111
|1 (error -free)
|-
|- valign="top"
|110
|1
|-
|- valign="top"
|101
|1
|-
|- valign="top"
|011
|1
|}
This allows an error in any one of the three samples to be corrected by "majority vote", or "democratic voting". The correcting ability of this ECC is:
* Up to 1one bit of triplet in error, or
* up to 2two bits of triplet omitted (cases not shown in table).
Though simple to implement and widely used, this [[triple modular redundancy]] is a relatively inefficient ECC. Better ECC codes typically examine the last several dozen,tens or even the last several hundred,hundreds of previously received bits to determine how to decode the current small handful of bits (typically in groups of 2two to 8eight bits).
 
==Averaging noise to reduce errors==
Line 77 ⟶ 62:
* Interleaving ECC coded data can reduce the all or nothing properties of transmitted ECC codes when the channel errors tend to occur in bursts. However, this method has limits; it is best used on narrowband data.
 
Most telecommunication systems use a fixed [[channel code]] designed to tolerate the expected worst-case [[bit error rate]], and then fail to work at all if the bit error rate is ever worse.
However, some systems adapt to the given channel error conditions: some instances of [[hybrid automatic repeat-request]] use a fixed ECC method as long as the ECC can handle the error rate, then switch to [[Automatic Repeat Request|ARQ]] when the error rate gets too high;
[[adaptive modulation and coding]] uses a variety of ECC rates, adding more error-correction bits per packet when there are higher error rates in the channel, or taking them out when they are not needed.
 
==Types of ECC==
{{Main|Block code|Convolutional code}}
 
[[File:Block code error correction.png|thumb|upright=1.3|A block code (specifically a [[Hamming code]]) where redundant bits are added as a block to the end of the initial message]]
[[File:Convolutional code error correction.png|thumb|A continuous [[convolutional code]] where redundant bits are added continuously into the structure of the code word]]
 
The two main categories of ECC codes are [[block code]]s and [[convolutional code]]s.
* Block codes work on fixed-size blocks (packets) of bits or symbols of predetermined size. Practical block codes can generally be hard-decoded in [[polynomial time]] to their block length.
* Convolutional codes work on bit or symbol streams of arbitrary length. They are most often soft decoded with the [[Viterbi algorithm]], though other algorithms are sometimes used. Viterbi decoding allows asymptotically optimal decoding efficiency with increasing constraint length of the convolutional code, but at the expense of [[exponential time|exponentially]] increasing complexity. A convolutional code that is terminated is also a 'block code' in that it encodes a block of input data, but the block size of a convolutional code is generally arbitrary, while block codes have a fixed size dictated by their algebraic characteristics. Types of termination for convolutional codes include "tail-biting" and "bit-flushing".
There are many types of block codes, but among the classical ones the most notable is; [[Reed-SolomonReed–Solomon error correction|Reed-SolomonReed–Solomon coding]] becauseis ofnoteworthy for its widespread use in [[compact disc]]s, [[DVD]]s, and [[hard disk drive#Error rates and handling|hard disk drives]]. Other examples of classical block codes include [[Golay code (disambiguation)|Golay]], [[BCH code|BCH]], [[Multidimensional parity-check code|Multidimensional parity]], and [[Hamming code]]s.
 
Hamming ECC is commonly used to correct [[ECC memory]] and early SLC [[NAND flash]] memory errors.<ref>[http://www.eetasia.com/ART_8800575062_499486_AN_7549c493.HTM "Hamming codes for NAND flash memory devices"] {{Webarchive|url=https://web.archive.org/web/20160821122453/http://www.eetasia.com/ART_8800575062_499486_AN_7549c493.HTM |date=21 August 2016 }}. EE Times-Asia. Apparently based on [http://www.micron.com/~/media/Documents/Products/Technical%20Note/NAND%20Flash/tn2908_NAND_hamming_ECC_code.pdf "Micron Technical Note TN-29-08: Hamming Codes for NAND Flash Memory Devices"] {{Webarchive|url=https://web.archive.org/web/20170829073235/http://www.micron.com/~/media/Documents/Products/Technical%20Note/NAND%20Flash/tn2908_NAND_hamming_ECC_code.pdf |date=29 August 2017 }}. 2005. Both say: "The Hamming algorithm is an industry-accepted method for error detection and correction in many SLC NAND flash-based applications."</ref>
Hamming ECC is commonly used to correct [[NAND flash]] memory errors.<ref>
[http://www.eetasia.com/ART_8800575062_499486_AN_7549c493.HTM "Hamming codes for NAND flash memory devices"].
EE Times-Asia.
Apparently based on
[http://www.micron.com/~/media/Documents/Products/Technical%20Note/NAND%20Flash/tn2908_NAND_hamming_ECC_code.pdf "Micron Technical Note TN-29-08: Hamming Codes for NAND Flash Memory Devices"].
2005.
Both say:
"The Hamming algorithm is an industry-accepted method for error detection and correction in many SLC NAND flash-based applications."
</ref>
This provides single-bit error correction and 2-bit error detection.
Hamming codes are only suitable for more reliable [[single-level cell]] (SLC) NAND.
Denser [[multi-level cell]] (MLC) NAND may use multi-bit correcting ECC such as [[BCH code|BCH]], Reed–Solomon, or [[Low-density parity-check code|LDPC]].<ref name="spansion">{{cite web|url=http://www.spansion.com/Support/Application%20Notes/Types_of_ECC_Used_on_Flash_AN.pdf|title =What Types of ECC Should Be Used on Flash Memory?|publisher=Spansion|format=Application note|year=2011|quote=Both Reed–Solomon algorithm and BCH algorithm are common ECC choices for MLC NAND flash. ... Hamming based block codes are the most commonly used ECC for SLC.... both Reed–Solomon and BCH are able to handle multiple errors and are widely used on MLC flash.}}</ref><ref>{{cite web|author=Jim Cooke|url=https://cushychicken.github.io/assets/cooke_inconvenient_truths.pdf |title=The Inconvenient Truths of NAND Flash Memory|date=August 2007|page=28|quote=For SLC, a code with a correction threshold of 1 is sufficient. t=4 required ... for MLC.}}</ref><ref>https://www.thinkmind.org/articles/icons_2015_5_20_40055.pdf {{Bare URL PDF|date=July 2025}}</ref> NOR flash typically does not use any error correction.<ref name="spansion"/>
Denser [[multi-level cell]] (MLC) NAND requires stronger multi-bit correcting ECC such as BCH or Reed–Solomon.<ref name="spansion">
[http://www.spansion.com/Support/Application%20Notes/Types_of_ECC_Used_on_Flash_AN.pdf "What Types of ECC Should Be Used on Flash Memory?"].
(Spansion application note).
2011.
says: "Both Reed-Solomon algorithm and BCH algorithm are common ECC choices for MLC NAND flash. ... Hamming based block codes are the most commonly used ECC for SLC.... both Reed-Solomon and BCH are able to handle multiple errors and are widely used on MLC flash."
</ref><ref>
Jim Cooke.
[https://cushychicken.github.io/assets/cooke_inconvenient_truths.pdf "The Inconvenient Truths of NAND Flash Memory"].
2007.
p. 28.
says
"For SLC, a code with a correction threshold of 1 is sufficient. t=4 required ... for MLC."
</ref>
{{Dubious|date=March 2008}}
NOR Flash typically does not use any error correction.<ref name="spansion" />
 
Classical block codes are usually decoded using '''hard-decision''' algorithms,<ref>{{cite journal |author1author-last1=Baldi |author-first1=M. |author2author-last2=Chiaraluce |author-first2=F. |title=A Simple Scheme for Belief Propagation Decoding of BCH and RS Codes in Multimedia Transmissions |journal=[[International Journal of Digital Multimedia Broadcasting]] |volume=2008 |pages=9578461–12 |yeardate=2008 |doi=10.1155/2008/957846 |urldoi-access=http://www.hindawi.com/journals/ijdmb/2008/957846.htmlfree }}</ref> which means that for every input and output signal a hard decision is made whether it corresponds to a one or a zero bit. In contrast, convolutional codes are typically decoded using '''soft-decision''' algorithms like the Viterbi, MAP or [[BCJR algorithm|BCJR]] algorithms, which process (discretized) analog signals, and which allow for much higher error-correction performance than hard-decision decoding.
 
Nearly all classical block codes apply the algebraic properties of [[finite field]]s. Hence classical block codes are often referred to as algebraic codes.
Line 122 ⟶ 89:
In contrast to classical block codes that often specify an error-detecting or error-correcting ability, many modern block codes such as [[LDPC codes]] lack such guarantees. Instead, modern codes are evaluated in terms of their bit error rates.
 
Most [[forward error correction]] codes correct only bit-flips, but not bit-insertions or bit-deletions.
In this setting, the [[Hamming distance]] is the appropriate way to measure the [[bit error rate]].
A few forward error correction codes are designed to correct bit-insertions and bit-deletions, such as Marker Codes and Watermark Codes.
The [[Levenshtein distance]] is a more appropriate way to measure the bit error rate when using such codes.
<ref>{{cite web |author-last1=Shah |author-first1=Gaurav |author-last2=Molina |author-first2=Andres |author-last3=Blaze |author-first3=Matt |title=Keyboards and covert channels |url=https://www.usenix.org/legacy/event/sec06/tech/full_papers/shah/shah_html/jbug-Usenix06.html |website=USENIX |access-date=20 December 2018 |date=2006}}</ref>
<ref>{{cite web
| last1=Shah | first1=Gaurav
| last2=Molina | first2=Andres
| last3=Blaze | first3=Matt
| title=Keyboards and covert channels
| url=https://www.usenix.org/legacy/event/sec06/tech/full_papers/shah/shah_html/jbug-Usenix06.html
| website=Usenix.org
| accessdate=20 December 2018
| year=2006
}}
</ref>
 
==Code-rate and the tradeoff between reliability and data rate==
{{See also|Bit rate#Information rate}}
The fundamental principle of ECC is to add redundant bits in order to help the decoder to find out the true message that was encoded by the transmitter. The code-rate of a given ECC system is defined as the rate between the number of information bits and the total number of bits (i.e. information plus redundancy bits) in a given communication package. The code-rate is hence a real number. A low code-rate close to zero implies a strong code that uses many redundant bits to achieve a good performance, while a large code-rate close to 1 implies a weak code.
The fundamental principle of ECC is to add redundant bits in order to help the decoder to find out the true message that was encoded by the transmitter. The code-rate of a given ECC system is defined as the ratio between the number of information bits and the total number of bits (i.e., information plus redundancy bits) in a given communication package. The code-rate is hence a real number. A low code-rate close to zero implies a strong code that uses many redundant bits to achieve a good performance, while a large code-rate close to 1 implies a weak code.
 
The redundant bits that protect the information have to be transferred using the same communication resources that they are trying to protect. This causes a fundamental tradeoff between reliability and data rate.<ref>{{citation | author -first1= David |author-last1=Tse, |author-first2=Pramod |author-last2=Viswanath | title = Fundamentals of Wireless Communication | publisher = [[Cambridge University Press]], UK | yeardate=2005}}</ref>. In one extreme, a strong code (with low code-rate) can induce an important increase in the receiver SNR (signal-to-noise-ratio) decreasing the bit error rate, at the cost of reducing the effective data rate. On the other extreme, not using any ECC (i.e., a code-rate equal to 1) uses the full channel for information transfer purposes, at the cost of leaving the bits without any additional protection.
 
One interesting question is the following: how efficient in terms of information transfer can be an ECC be that has a negligible decoding error rate? This question was answered by Claude Shannon with his second theorem, which says that the channel capacity is the maximum bit rate achievable by any ECC whose error rate tends to zero:<ref name="shannon paper">{{cite journal|first=C. E. |last=Shannon: ''|title=A mathematical theory of communication.'' |journal=[[Bell System Technical Journal, vol. ]]|volume=27, pp. |issue=3–4|pages=379–423 and& 623–656, July and October |date=1948|url=http://www.math.harvard.edu/~ctm/home/text/others/shannon/entropy/entropy.pdf|doi=10.1002/j.1538-7305.1948.tb01338.x|hdl=11858/00-001M-0000-002C-4314-2|hdl-access=free}}</ref>. His proof relies on Gaussian random coding, which is not suitable ofto real-world applications. ThisThe upper bound given by Shannon's work set upinspired a long journey in designing ECCs that can gocome close to the ultimate performance boundary. Various codes today can attain almost the Shannon limit. However, capacity achieving ECCs are usually extremely complex to implement.
 
The most popular ECCs have a trade-off between performance and computational complexity. Usually, their parameters give a range of possible code rates, which can be optimized depending ofon the scenario. Usually, this optimization is done in order to achieve a low decoding error probability withoutwhile hurtingminimizing toothe muchimpact to the data rate. Another criteriacriterion for optimizing the code rate is to balance low error rate and retransmissions number in order to the energy cost of the communication.<ref>{{Cite conference |title=Optimizing the code rate for achieving energy-efficient wireless communications |first1=F. |last1=Rosas |first2=G. |last2=Brante |first3=R. D. |last3=Souza |first4=C. |last4=Oberli |date=2014 |pages=775–780 |doi=10.1109/WCNC.2014.6952166 |isbn=978-1-4799-3083-8 |book-title=Proceedings of the IEEE Wireless Communications and Networking Conference (WCNC)}}</ref>
{{Cite conference | title= Optimizing the code rate for achieving energy-efficient wireless communications| first1 = Fernando | last1 = Rosas| first2 = Glauber | last2 = Brante| first3 = Richard Demo | last3 = Souza| first4 = Christian | last4 = Oberli| url = http://ieeexplore.ieee.org/abstract/document/6952166/| year= 2014| booktitle=Proceedings of the IEEE Wireless Communications and Networking Conference (WCNC)}}</ref>.
 
==Concatenated ECC codes for improved performance==
{{Main|Concatenated error correction codes}}
Classical (algebraic) block codes and convolutional codes are frequently combined in '''concatenated''' coding schemes in which a short constraint-length Viterbi-decoded convolutional code does most of the work and a block code (usually Reed-SolomonReed–Solomon) with larger symbol size and block length "mops up" any errors made by the convolutional decoder. Single pass decoding with this family of error correction codes can yield very low error rates, but for long range transmission conditions (like deep space) iterative decoding is recommended.
 
Concatenated codes have been standard practice in satellite and deep space communications since [[Voyager program|Voyager 2]] first used the technique in its 1986 encounter with [[Uranus]]. The [[Galileo (spacecraft)|Galileo]] craft used iterative concatenated codes to compensate for the very high error rate conditions caused by having a failed antenna.
Line 163 ⟶ 120:
they were mostly ignored until the 1990s.
 
LDPC codes are now used in many recent high-speed communication standards, such as [[DVB-S2]] (Digital Video Broadcasting – Satellite – Second Generation), [[WiMAX]] ([[IEEE 802.16e]] standard for microwave communications), High-Speed Wireless LAN ([[IEEE 802.11n]]),<ref>IEEE Standard, section 20.3.11.6 [http://standards.ieee.org/getieee802/download/802.11n-2009.pdf "802.11n-2009"] {{Webarchive|url=https://web.archive.org/web/20130203104520/http://standards.ieee.org/getieee802/download/802.11n-2009.pdf |date=3 February 2013 }}, IEEE, 29 October 2009, accessed 21 March 2011.</ref> [[802.3an#10GBASE-T|10GBase-T Ethernet]] (802.3an) and [[G.hn|G.hn/G.9960]] (ITU-T Standard for networking over power lines, phone lines and coaxial cable). Other LDPC codes are standardized for wireless communication standards within [[3GPP]] [[MBMS]] (see [[Fountain code#Fountain codes in standards|fountain codes]]).
 
==Turbo codes==
Line 177 ⟶ 134:
 
[[Locally decodable code]]s are error-correcting codes for which single bits of the message can be probabilistically recovered by only looking at a small (say constant) number of positions of a codeword, even after the codeword has been corrupted at some constant fraction of positions. [[Locally testable code]]s are error-correcting codes for which it can be checked probabilistically whether a signal is close to a codeword by only looking at a small number of positions of the signal.
 
Not all locally decodable codes (LDCs) are locally testable codes (LTCs)<ref name="decNotTest">{{cite web |last1=Kaufman |first1=Tali |author1-link=Tali Kaufman |last2=Viderman |first2=Michael |title=Locally Testable vs. Locally Decodable Codes |url=http://eccc.hpi-web.de/report/2010/130/revision/1/download/}}</ref> neither locally correctable codes (LCCs),<ref>{{Cite web |last=Brubaker |first=Ben |date=2024-01-09 |title='Magical' Error Correction Scheme Proved Inherently Inefficient |url=https://www.quantamagazine.org/magical-error-correction-scheme-proved-inherently-inefficient-20240109/ |access-date=2024-01-09 |website=Quanta Magazine |language=en}}</ref> q-query LCCs are bounded exponentially<ref>{{Cite arXiv |last1=Kothari |first1=Pravesh K. |last2=Manohar |first2=Peter |date=2023 |title=An Exponential Lower Bound for Linear 3-Query Locally Correctable Codes |class=cs.CC |eprint=2311.00558}}</ref><ref>{{Cite book |last1=Kerenidis |first1=Iordanis |last2=de Wolf |first2=Ronald |chapter=Exponential lower bound for 2-query locally decodable codes via a quantum argument |date=2003-06-09 |title=Proceedings of the thirty-fifth annual ACM symposium on Theory of computing |chapter-url=https://dl.acm.org/doi/10.1145/780542.780560 |language=en |publisher=ACM |pages=106–115 |doi=10.1145/780542.780560 |arxiv=quant-ph/0208062 |isbn=978-1-58113-674-6|s2cid=10585919 }}</ref> while LDCs can have [[Subexponential time|subexponential]] lengths.<ref>{{Cite journal |last=Yekhanin |first=Sergey |date=February 2008 |title=Towards 3-query locally decodable codes of subexponential length |url=https://dl.acm.org/doi/10.1145/1326554.1326555 |journal=Journal of the ACM |language=en |volume=55 |issue=1 |pages=1–16 |doi=10.1145/1326554.1326555 |s2cid=14617710 |issn=0004-5411|url-access=subscription }}</ref><ref>{{Cite book |last=Efremenko |first=Klim |chapter=3-query locally decodable codes of subexponential length |date=2009-05-31 |title=Proceedings of the forty-first annual ACM symposium on Theory of computing |chapter-url=https://dl.acm.org/doi/10.1145/1536414.1536422 |journal=[[Journal of the ACM]] |language=en |publisher=ACM |pages=39–44 |doi=10.1145/1536414.1536422 |isbn=978-1-60558-506-2|s2cid=263865692 }}</ref>
 
== Interleaving ==
{{redirect|Interleaver|the fiber-optic device|optical interleaver}}
Interleaving is frequently used in digital communication and storage systems to improve the performance of forward error correcting codes. Many [[communication channel]]s are not memoryless: errors typically occur in [[burst error|burst]]s rather than independently. If the number of errors within a [[code word]] exceeds the error-correcting code's capability, it fails to recover the original code word. Interleaving ameliorates this problem by shuffling source symbols across several code words, thereby creating a more [[Uniform distribution (continuous)|uniform distribution]] of errors.<ref name="turbo-principles">{{cite book|author1=B. Vucetic |author2=J. Yuan |title=Turbo codes: principles and applications|publisher=[[Springer Verlag]]|isbn=978-0-7923-7868-6|year=2000}}</ref> Therefore, interleaving is widely used for [[burst error-correcting code|burst error-correction]].
 
[[File:Interleaving1.png|right|upright=2.25|thumb|A short illustration of the interleaving idea]]
The analysis of modern iterated codes, like [[turbo code]]s and [[LDPC code]]s, typically assumes an independent distribution of errors.<ref>{{cite journal|author=[[Michael Luby|M. Luby]], M. Mitzenmacher, A. Shokrollahi, D. Spielman, V. Stemann|title=Practical Loss-Resilient Codes|journal=Proc. 29th annual [[Association for Computing Machinery]] (ACM) symposium on Theory of computation|year=1997}}</ref> Systems using LDPC codes therefore typically employ additional interleaving across the symbols within a code word.<ref>{{Cite journal|title=Digital Video Broadcast (DVB); Second generation framing structure, channel coding and modulation systems for Broadcasting, Interactive Services, News Gathering and other satellite broadband applications (DVB-S2)|journal=En 302 307|issue=V1.2.1|publisher=[[ETSI]]|date=April 2009|postscript=<!--None-->}}</ref>
 
Interleaving is frequently used in digital communication and storage systems to improve the performance of forward error correcting codes. Many [[communication channel]]s are not memoryless: errors typically occur in [[burst error|burst]]s rather than independently. If the number of errors within a [[Code word (communication)|code word]] exceeds the error-correcting code's capability, it fails to recover the original code word. Interleaving alleviates this problem by shuffling source symbols across several code words, thereby creating a more [[Uniform distribution (continuous)|uniform distribution]] of errors.<ref name="turbo-principles">{{cite book |author-first1=B. |author-last1=Vucetic |author-first2=J. |author-last2=Yuan |title=Turbo codes: principles and applications |publisher=[[Springer Verlag]] |isbn=978-0-7923-7868-6 |date=2000}}</ref> Therefore, interleaving is widely used for [[burst error-correcting code|burst error-correction]].
 
The analysis of modern iterated codes, like [[turbo code]]s and [[LDPC code]]s, typically assumes an independent distribution of errors.<ref>{{cite journal |author-first1=Michael |author-last1=Luby |author-link1=Michael Luby |author-first2=M. |author-last2=Mitzenmacher |author-first3=A. |author-last3=Shokrollahi |author-first4=D. |author-last4=Spielman |author-first5=V. |author-last5=Stemann |title=Practical Loss-Resilient Codes |journal=Proc. 29th Annual Association for Computing Machinery (ACM) Symposium on Theory of Computation |date=1997}}</ref> Systems using LDPC codes therefore typically employ additional interleaving across the symbols within a code word.<ref>{{Cite journal |title=Digital Video Broadcast (DVB); Second generation framing structure, channel coding and modulation systems for Broadcasting, Interactive Services, News Gathering and other satellite broadband applications (DVB-S2) |journal=En 302 307 |issue=V1.2.1 |publisher=[[ETSI]] |date=April 2009}}</ref>
 
For turbo codes, an interleaver is an integral component and its proper design is crucial for good performance.<ref name="turbo-principles"/><ref>{{cite journal|authorfirst1=K. S.|last1=Andrews|first2=D.|last2=Divsalar|first3=S.|last3=Dolinar|first4=J.|last4=Hamkins|first5=C. R.|last5=Jones|first6=F.|last6=Pollara|title=The Development of Turbo and LDPC Codes for Deep-Space Applications|journal=[[Proc.Proceedings of the IEEE]]|volume=95|issue=11|pages=2142–2156|date=November 2007|display-authorsdoi=etal10.1109/JPROC.2007.905132|s2cid=9289140}}</ref> The iterative decoding algorithm works best when there are not short cycles in the [[factor graph]] that represents the decoder; the interleaver is chosen to avoid short cycles.
 
Interleaver designs include:
* rectangular (or uniform) interleavers (similar to the method using skip factors described above)
* convolutional interleavers
* random interleavers (where the interleaver is a known random permutation)
* S-random interleaver (where the interleaver is a known random permutation with the constraint that no input symbols within distance S appear within a distance of S in the output).<ref>{{cite journal|first1=S. |last1=Dolinar and |first2=D. |last2=Divsalar. |title=Weight Distributions for Turbo Codes Using Random and Nonrandom Permutations. 1995. [http://|citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.105.6640&rep|date=rep1&type15 August 1995|pages=pdf]42–122|journal=TDA Progress Report|volume=122|bibcode=1995TDAPR.122...56D}}</ref>
*Another possible construction is a contention-free quadratic [[permutation polynomial]] (QPP).<ref name="Takeshita1">{{cite journal | title=Permutation Polynomial Interleavers: An Algebraic-Geometric Perspective | yeardate=2006 | first1=Oscar | last1= Takeshita | arxiv = cs/0601048 | postscript=<!--None--> | doi=10.1109/TIT.2007.896870 | volume=53 |issue=6 |journal=[[IEEE Transactions on Information Theory]] | pages=2116–2132|bibcode=2006cs........1048T |s2cid=660 }}</ref> ItAn isexample usedof foruse exampleis in the [[3GPP Long Term Evolution]] mobile telecommunication standard.<ref>[http://www.3gpp.org/ftp/Specs/html-info/36212.htm 3GPP TS 36.212], version 8.8.0, page 14</ref>
 
In multi-[[carrier signal|carrier]] communication systems, interleaving across carriers may be employed to provide frequency [[diversity scheme|diversity]], e.g., to mitigate [[frequency-selective fading]] or narrowband interference.<ref>{{Cite journal |title=Digital Video Broadcast (DVB); Frame structure, channel coding and modulation for a second generation digital terrestrial television broadcasting system (DVB-T2) |journal=En 302 755 |issue=V1.1.1 |publisher=[[ETSI]] |date=September 2009|postscript=<!--None-->}}</ref>
 
===Example===
Line 202 ⟶ 164:
Transmission with a burst error: {{not a typo|aaaabbbbccc____deeeeffffgggg}}
 
Here, each group of the same letter represents a 4-bit one-bit error-correcting codeword. The codeword {{not a typo|cccc}} is altered in one bit and can be corrected, but the codeword {{not a typo|dddd}} is altered in three bits, so either it cannot be decoded at all or it might be [[falsing|decoded incorrectly]].
 
'''With interleaving''':
Line 211 ⟶ 173:
Received code words after deinterleaving: {{not a typo|aa_abbbbccccdddde_eef_ffg_gg}}
 
In each of the codewords "{{not a typo|aaaa}}", "{{not a typo|eeee}}", "{{not a typo|ffff}}", and "{{not a typo|gggg}}", only one bit is altered, so one-bit error-correcting code will decode everything correctly.
 
'''Transmission without interleaving''':
Line 218 ⟶ 180:
Received sentence with a burst error: {{not a typo|ThisIs______pleOfInterleaving}}
 
The term "{{not a typo|AnExample}}" ends up mostly unintelligible and difficult to correct.
 
'''With interleaving''':
Line 231 ⟶ 193:
=== Disadvantages of interleaving ===
 
Use of interleaving techniques increases total delay. This is because the entire interleaved block must be received before the packets can be decoded.<ref>{{cite web | title=Explaining Interleaving|author=Techie|date=3 – W3techieJune 2010| publisherwebsite=w3techie.comW3 |Techie Blog|url=http://w3techie.com/2010/explaining-interleaving/ | accessdateaccess-date=2010-06-03 }}</ref> Also interleavers hide the structure of errors; without an interleaver, more advanced decoding algorithms can take advantage of the error structure and achieve more reliable communication than a simpler decoder combined with an interleaver{{Citation needed|date=April 2017}}. An example of such an algorithm is based on [[neural network]]<ref>{{cite journal |last1=Krastanov |first1=Stefan |last2=Jiang |first2=Liang |title=Deep Neural Network Probabilistic Decoder for Stabilizer Codes |journal=Scientific Reports |date=8 September 2017 |volume=7 |issue=1 |page=11003 |doi=10.1038/s41598-017-11266-1 |pmid=28887480 |pmc=5591216 |arxiv=1705.09334 |bibcode=2017NatSR...711003K |doi-access=free }}</ref> structures.
 
== Software for error-correcting codes ==
Line 241 ⟶ 203:
* [https://gitlab.eurecom.fr/oai/openair-cn OpenAir]: implementation (in C) of the 3GPP specifications concerning the Evolved Packet Core Networks.
 
==List of error-correcting codes==-110
 
{| class="wikitable"
Line 251 ⟶ 213:
| 3 (single-error correcting) || [[Triple modular redundancy]]
|-
| 3 (single-error correcting) || perfectPerfect Hamming such as [[Hamming(7,4)]]
|-
| 4 ([[SECDED]]) || Extended Hamming
Line 257 ⟶ 219:
| 5 (double-error correcting) ||
|-
| 6 (double-error correct-/triple error detect) || [[Nordstrom-Robinson code]]
|-
| 7 (three-error correcting) || perfectPerfect [[binary Golay code]]
|-
| 8 (TECFED) || extendedExtended [[binary Golay code]]
|}
* [[AN codes]]
* [[Algebraic geometry code]]
* [[BCH code]], which can be designed to correct any arbitrary number of errors per code block.
* [[Barker code]] used for radar, telemetry, ultra sound, Wifi, DSSS mobile phone networks, GPS etc.
* [[Berger code]]
* [[Constant-weight code]]
Line 272 ⟶ 236:
* [[Group code]]s
* [[Golay code (disambiguation)|Golay code]]s, of which the [[Binary Golay code]] is of practical interest
* [[Binary Goppa code|Goppa code]], used in the [[McEliece cryptosystem]]
* [[Hadamard code]]
* [[Hagelbarger code]]
Line 278 ⟶ 242:
* [[Latin square#Error correcting codes|Latin square based code]] for non-white noise (prevalent for example in broadband over powerlines)
* [[Lexicographic code]]
* [[Linear network coding|Linear Network Coding]], a type of erasure correcting code across networks instead of point-to-point links
* [[Long code (mathematics)|Long code]]
* [[Low-density parity-check code]], also known as [[Gallager code]], as the archetype for [[sparse graph code]]s
* [[LT code]], which is a near-optimal [[Fountain code|rateless erasure correcting code (Fountain code)]]
* [[m of n codes]]
* [[Nordstrom-Robinson code]], used in Geometry and Group Theory<ref>{{Citation |author-first1=A.W. |author-last1=Nordstrom |author-first2=J.P. |author-last2=Robinson |title=An optimum nonlinear code |journal=Information and Control |date=1967 |volume=11 |issue=5–6 |pages=613–616 |doi=10.1016/S0019-9958(67)90835-2 |doi-access=free }}</ref>
* [[Online code]], a near-optimal [[Fountain code|rateless erasure correcting code]]
* [[Polar code (coding theory)]]
Line 289 ⟶ 255:
* [[Repeat-accumulate code]]
* [[Repetition code]]s, such as [[Triple modular redundancy]]
* Spinal code, a rateless, nonlinear code based on pseudo-random hash functions <ref>{{Cite conference |author-first1=Jonathan |author-last1=Perry |author-first2=Hari |author-last2=Balakrishnan |author-first3=Devavrat |author-last3=Shah |title=Rateless Spinal Codes |book-title=Proceedings of the 10th ACM Workshop on Hot Topics in Networks |date=2011 |pages=1–6 |url=http://doi.acm.org/10.1145/2070562.2070568 |doi=10.1145/2070562.2070568|hdl=1721.1/79676 |isbn=9781450310598 |hdl-access=free }}</ref>
first1=Jonathan | last1=Perry |
first2=Hari | last2=Balakrishnan |
first3=Devavrat | last3=Shah |
title = Rateless Spinal Codes |
booktitle = Proceedings of the 10th ACM Workshop on Hot Topics in Networks |
year = 2011 |
url = http://doi.acm.org/10.1145/2070562.2070568 |
doi = 10.1145/2070562.2070568
}}</ref>
* [[Tornado code]], a near-optimal [[erasure code|erasure correcting code]], and the precursor to [[Fountain code]]s
* [[Turbo code]]
* [[Walsh–Hadamard code]]
* [[Cyclic redundancy check]]s (CRCs) can correct 1-bit errors for messages at most <math>2^{n-1}-1</math> bits long for optimal generator polynomials of degree <math>n</math>, see [[{{section link|Mathematics of cyclic redundancy checks#|Bitfilters]]}}
* [[Locally Recoverable Codes]]
* [[Message authentication code]]
 
==See also==
* [[Burst error-correcting code]]
* [[Code rate]]
* [[Erasure code]]s
* [[Soft-decision decoder]]
* [[Error detection and correction]]
* [[Error-correcting codes with feedback]]
* [[Burst error-correctingLinear code]]
* [[Quantum error correction]]
* [[Soft-decision decoder]]
 
==References==
Line 316 ⟶ 277:
 
==Further reading==
* {{cite book |title=The Theory of Error-Correcting Codes |author-first1=Florence Jessiem |author-last1=MacWilliams |author-link1=Florence Jessiem MacWilliams |author-first2=Neil James Alexander |author-last2=Sloane |author-link2=Neil James Alexander Sloane |publisher=[[North-Holland Publishing Company|North-Holland]] / [[Elsevier BV]] |series=North-Holland Mathematical Library |volume=16 |lccn=76-41296 |isbn=978-0-444-85193-2 |edition=digital print of 12th impression, 1st |date=2007 |orig-date=1977 |publication-place=Amsterdam / London / New York / Tokyo |___location=AT&T Shannon Labs, Florham Park, New Jersey, USA}} (xxii+762+6 pages)
*{{cite book |author1=Clark, George C., Jr. |author2=Cain, J. Bibb |title=Error-Correction Coding for Digital Communications |publisher=Plenum Press |___location=New York |year=1981 |isbn=0-306-40615-2 }}
* {{cite book |author-last1=WickerClark, StephenJr. |author-first1=George BC. |author-last2=Cain |author-first2=J. Bibb |title=Error-Correction Control SystemsCoding for Digital Communication and StorageCommunications |publisher=Prentice-Hall[[Plenum Press]] |___location=EnglewoodNew CliffsYork, NJUSA |yeardate=19951981 |isbn=0-13306-20080940615-2 }}
* {{cite book |title=A Commonsense Approach to the Theory of Error Correcting Codes |author-first=Benjamin |author-last=Arazi |editor-first=Herb |editor-last=Swetman |date=1987 |edition=1 |publisher=[[Massachusetts Institute of Technology]] |series=[[MIT Press]] Series in Computer Systems |volume=10 |publication-place=Cambridge, Massachusetts, USA / London, UK |isbn=0-262-01098-4 |lccn=87-21889}} (x+2+208+4 pages)
*{{cite book |author=Wilson, Stephen G. |title=Digital Modulation and Coding |publisher=Prentice-Hall |___location=Englewood Cliffs NJ |year=1996 |isbn=0-13-210071-1 }}
* {{cite book |author-last=Wicker |author-first=Stephen B. |title=Error Control Systems for Digital Communication and Storage |publisher=[[Prentice-Hall]] |___location=Englewood Cliffs, New Jersey, USA |date=1995 |isbn=0-13-200809-2 }}
* [https://web.archive.org/web/20070519161253/http://www.st.com/stonline/products/literature/an/10123.htm "Error Correction Code in Single Level Cell NAND Flash memories"] 16 February 2007
* {{cite book |author-last=Wilson |author-first=Stephen G. |title=Digital Modulation and Coding |publisher=[[Prentice-Hall]] |___location=Englewood Cliffs, New Jersey, USA |date=1996 |isbn=0-13-210071-1 }}
* [http://www.eetasia.com/ARTICLES/2004NOV/A/2004NOV29_MEM_AN10.PDF?SOURCES=DOWNLOAD "Error Correction Code in NAND Flash memories"] 29 November 2004
* [https://web.archive.org/web/20070519161253/http://www.st.com/stonline/products/literature/an/10123.htm "Error Correction Code in Single Level Cell NAND Flash memories"] 2007-02-16
* [http://perspectives.mvdirona.com/2012/02/observations-on-errors-corrections-trust-of-dependent-systems/ Observations on Errors, Corrections, & Trust of Dependent Systems], by James Hamilton, 26 February 2012
* [https://web.archive.org/web/20160304050018/http://www.eetasia.com/ARTICLES/2004NOV/A/2004NOV29_MEM_AN10.PDF?SOURCES=DOWNLOAD "Error Correction Code in NAND Flash memories"] 2004-11-29
* Sphere Packings, Lattices and Groups, By J.H. Conway, N.J.A. Sloane, Springer Science & Business Media, 9 Mar 2013 – Mathematics – 682 pages.
* [http://perspectives.mvdirona.com/2012/02/observations-on-errors-corrections-trust-of-dependent-systems/ Observations on Errors, Corrections, & Trust of Dependent Systems], by James Hamilton, 2012-02-26
* ''[[Sphere Packings, Lattices and Groups]],'' by J. H. Conway, Neil James Alexander Sloane, [[Springer Science & Business Media]], 2013-03-09 – Mathematics – 682 pages.
 
==External links==
* {{Cite web |author-last=Morelos-Zaragoza |author-first=Robert |date=2004 |url=http://www.eccpage.com/ |title=The Correcting Codes (ECC) Page |access-date=2006-03-05}}
*{{Cite web
* [https://errorcorrectionzoo.org/ error correction zoo]. Database of error correcting codes.
| last = Morelos-Zaragoza
* [https://github.com/supermihi/lpdec lpdec: library for LP decoding and related things (Python)]
| first = Robert
| year = 2004
| url = http://www.eccpage.com/
| title = The Correcting Codes (ECC) Page
| accessdate = 2006-03-05
}}
 
[[Category:Error detection and correction]]