logo资料库

matlab以及simulink仿真移动通信实验实验一平坦瑞利衰落信道仿真、实验二 数字调制系统仿真、实验三 CDMA系统RAK....pdf

第1页 / 共9页
第2页 / 共9页
第3页 / 共9页
第4页 / 共9页
第5页 / 共9页
第6页 / 共9页
第7页 / 共9页
第8页 / 共9页
资料共9页,剩余部分请下载后查看
M=9,f_max=60,M=5,f_max=60, 9,20
实验二
Snr=10 Snr=20
实验一:IQ 路信号设置 for n = 1 : M+1 if n <= M c_q(count,n) = 2*sigma*sin(pi*n/M); % c_i(count,n) = 2*sigma*cos(pi*n/M); % f_i(count,n) = f_max*cos(2*pi*n/N); % f_q(count,n) = f_max*cos(2*pi*n/N); % else c_i(count,n) = sqrt(2)*cos(pi/4); c_q(count,n) = sqrt(2)*sin(pi/4); f_i(count,n) = f_max; f_q(count,n) = f_max; end % end if g_i(count,n) = c_i(count,n)*cos(2*pi*f_i(count,n)*(t-t0) + theta); % g_q(count,n) = c_q(count,n)*cos(2*pi*f_q(count,n)*(t-t0) + theta); % end
实验二:16QAM clear all;clc; nsymbol= 100000;%一共有十万个符号 M=16;%阶数,表示16QAM graycode=[0 1 3 2 4 5 7 6 12 13 15 14 8 9 11 10];%格雷映射,十进制表 示 EsN0=5:20;%符号比,单位db snr1=10.^(EsN0/10);%将db转为非线性的方式 msg=randi([0,15],1,nsymbol);%随机产生0-15的符号,乘nsymbol得到原始 数据 msg1=graycode(msg+1);%格雷映射 msgmod=qammod(msg1,M);%调用qammod函数,得到调制后的符号 scatterplot(msgmod);%画出星座点图 grid on set(gca,'FontName','Times New Roman','FontSize',12); set(gca,'linewidth',1.1); spow=norm(msgmod).^2/nsymbol;%a+bj取模的平方,即功率;功率除以整个符 号得到平均功率 for i= 1:length(EsN0) sigma=sqrt(spow/(2*snr1(i))); rx=msgmod+sigma*(randn(1,length(msgmod))+1i*randn(1,length(msgmod))); %星座点图乘以随机长度高斯白噪声 y=qamdemod(rx,M);%转为对应的点 decmsg=graycode(y+1);%格雷逆映射 [err1 ,ber(i)]=biterr(msg,decmsg,log2(M)); [err2,ser(i)]=symerr(msg,decmsg);%比较符号误差 end p4=2*(1-1/sqrt(M))*qfunc(sqrt(3*snr1/(M-1)));%误码率 ser1=1-(1-p4).^2; ber1=1/log2(M)*ser1;%误比特率 figure() %ber仿真值,ser比特仿真值,ber1理论误比特率,ser1理论误码率 semilogy(EsN0,ber,'h','MarkerSize',8,'MarkerFaceColor',[0.93,0.69,0.1 3],'MarkerEdgeColor',[0.93,0.69,0.13]) hold on semilogy(EsN0,ser,'o','MarkerSize',8,'MarkerFaceColor',[0.00,0.45,0.7 4],'MarkerEdgeColor',[0.00,0.45,0.74]) semilogy(EsN0,ser1,'-','linewidth',1.5) semilogy(EsN0,ber1,'-.','linewidth',1.5) title('16QAM') % xlabel('Es/N0');ylabel('SER AND BER'); xlabel('$\frac{E_b}{N_0}(db)$','interpreter','latex', 'FontSize', 18)
分享到:
收藏