简体   繁体   中英

Convolutiona code and viterbi decoding using matlab

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM