Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
50 views6 pages

Interim Report: Ee 413 Digital Communication Systems Project # 3

The document provides an introduction to channel coding and discusses linear block codes. It describes the encoder and decoder processes. The encoder takes binary message blocks and encodes them into codewords using a generator matrix. The decoder receives a codeword with possible errors and calculates the syndrome using a parity check matrix. It then attempts to correct errors in the codeword by flipping bits to make the syndrome equal to zero. The document includes Matlab code for a linear block code encoder and decoder.

Uploaded by

nightsjudge
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views6 pages

Interim Report: Ee 413 Digital Communication Systems Project # 3

The document provides an introduction to channel coding and discusses linear block codes. It describes the encoder and decoder processes. The encoder takes binary message blocks and encodes them into codewords using a generator matrix. The decoder receives a codeword with possible errors and calculates the syndrome using a parity check matrix. It then attempts to correct errors in the codeword by flipping bits to make the syndrome equal to zero. The document includes Matlab code for a linear block code encoder and decoder.

Uploaded by

nightsjudge
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

INTERIM REPORT

EE 413 DIGITAL COMMUNICATION SYSTEMS


Project # 3

Group Members: Filiz Eyili 2007502073


Oğuz İşçimen 2005502027

İZMİR

1
INTRODUCTION
Channel coding deals with error control techniques. If the data at the output of a
communications system has errors that are too frequent for the desired use, the errors can
often be reduced by the use of a number of techniques. Coding permits an increased rate of
information transfer at a fixed error rate, or a reduced error rate for a fixed transfer rate.
Channel Coding;
• The two main categories of channel codes are:
– Block codes a block of k information bits is encoded to give a codeword of n bits
(n > k). For each sequence of k information bits, there is a a distinct codeword of n bits.
Examples of block codes include Hamming Codes and Cyclic Codes. A Cyclic Redundancy
Check (CRC) code can detect any error burst up to the length of the CRC code itself.
– Convolutional Codes the coded sequence of n bits depends not only on the present k
information bits but also on the previous information bits.
• The primary objective of coding is that the decoder can determine if the received
word is a valid codeword, or if it is a codeword which has been corrupted by noise (i.e. detect
one or more errors). Ideally the decoder should be able to decide which codeword was sent
even if the transmitted codeword was corrupted by noise (i.e. error correction).
Linear Block Codes
We assume that the output of an information source is a sequence of binary digits 0 or
1.In block coding, this binary information sequence is segmented into message blocks of fixed
length;each message block,denoted by u,consist of k information digits.There are a total of 2 k
distinct messages.The encoder,according to certain rules,transforms each input message u into
a binary n-tuple v with n>k.This binary n-tuple v is referred to as the code word(or code
vector) of the message u.Therefore, corresponding to the 2k possible messages,there are 2k
code words.This set of 2k code words is called a block code.For a block code to be useful, the
2k code words must be distinct.Therefore, there should be a one-to-one correspondence
between a message u and its code word v.
For a block code with 2k code words and length n, unless it has a certain special
structure,the encoding apparatus would be prohibitively complex for large k and n since it has
to storethe 2k code wordsof length n in a dictionary.Therefore, we must restrict our attention
to block codes that can be mechanized in a practical manner.A desirable structure for a block
code to possess is the linearity.With this structure in a block code, the encoding complexity
will be greatly reduced.

