www.pudn.com > matlab.rar > cnv_main.m, change:2015-04-19,size:563b


clc; 
clear; 
msg = [0 1 1 0 1]; 
G = [1 1 1 1 0 0 1;1 0 1 1 0 1 1]; 
k = 1; 
right_channel_output = cnv_encd(msg); 
%[channel_output,decoder_output,survivor_state,cumulated_metric]=viterbi(G,k,right_channel_output); 
[code,channel_output,survivor_state,cumulated_metric]=viterbi(G,k,right_channel_output); 
 
disp('输入信息序列:') 
pause 
msg 
disp('编码输出序列(发送序列):') 
pause 
right_channel_output 
disp('接收序列') 
pause 
 channel_output 
 disp('汉明距离') 
 pause 
 cumulated_metric 
 disp('译码序列') 
 pause 
code