Professional Documents
Culture Documents
OUTPUT:G =
1
0
0
0
1
0
0
0
1
1
0
1
0
1
1
1
1
0
1
0
1
0
1
1
1
1
0
1
0
0
0
1
0
0
0
1
H =
E =
0
1
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
1
1
0
1
0
1
0
1
1
0
0
0
1
1
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
0
1
0
Syndrome =
0
1
0
1
1
0
0
1
SyndromeError Pattern
0
1
0
1
1
0
0
1
0
0
1
1
0
1
0
1
0
1
1
0
0
0
1
1
0
1
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
0
1
0
syndrome =
0
error =
0
cword =
1
OUTPUT:genmat =
1
0
0
1
0
0
0
0
msg =
1
0
1
0
1
1
parmat =
1
1
0
0
1
0
code =
1
0
1
0
1
1
noisycode =
1
1
1
trt =
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
1
1
1
0
1
0
0
1
1
1
0
1
0
1
0
1
1
1
0
0
1
1
1
1
0
1
0
0
0
1
0
0
0
1
1
0
1
1
1
0
0
0
0
0
1
1
0
1
0
1
1
1
1
0
1
1
1
0
0
0
0
1
0
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
newmsg =
1
1
1
1
1
1
error =
-1
-1
0
err_words =
1
2
1
0
1
1
1
0
Lab-2
%Program to simulate convolutional encoder.
clear all;
clc;
t= poly2trellis([3],[7,5,6]) % Define trellis.
%g1=[111]g2=[101]g3=[110]
msg=[1 0 0 0]
codeword1=convenc(msg,t)%covolutional encoder
noise=randerr(1,12,[2])
ncode = rem(codeword1+noise,2) % Add noise.
tb = 2; % Traceback length for decoding
decoded = vitdec(ncode,t,tb,'trunc','hard') % Decode.
%trunc-initial state of encoder assumed all zero
%hard-code contains binary input values.
OUTPUT:numInputSymbols:
numOutputSymbols:
numStates:
nextStates:
outputs:
2
8
4
[4x2 double]
[4x2 double]
msg =
1
codeword1 =
1
noise =
1
ncode =
0
decoded =
1
OUTPUT:numInputSymbols:
numOutputSymbols:
numStates:
nextStates:
outputs:
2
8
4
[4x2 double]
[4x2 double]
msg =
1
codeword1 =
1
noise =
0
ncode =
1
decoded =
1