MATLAB Answers

Jared
0

Convolutional Coding/Decoding Using Matlab Functions

Asked by Jared
on 3 Dec 2012
Latest activity Edited by Walter Roberson
on 14 Nov 2015

I'm trying to perform convolutional coding/decoding using built in Matlab functions. I'm trying to implement (2,1,3) code.

K=3;
G1=7;
G2=5;
msg=[1 1 0 0 1 0];
trel=poly2trellis(K,[G1 G2]);
coded=convenc(msg,trel);
decoded=vitdec(coded,trel,5*K,'cont','hard');
coded=[1 1 0 1 0 1 1 1 1 1 1 0]
decoded=[0 0 0 0 0 0]

As you would expect, the decoded message should be the same as msg, which it is not. I don't see where I have gone wrong in this simple example.

  1 Comment

use the following :

K=3;
G1=7;
G2=5;
msg=[1 1 0 0 1 0]
trel=poly2trellis(K,[G1 G2]);
coded=convenc(msg,trel);
tblen = length(msg);
decoded=vitdec(coded,trel,tblen,'trunc','hard')

Products

No products are associated with this question.

0 Answers

Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!