# Implementation Viterbi decoder - soft decision - by matlab blocklist functions

#### JimmyCho

Joined Aug 1, 2020
49
i'm trying to encode (k=7,r=1/2) and decode (Viterbi decoder) a simple message using Matlab , Im trying to implement in matlab viterbi decoder with k=7 , r=1/2 . so I coded message which it's [0 0 1] in the encoder k=7 , r=1/2 . so the output of the encoder I entered it to my viterbi decoder that I decoded but the decoded message isn't the same as input message , it means the decoded message should be the same as [0 0 1]. my code in matlab is:
Code:
msg=[1 1 0]; %input
constlen = 7;
codegen = [171, 133]; % G1=171 , G2=133. this is parameters for k=7 , r=1/2 .
trellis = poly2trellis(constlen, codegen);
coded=convenc(msg,trellis);
ViterbiDecoderMsg=vitdec(coded, trellis, length(msg),'cont','soft',1);
the output (decoded message) isn't the same input message, it means that my viterbi decoder isn't properly working and my decoded message is wrong. any help please how do I update/fix my code in matlab in order to get correct decoded message as the input message? Im using soft decision viterbi decoder , the encoder output that Im trying to do is having to output (the output of the encoder is two bits).

thanks alot for any assistance.