Docsity

Hamming and Convolution Codes-Digital Communications-Lab Handout, Exercises of Digital Communication Systems

Toggle sidebar
bg1
HAMMING & CONVOLUTIONAL CODES IN SIMULINK
Hamming codes
Forward Error Correction (FEC), the ability of receiving station to correct a
transmission error, can increase the throughput of a data link operating in a noisy
environment. The transmitting station must append information to the data in the form of
error correction bits. Hamming codes provide for FEC using a "block parity”
mechanism that can be inexpensively implemented. In general, their use allows the
correction of single bit errors and detection of two bit errors per unit data, called a code
word.
Simulink Example
Channel Before Encoding
Channel After Encoding
The Error rate has been decreased by approx. 10%
docsity.com
pf3
pf4
pf5

Partial preview of the text

Download Hamming and Convolution Codes-Digital Communications-Lab Handout and more Exercises Digital Communication Systems in PDF only on Docsity!

HAMMING & CONVOLUTIONAL CODES IN SIMULINK

Hamming codes

Forward Error Correction (FEC), the ability of receiving station to correct a transmission error, can increase the throughput of a data link operating in a noisy environment. The transmitting station must append information to the data in the form of error correction bits. Hamming codes provide for FEC using a "block parity” mechanism that can be inexpensively implemented. In general, their use allows the correction of single bit errors and detection of two bit errors per unit data, called a code word.

Simulink Example

Channel Before Encoding

Channel After Encoding

The Error rate has been decreased by approx. 10%

Drawback of Hamming codes

ƒ Major disadvantage is that hamming codes detect and correct only single bit error.

ƒ Hamming codes can only detect double bit error but cannot correct it.

Convolutional Codes

Convolutional codes are commonly specified by three parameters; ( n,k,m ).

n = number of output bits k = number of input bits m = number of memory registers

The quantity k/n called the code rate, is a measure of the efficiency of the code. Commonly k and n parameters range from 1 to 8, m from 2 to 10 and the code rate from 1/8 to 7/8 except for deep space applications where code rates as low as 1/100 or even longer have been employed.

Often the manufacturers of convolutional code chips specify the code by parameters ( n,k, L), The quantity L is called the constraint length of the code and is defined by

Constraint Length, L = k (m- 1 )

The constraint length L represents the number of bits in the encoder memory that affect the generation of the n output bits. The constraint length L is also referred to by the capital letter K, which can be confusing with the lower case k , which represents the number of input bits. In some books K (Matlab) is defined as equal to product the of k and m. Often in commercial spec, the codes are specified by (r, K), where r = the code rate k/n and K is the constraint length.

Information source

Convolutional Encoder

Modulate

AWGN Channel

Convolutional Demodulate Decoder

Information Sink

Typical Communication System

Matlab Simulation

Simulink

Block Used are as follows:

Bernoulli Generator : (Parameters)

ƒ Probability of Zero= 0.5 (means that in the output of the Bernoulli generator zeros and ones are equally likely). ƒ Initial Seed= 61. (Generate prime numbers for use as random number seeds.)

Convolutional Encoder ƒ The Convolutional Encoder block encodes a sequence of binary input vectors to produce a sequence of binary output vectors. ƒ The poly2trellis function accepts a polynomial description of a convolutional encoder and returns the corresponding trellis structure description. ƒ Example poly2trellis(7,[171 133]) Where 7 is the constraint length, and [177 133] are the octal representation of the generator polynomial.

AWGN Channel

ƒ The AWGN Channel block adds white Gaussian noise to a real or complex input signal. When the input signal is real, this block adds real Gaussian noise and produces a real output signal. When the input signal is complex, this block adds complex Gaussian noise and produces a complex output signal. This block inherits its sample time from the input signal. Following are the parameters.

ƒ Initial seed: The seed for the Gaussian noise generator.

ƒ Mode: The mode by which you specify the noise variance: Signal to noise ratio (Es/No), Signal to noise ratio (SNR), Variance from mask, or Variance from port.

ƒ Es/No (dB) : The ratio of signal energy per symbol to noise power spectral density, in decibels. This field appears only if Mode is set to Es/No.

ƒ SNR (dB): The ratio of signal power to noise power, in decibels. This field appears only if Mode is set to SNR.

ƒ Input signal power (watts) : The root mean square power of the input symbols (if Mode is Es/No) or input samples (if Mode is SNR), in watts. This field appears only if Mode is set to either Es/No or SNR.

ƒ Symbol period (s) : The duration of a channel symbol, in seconds. This field appears only if Mode is set to Es/No.

ƒ Variance : The variance of the white Gaussian noise. This field appears only if Mode is set to Variance from mask.

Viterbi Decoder

ƒ Decodes the vector code using the Viterbi algorithm. Code is assumed to be the output of a Convolutional encoder specified by the MATLAB structure TRELLIS .(Note! Same trellis is being used for both encoder/decoder). Following are its parameters.

ƒ Poly2trellis(7,[171 133]) same as for encoder.

ƒ Decision type: (Hard Decision)

ƒ Traceback depth/length: The decoder traces back from the state with the best metric. A delay equal to TBLEN symbols is incurred. The Traceback depth parameter in the Viterbi Decoder block represents the length of the decoding delay. Typically, traceback depth is about five or six times the constraint length.

ƒ Operation mode: (Continuous) The encoder is assumed to have started at the all-zeros state. The decoder traces back from the state with the best metric.

Results (Note! Results will be different every time because of the random noise of the channel)