既然讲到了2bit差分解调,那就展示一下仿真程序吧!本课题的内容非常多,希望大家能够在学习程序的同时结合相关资料,这样有助于理解!后面文章也会上传资料到网盘,现在还在整理中,整理完成后就在文章中给出下载链接!这个系列的文章已经写了三篇,本人明显感觉精力不济,需要休息一下,后续再写涉及到仿真程序的文章!
不断修订程序!
力求深入浅出!
当然也在不断的增加注释!
%%****************** 程序主体 ***********************%%
format long;
%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%% %%%%%%
%%%%%%%%%% 仿真参数部分 %%%%%%%%%
%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%
%******************** Preparation part *******************
sr = 16000; % Symbol rate
frame_len = 3; % subframe number,实际只测试第2帧
br = sr; % Bit rate
frame_sumbitlen = 384 ; % 每时隙总bit数
slot_FB_BKN2_bitlen = 156; % 时隙FB编码后的载荷bit数
IPOINT = 4;
% Number of oversamples after AGC
lp_bp = 0.25; % 低通滤波器带宽
lp1_bp = 0.5;
% 仿真结果表明在有频偏的情况下:0.25时效果最好 !
% 这比8倍采样时设置的0.06稍大,从解调的误码性能来说差异不大,但译码性能存在差异。
EbNoLise = 9:16;
%******************** START CALCULATION ***************************
nloop = 1000; % Number of simulation loops
freoffset = 0; % Fixed frequency offset
frephase_idx = 0;
phaoffset = frephase_idx*pi;
fresample = IPOINT*sr;
%************************* Filter initialization **************************
tra_coef = 0.3;
%************************* Data generation *****************************
%%% 信号源
% 发送数据
data_cpu = randi([0 1],frame_len,slot_FB_BKN2_bitlen*2); % 来自CPU的数据
%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%% %%%%%%%%%%%%%
%%%%%%%%%%%%%%%% 调制器部分 %%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%% %%%%%%%%%%%%%%
%%%%%% 调制器DSP部分 %%%%%%%%%
%************************* signal frame generate *********************
% bit reverse
data_code = 2*data_cpu - 1;
%%% 同步序列
qa_NB = 2*[ 1,0,1,0,1,1,0,1,1,1 ] - 1; % 10 bit for NB
%%% 训练序列
pd_NB = 2*[ 1,1,1,0,1,1,0,1,0,1,1,0,0,1,1,0,0,0,0,0] - 1; % 20 bit for NB
len_pd_NB = 20;
%%% 同步序列
qb_NB = 2*[ 0,0,0,0,0,1,1,0,0,1 ] - 1; % 10 bit for NB
%%% 数据组BBK
BBK_NB = 2*randi([0 1],1,32) - 1;
% 组帧规则
for i = 1:frame_len
infloop((i-1)*frame_sumbitlen+1:i*frame_sumbitlen) = [qa_NB data_code(i,1:slot_FB_BKN2_bitlen) BBK_NB(1:16) pd_NB BBK_NB(17:32) data_code(i,slot_FB_BKN2_bitlen+1:end) qb_NB];
infor_loop(i,:) = infloop((i-1)*frame_sumbitlen+1:i*frame_sumbitlen);
end
%%% 信号组帧
information = infloop;
%%% 差分编码
% 和1bit差分解调的差异之处!!!
编辑:jq
全部0条评论
快来发表一下你的评论吧 !