In telecommunication, information theory, and coding theory, forward error correction ( FEC) or channel coding is a technique used for error control in data transmission over unreliable or noisy communication channels. The central idea is the sender encodes the message in a redundant way by using an errorcorrecting code (ECC). The American mathematician Richard Hamming pioneered this field in the 1940s and invented the first errorcorrecting code in 1950: the Hamming (7,4) code.
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. FEC 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. FEC is therefore applied in situations where retransmissions are costly or impossible, such as oneway 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. FEC information is usually added to mass storage devices to enable recovery of corrupted data, is widely used in , and is used on systems where the primary memory is ECC memory.
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 analogtodigital conversion in the receiver. The Viterbi decoder implements a softdecision algorithm to demodulate digital data from an analog signal corrupted by noise. Many FEC coders can also generate a biterror rate (BER) signal which can be used as feedback to finetune the analog receiving electronics.
The maximum fractions of errors or of missing bits that can be corrected is determined by the design of the FEC 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 bitrate while improving the received effective signaltonoise ratio. The noisychannel coding theorem of Claude Shannon answers the question of how much bandwidth is left for data communication while using the most efficient code that turns the decoding 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. Fortunately, after years of research, some advanced FEC systems nowadays come very close to the theoretical maximum.
A simplistic example of FEC is to transmit each data bit 3 times, which is known as a (3,1) repetition code. Through a noisy channel, a receiver might see 8 versions of the output, see table below.
000  0 (error free) 
001  0 
010  0 
100  0 
111  1 (error free) 
110  1 
101  1 
011  1 
Most telecommunication systems use a fixed channel code designed to tolerate the expected worstcase 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 repeatrequest use a fixed FEC method as long as the FEC can handle the error rate, then switch to ARQ when the error rate gets too high; adaptive modulation and coding uses a variety of FEC rates, adding more errorcorrection bits per packet when there are higher error rates in the channel, or taking them out when they are not needed.
There are many types of block codes, but among the classical ones the most notable is ReedSolomon coding because of its widespread use in , , and hard disk drives. Other examples of classical block codes include Golay, BCH code, Multidimensional parity, and .
Hamming ECC is commonly used to correct NAND flash memory errors. "Hamming codes for NAND flash memory devices". EE TimesAsia. Apparently based on "Micron Technical Note TN2908: Hamming Codes for NAND Flash Memory Devices". 2005. Both say: "The Hamming algorithm is an industryaccepted method for error detection and correction in many SLC NAND flashbased applications." This provides singlebit error correction and 2bit error detection. Hamming codes are only suitable for more reliable single level cell (SLC) NAND. Denser multi level cell (MLC) NAND requires stronger multibit correcting ECC such as BCH or Reed–Solomon. "What Types of ECC Should Be Used on Flash Memory?". (Spansion application note). 2011. says: "Both ReedSolomon 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 ReedSolomon and BCH are able to handle multiple errors and are widely used on MLC flash." Jim Cooke. "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."
NOR Flash typically does not use any error correction.
Classical block codes are usually decoded using harddecision algorithms, 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 softdecision algorithms like the Viterbi, MAP or BCJR algorithm algorithms, which process (discretized) analog signals, and which allow for much higher errorcorrection performance than harddecision decoding.
Nearly all classical block codes apply the algebraic properties of . Hence classical block codes are often referred to as algebraic codes.
In contrast to classical block codes that often specify an errordetecting or errorcorrecting 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 bitflips, but not bitinsertions or bitdeletions. 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 bitinsertions and bitdeletions, 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.
Interestingly, 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. In one extreme, a strong code (with low coderate) can induce an important increase in the receiver SNR decreasing the bit error rate, at the cost of reducing the effective data rate. On the other extreme, not using any FEC (i.e. a coderate 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 a FEC 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 FEC whose error rate tends to zero:C. E. Shannon: A mathematical theory of communication. Bell System Technical Journal, vol. 27, pp. 379–423 and 623–656, July and October 1948. His proof, unfortunately, relies on Gaussian random coding, which is not suitable of realworld applications. This upper bound given by Shannon's work set up a long journey in designing FECs that can go close to the ultimate performance boundary. Various codes today can attain almost the Shannon limit. However, capacity achieving FECs are usually extremely complex to implement.
The most popular codes FECs have a trade performance and computational complexity. Usually their parameters give a range of possible code rates, which can be optimized depending of the scenario. Usually, this optimization is done in order to achieve a low decoding error probability without hurting too much the data rate. Another criteria for optimizing the code rate is to balance low error rate and retransmissions number in order to the energy cost of the communication .
Concatenated codes have been standard practice in satellite and deep space communications since Voyager program first used the technique in its 1986 encounter with Uranus. The Galileo craft used iterative concatenated codes to compensate for the very high error rate conditions caused by having a failed antenna.
LDPC codes were first introduced by Robert G. Gallager in his PhD thesis in 1960, but due to the computational effort in implementing encoder and decoder and the introduction of Reed–Solomon codes, they were mostly ignored until recently.
LDPC codes are now used in many recent highspeed communication standards, such as DVBS2 (Digital video broadcasting), WiMAX (IEEE 802.16e standard for microwave communications), HighSpeed Wireless LAN (IEEE 802.11n),IEEE Standard, section 20.3.11.6 "802.11n2009", IEEE, October 29, 2009, accessed March 21, 2011. 10GBaseT Ethernet (802.3an) and G.hn/G.9960 (ITUT 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 codes).
One of the earliest commercial applications of turbo coding was the CDMA2000 1x (TIA IS2000) digital cellular technology developed by Qualcomm and sold by Verizon Wireless, Sprint Nextel, and other carriers. It is also used for the evolution of CDMA2000 1x specifically for Internet access, 1xEVDO (TIA IS856). Like 1x, EVDO was developed by Qualcomm, and is sold by Verizon Wireless, Sprint Nextel, and other carriers (Verizon's marketing name for 1xEVDO is Broadband Access, Sprint's consumer and business marketing names for 1xEVDO are Power Vision and Mobile Broadband, respectively).
Locally decodable codes are errorcorrecting 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 codes are errorcorrecting 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.
The analysis of modern iterated codes, like and , typically assumes an independent distribution of errors. Systems using LDPC codes therefore typically employ additional interleaving across the symbols within a code word.
For turbo codes, an interleaver is an integral component and its proper design is crucial for good performance. 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:
In multicarrier signal communication systems, interleaving across carriers may be employed to provide frequency diversity scheme, e.g., to mitigate frequencyselective fading or narrowband interference.
Errorfree message: aaaabbbbccccddddeeeeffffgggg Transmission with a burst error: aaaabbbbccc____deeeeffffgggg
Here, each group of the same letter represents a 4bit onebit errorcorrecting codeword. The codeword cccc is altered in one bit and can be corrected, but the codeword dddd is altered in three bits, so either it cannot be decoded at all or it might be falsing.
With interleaving:
Errorfree code words: aaaabbbbccccddddeeeeffffgggg Interleaved: abcdefgabcdefgabcdefgabcdefg Transmission with a burst error: abcdefgabcd____bcdefgabcdefg Received code words after deinterleaving: aa_abbbbccccdddde_eef_ffg_gg
In each of the codewords aaaa, eeee, ffff, gggg, only one bit is altered, so onebit errorcorrecting code will decode everything correctly.
Transmission without interleaving:
Original transmitted sentence: ThisIsAnExampleOfInterleaving Received sentence with a burst error: ThisIs______pleOfInterleaving
The term "AnExample" ends up mostly unintelligible and difficult to correct.
With interleaving:
Transmitted sentence: ThisIsAnExampleOfInterleaving... Errorfree transmission: TIEpfeaghsxlIrv.iAaenli.snmOten. Received sentence with a burst error: TIEpfe______Irv.iAaenli.snmOten. Received sentence after deinterleaving: T_isI_AnE_amp_eOfInterle_vin_...
No word is completely lost and the missing letters can be recovered with minimal guesswork.
In this context, there are various available Opensource software listed below (non exhaustive).
Parity 
Triple modular redundancy 
perfect Hamming such as Hamming(7,4) 
Extended Hamming 
perfect binary Golay code 
extended binary Golay code 

