0

i'm trying to encode and decode a simple message using Matlab. The message is denoted msg=[1 0 0 1 1 1 0 1]. the encoding step is fruitful but the decoding step " viterbi " return a binary string of zeros '0 0 0 0 0 0 0 0' not the initial msg. Hereafter the code source , i don't knwo where is the problem

trellis = poly2trellis(7,[171 133])
code = convenc(msg,trellis);
decoded = vitdec(code,trellis,64,'cont','hard');

thanks a lot.

t.hicham
  • 45
  • 8

1 Answers1

1

You can try this line instead :

vitdec(code, trellis,8,'trunc','hard')

As in the MATLAB help says : "The 'cont' mode is appropriate when you invoke this function repeatedly and want to preserve continuity between successive invocations." But your input vector is not like this.