Exp 5 DIGCOLA
Exp 5 DIGCOLA
I. Objectives
II. Discussions
This experiment discusses Error Correction and some of its applications that may be used
for error correcting.
Error correction is the process of correcting errors in a block of data that was detected
during the transmission. Data transmission is always subjected to corruption as it passes through
noisy channels. So, to avoid unwanted noisy signals, it is very important to undergo error
detection and correction. Two techniques to be used in this experiment to imply error correction
is the Convolution and the hamming code.
Mainly, the blocks used for convolution is Convolutional encoder and Viterbi decoder. A
convolutional encoder converts an entire data sequence to produce a code sequence of binary
vectors by using multiplexing procedures and convolution. It is defined by a poly2trellis function
to generate the corresponding trellis structure mask parameter such as the constraint length, code
generator and feedback connection. The Viterbi block decodes convolutionally encoded data to
produce binary output symbols. It uses Viterbi algorithm that provides an efficient way of
finding the most likely sequence for a faster performance.
Hamming Code, on the other hand, are a family of linear error correction that take a
broad view of the [7,4] Hamming code. Hamming codes are perfect codes that they can achieve
the highest possible rate for codes with their block length and minimum distance of three.
Hamming encoder block encrypts the data before it is sent through the channel and decrypt it
through the hamming decoder block. The encoder uses a default hamming code [7,4], which is a
translation of a length of 4 into code words of length 7.
III. Procedures
A. Convolutional Encoder
1. Open MATLAB Simulink and construct a new model.
2. Open Simulink Library Browser.
3. Drag and drop the following blocks (use the search tab for convenience)
a. Bernoulli Binary Generator
b. Convolutional Encoder
c. Viterbi Decoder
d. Binary Symmetric Channel
e. Error Rate Calculation
f. Display
g. Relational Operator
h. Scope
i. (x2) Unbuffer
4. Double click the Bernoulli Binary Generator and change the following settings:
a. Probability of a zero to 1
b. Initial seed to any integer
c. Sample time to 1
d. Activate the Frame-based outputs check box
e. Samples per frame to 2
f. Output data type to double
5. Double click the Convolutional Encoder module and change the following settings:
a. Trellis structure to poly2trellis([5 4],[23 35 0; 0 5 13]).
6. Double click the Binary Symmetric Channel module and change the following settings:
a. Error probability to 0.02
b. Initial seed to any integer
c. Activate Output error vector check box
d. Output data type to double
7. Double click the Viterbi Decoder module and change the following settings:
a. Trellis structure to poly2trellis([5 4],[23 35 0; 0 5 13]).
b. Decision type to Hard decision
c. Traceback depth to 34
8. Double click the Error Rate Calculation module and change the following settings:
a. Receive delay to 68.
b. Output data to Port.
c. You may or may not Activate Stop Simulation checkbox.
9. Double click the Relational Operator module and change the following settings:
a. Relational operator to ~=
b. Activate Enable zero-crossing detection
10. Double click the Scope module and click the Settings button on the toolbar.
a. Change The Number of axes to 2
b. Set time range to 5000
c. Set Limit data points to last to 30000
d. Click OK
e. Configure the axes by right-clicking the vertical axis and click Axes Properties
i. Set Y-min to -1
ii. Set Y-max to 2
11. Connect all the blocks as shown in Figure 1
12. Set the Simulation Stop time to 10000 before running the simulation
B. Hamming Code
1. Create New Model
2. Open Simulink Library Browser.
3. Drag and drop the following blocks (use the search tab for convenience)
a. Bernoulli Binary Generator
b. Hamming Encoder
c. Hamming Decoder
d. Binary Symmetric Channel
e. Error Rate Calculation
f. Display
g. Relational Operator
h. Scope
i. (x2) Unbuffer
4. Double click the Bernoulli Binary Generator and change the following settings:
a. Probability of a zero to 0.5.
b. Initial seed to any integer
c. Sample time to 1.
d. Activate the Frame-based outputs check box
e. Samples per frame to 4
f. Output data type to double
5. Double click the Relational Operator module and change the following settings:
a. Relational operator to ~=
b. Activate Enable zero-crossing detection
c. Sample time to 1
6. Repeat the settings of other blocks from Convolutional encoder.
7. Connect all the blocks as shown in Figure 2
8. Set the Simulation Stop time to 10000 before running the simulation
9. Note the output shown on the Display block
10. Remove the encoder and decoder then simulate
11. Compare results.