• 大小: 7.13MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-09-23
  • 语言: Matlab
  • 标签: matlab  

资源简介

m本代码是matlab代码 LTE的程序

资源截图

代码片段和文件信息

%本程序为LTE系统中咬尾卷积码的住址主程序,程序包括随机比特序列的生成,tailbiting卷积
%编码,QPSK调制映射,AWGN噪声添加,QPSK软解调,TSVA译码算法,误码率及误块率统计。
%LTE中卷积码码率为1/3,仿真中需要设置信息位长度,信噪比和仿真块数。
clear;
clc;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Info_length = 40; % 信息位长度
Eb_N0 = 0:1:5; %dB  比特信噪比(start : step : end)
sim_code_blk_num = 10000; %每个信噪比点仿真的码块数。
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Code_length = Info_length*3; % code length rate=1/3
SNR = Eb_N0+10*log10(2/3); % snr for qpsk rate 1/3
disp(‘LTE tailbiting convolutional code simulation‘);
disp(‘Decoding algorithm: TSVA‘);
disp(‘Modulation: QPSK Code rate: 1/3 Channel: AWGN‘);
for snr_idx = 1:length(SNR)
    total_bit_err_num = 0;
    blk_err_num = 0;
    code_bit_err_num = 0;
    for code_blk_cnt = 1:sim_code_blk_num
        info = randi([01]Info_length1);%低版本matlab如无此函数可用 info = randint(Info_length1);       
        %咬尾卷积编码
        tbcc_code = lte_tbcc_enc(info);        
        %QPSK调制
        tbcc_symb = complex(1-2*tbcc_code(1:2:end)1-2*tbcc_code(2:2:end))/sqrt(2);        
        %AWGN信道
        tbcc_symb = awgn(tbcc_symbSNR(snr_idx));        
        %QPSK软解调
        code_soft = reshape([real(tbcc_symb)imag(tbcc_symb)].‘[]1);      
        %TSVA译码
        dec_bit = lte_tbcc_dec(code_soft);
        %对接收码字硬判决
        code_hard_slice = double(code_soft<0);
        %错误数统计
        bit_err_num = numel(find(info~=dec_bit));
        total_bit_err_num = total_bit_err_num+bit_err_num;
        code_bit_err_num = code_bit_err_num+numel(find(tbcc_code~=code_hard_slice));
        blk_err_num = blk_err_num+double(bit_err_num>0);
    end
    %berbler统计
    ber(snr_idx) = total_bit_err_num/(sim_code_blk_num*Info_length);
    hard_slice_ber(snr_idx) = code_bit_err_num/(sim_code_blk_num*Code_length);
    bler(snr_idx) = blk_err_num/sim_code_blk_num;
    disp([‘Eb/N0=‘num2str(Eb_N0(snr_idx)‘%.2f‘)‘dB   SNR=‘num2str(SNR(snr_idx)‘%.2f‘)‘dB   BER=‘num2str(ber(snr_idx)‘%e‘)...
         ‘   BLER=‘num2str(bler(snr_idx)‘%e‘)]);
    if(ber(snr_idx)<1e-5)
        break;
    end
end
%figure
figure;semilogy(Eb_N0(1:snr_idx)ber(1:snr_idx)‘o-‘Eb_N0(1:snr_idx)bler(1:snr_idx)‘*-‘);grid on;
legend(‘BER‘‘BLER‘);xlabel(‘Eb/N0(dB)‘);
figure;semilogy(SNR(1:snr_idx)ber(1:snr_idx)‘o-‘SNR(1:snr_idx)hard_slice_ber(1:snr_idx)‘*-‘);grid on;
legend(‘BER‘‘Uncoded-BER‘);xlabel(‘SNR(dB)‘);

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件        2630  2014-04-03 21:42  LTE_tailbiting_cc_sim.m
     文件        4099  2014-03-30 21:31  lte_tbcc_dec.m
     文件         570  2014-03-30 18:08  lte_tbcc_enc.m
     目录           0  2014-03-27 22:20  参考文章\
     文件      331060  2014-03-27 22:03  参考文章\Improved sova-based decoding algorithm for tailbiting codes on wireless channels.pdf
     文件     7815075  2014-03-27 21:14  参考文章\LTE信道纠错码原理与实现_连立杰.caj
     文件      560189  2014-03-27 21:11  参考文章\LTE系统中咬尾卷积码的编译码算法仿真及性能分析_陈发堂.pdf

评论

共有 条评论