Laboratory 2 Error Correction - v4
Laboratory 2 Error Correction - v4
Theory:
In computer science and telecommunication, error detection and correction or error control are
techniques that enable reliable delivery of digital data over unreliable communication channels.
Many communication channels are subject to channel noise, and thus errors may be introduced
during transmission from the source to a receiver. Error detection techniques allow detecting such
errors, while error correction enables reconstruction of the original data in many cases. Basically,
Error Correction can be handled in two ways.
One is when an error is discovered; the receiver can have the sender retransmit the entire
data unit. This is known as backward error correction
In the other, receiver can use an error-correcting code, which automatically corrects
certain errors. This is known as forward error correction.
Error-correcting code (ECC)
An error-correcting code (ECC) or forward error correction (FEC) code is a process of adding
redundant data, or parity data, to a message, such that it can be recovered by a receiver even when
a number of errors (up to the capability of the code being used) were introduced, either during the
process of transmission, or on storage. Since the receiver does not have to ask the sender for
retransmission of the data, a backchannel is not required in forward error correction. Error-
correcting codes are usually distinguished between convolutional codes and block codes:
Convolutional codes are processed on a bit-by-bit basis. They are particularly suitable for
implementation in hardware, and the Viterbi decoder allows optimal decoding.
Block codes are processed on a block-by-block basis. Early examples of block codes are
repetition codes, Hamming codes and multidimensional parity-check codes. They were
followed by a number of efficient codes, Reed–Solomon codes being the most notable due to
their current widespread use. Turbo codes and low-density parity-check codes (LDPC) are
relatively new constructions that can provide almost optimal efficiency.
1
Procedure:
1. Create a MATLAB Simulation for encoding and decoding of a Hamming code as shown
below. The location of the error in the frame produces incorrect location due to wrong line
highlighted here. Replace it with the correct coding line to produce the proper error location.
Submit the corrected MATLAB code file with your report (Two files to be submitted).
This code is for encoding and decoding of a [7,4] Hamming code. The decoder can correct
one error as shown and as the theory states. One error can be placed at any of the 7-bit
locations and corrections made.
2. Introduce a bit error to 4 th bit position of code word and use Hamming code to check for
errors. Consider the dataword as [a3 a2 a1 a0], where a3 , a2 , a1 and a0 are first 4 bits (from
the least significant bit) i.e. converted from the last two digits of your registration number.
Perform the theoretical calculation of the decoder. Simulate this case in Matlab. (include the
Matlab code file in the submission folder and screen-shots in the report.
3. Provide a structure report for this laboratory activity. You must answer all the questions in
this lab sheet.
Note:
1. The report structure must be in the following topic order: Introduction, Procedure,
Results i.e. screenshots of the outputs for the steps, Conclusion, Reference, and appendix
for software codes or screenshots.
2. Submit the report in pdf format and MATLAB file separately at once on the submission
page on the LMS. Submit them as a zipped file.
3. Do not copy the procedure directly from the lab sheet. You need to paraphrase;
otherwise, a greater portion of marks will be reduced.
4. Do not copy others’ reports. If you find for plagiarism, you will be granted with 0 marks.
5. The submission deadline is set on the LMS. 2