資源簡介
matlab下使用bsc信道仿真2/3碼率的卷積碼的誤碼率的代碼。
代碼片段和文件信息
clc;
close?all;
????
%基帶信號
codeRate?=?2/3;
traceBack?=?15;
num_baseband?=?100000000;
num_baseband_fec?=?num_baseband?/?codeRate;
%test?para
times?=?200;
err_probability_step?=?0.001;
recive_codeword_1?=?zeros(num_baseband_fec1);
recive_codeword_2?=?zeros(num_baseband_fec1);
ber_1?=?zeros(times1);
ber_2?=?zeros(times1);
err_ratio_1?=?zeros(times1);
err_ratio_2?=?zeros(times1);
err_probability?=?(0:err_probability_step:(times?-?1)?*?err_probability_step);
data_ori?=?randi([0?1]num_baseband1);
tPoly_1?=?poly2trellis([3?3][7?2?5;?6?5?1]);
tPoly_2?=?poly2trellis([3?3][7?1?4;?2?5?7]);
hVitDec_1?=?comm.ViterbiDecoder(tPoly_1?‘InputFormat‘‘hard‘?‘TracebackDepth‘...
????traceBack?‘TerminationMethod‘?‘Truncated‘);
hVitDec_2?=?comm.ViterbiDecoder(tPoly_2?‘InputFormat‘‘hard‘?‘TracebackDepth‘...
????traceBack?‘TerminationMethod‘?‘Truncated‘);
%?codeword_1?=?hEnc_1(data_ori);
%?codeword_2?=?hEnc_2(data_ori);
評論
共有 條評論