一流程图:
TB/CB + CRC+turbo编码+速率匹配+BPSK调制+AWGN高斯白噪声+BPSK解调+速率解匹配+turbo译码(两种方式)+CRC+误码率曲线。
二。
%****************************************************************
clc;
clear all;
close all;
%系统参数设计------------------------------
(1)R = 1/3 ;%码率---rate=1/3,rate=1/2
(2)TurboIter = 8;%Turbo迭代次数,(2-8) interation_number
(3)SourceBitlen = 512;%1024;%256;%688;%输入源比特长度 frame_size
(4)decodermethod = 1; % 1 logMap , 2 max-log-map
sim_framernum = 1000;%越大越好,但是速度仿真速度会越慢,
SNR = -4.5 : 0.1 : -3;% -4;%0:0.1:2;%信噪比序列 -4.5 : 0.1 : -3
BerEbNo = zeros(1,length(SNR));
for nEN=1:length(SNR)
Err_counter = 0;
for nframe=1:sim_framernum
%输入源比特序列基带信号--------------------
SourceBit = 。。。。。。。。。。。。。。;
%Turbo编码--------------------------------
TurboInterTable = [256,15,32;512,31,64;688,21,86;1024,31,64;1344,211,252;2624,27,164;3904,363,244;5184,31,96];
。。。。
。。。。
RefLen = TurboInterTable(k,1);
F1 = TurboInterTable(k,2);
F2 = TurboInterTable(k,3);
Turbo_outzc = TurboEncode(S。。。。。。。);
%调整Turbo编码速率-R---包括算法:速率匹配删余复用,子块交织-----
OutLen = length(SourceBit)/R ;
Turbo_out = rateMatching(Turbo_outzc,OutLen,1);
%BPSK调制---------------------------------
Turbo_out1 = 。。。。。。。。。;
Turbo_out2 = modulation(Turbo_out1,1);
%高斯白噪声信道----------------------
soft_in = awgn(。。。。。。);
%BPSK解调---------------------------
soft_in1 = demodulation(soft_in,1)';
%Rate matching----------------------
soft_inxx = soft_in1' ;
soft_in2 = rateDeMatching(。。。。。。);
%Turbo译码--------------------------
[hard_out,soft_out] = TurboDecode(soft_。。。。。,decodermethod);
%误码率-----------------------------
。。。。。。。
Ber = E。。。;
end
BerEbNo(nEN) = Ber;
fprintf('EcNo:%1.2fdB,误码率:%8.4e,\n',SNR(nEN),Ber);
end
。。。。
。。。。
。。。。
title('Turbo性能仿真误码率曲线');
[ 相应MATLAB仿真代码,C语言代码。咨询qq:1279682290 ]