2
Syndrome Decoding
Let C be a code (not necessarily linear) over a field F. Assume that we have a channel
with input and output alphabet F. Assume that v € C is transmitted and that r = v +e is
received. If C = {v1, v2, . . . , vM} is a code with M codewords, the set E of possible error
patterns is;
E = {r − v1, r − v2, . . . , r − vM} = {r − v : v 2 C} = r − C
Given the received vector r, there is a one-to-one correspondence between the possible
error patterns and the codewords, and, in particular, |E| = |C| = M.
When C is a linear code, then, since −C = {−v : v 2 C} = C, we have;
E = r − C = r + C = {r + v : v 2 C}
thus the set of possible error patterns corresponding to the received word r is precisely the
coset r + C of C. To decode, we must examine this coset to find the appropriate error pattern
(for example, the error pattern of least Hamming weight in the coset).
Let C be a linear [n, k] code over a finite field F of size q. Every coset of C has |C| = qk
elements, and these cosets form a disjoint cover of Fn, thus an [n, k] linear code has qn−k cosets
in Fn.
Definition: Let H be a parity-check matrix for C. The syndrome s associated with a
received word r is s = rHT .
Observe that;
s = rHt = (v + e)Ht = vHT + eHT = eHT ,
i.e., the syndrome depends only on the error pattern e and not the transmitted codeword v.
Syndromes and cosets of C are deeply related, as the following theorem shows.
Theorem: Two vectors x, y € Fn yield the same syndrome if and only if they are
elements of the same coset of C.
Proof: Suppose that x and y are elements of the same coset of r + C, i.e. x = r + v and y = r +w
for some codewords v,w € C. We have;
xHT = (r + v)HT = rHT + vHT = rHT ,
and likewise
yHT = (r + w)HT = rHT + wHT = rHT ;
thus, x and y yield the same syndrome.
Conversely, suppose that x and y yield the same syndrome, i.e., xH T = yHT . Then
(x − y)HT = 0, so x − y €C. This means that x − y = v for some v € C, so x = y + v. This shows
that x is an element of the coset y + C, which necessarily also contains y.

3
Since the syndrome determines the coset, and the error pattern must be an element of
the coset, this theorem tells us that the syndrome is a sufficient statistic for determining the
error pattern.
Matlab Codes;
Encoder codes;
function [sonuc]=aencoder(c);
h=[1 0 1 1 1 0 0 0;1 1 1 0 0 1 0 0;
0 1 1 1 0 0 1 0;1 1 0 1 0 0 0 1]; %parity check matrix [PI]

g=[1 0 0 0 1 1 0 1; 0 1 0 0 0 1 1 1 ; %generator matrix [IP']


0 0 1 0 1 1 1 0; 0 0 0 1 1 0 1 1];

sonuc=zeros(1,length(c)*2); %assinging zeros matrixes

v=zeros(1,8);
u=zeros(1,4);

sayac=length(c)/4; %counter for loop

flz=1; %initial value to divide


signal 4 element by 4 element
ouz=1; %initial value to divide
signal 8 element by 8 element

for syc=1:sayac

u=c(flz:flz+3); %divide signal 4 element by


4 element

v=mod(u*g,2); %make the results in binary


system
sonuc(ouz:ouz+7)=v; %divide signal 4 element by
4 element

flz=flz+4;
ouz=ouz+7;

end

Decoder codes;
function [cikis]=adecoder(giris)
h=[1 0 1 1 1 0 0 0;1 1 1 0 0 1 0 0;
0 1 1 1 0 0 1 0;1 1 0 1 0 0 0 1]; %parity check matrix

u=zeros(1,8);
v=zeros(1,4);
cikis=zeros(1,length(giris)/2);
a=1;
b=1;
for nmb=1:length(giris)/8

u=giris(a:a+7); %divide signal 8 by 8

4
v=mod(h*u',2); %make the product as binary.
result is syndrome matrix

m=0;
if v(1:4)==0
m=1;
cikis(b:b+3)=u(1:4);
end

if v(1)==1&&v(2)==1&&v(3)==0&&v(4)==1
m=1;
if u(1)==1
u(1)=0;
else
u(1)=1;
end
cikis(b:b+3)=u(1:4);
end

if v(1)==0&&v(2)==1&&v(3)==1&&v(4)==1
m=1;
if u(2)==1
u(2)=0;
else
u(2)=1;
end
cikis(b:b+3)=u(1:4);
end

if v(1)==1&&v(2)==1&&v(3)==1&&v(4)==0
m=1;
if u(3)==1
u(3)=0;
else
u(3)=1;
end
cikis(b:b+3)=u(1:4);
end

if v(1)==1&&v(2)==0&&v(3)==1&&v(4)==1
m=1;
if u(4)==1
u(4)=0;
else
u(4)=1;
end
cikis(b:b+3)=u(1:4);
end

if m==0
cikis(b:b+3)=u(1:4);
end

a=a+7;
b=b+4;
end

5
Results;

You might also like