16QAM理论误码率与实际误码率MATLAB仿真程序.docx

上传人:飞****2 文档编号:15105751 上传时间:2022-05-11 格式:DOCX 页数:4 大小:13.71KB
返回 下载 相关 举报
16QAM理论误码率与实际误码率MATLAB仿真程序.docx_第1页
第1页 / 共4页
16QAM理论误码率与实际误码率MATLAB仿真程序.docx_第2页
第2页 / 共4页
点击查看更多>>
资源描述

《16QAM理论误码率与实际误码率MATLAB仿真程序.docx》由会员分享,可在线阅读,更多相关《16QAM理论误码率与实际误码率MATLAB仿真程序.docx(4页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。

1、精选优质文档-倾情为你奉上%16QAM%等效基带调制clc;clear all;close all;%关闭所有窗口,比如之前画的图nsymbol = 10000;%每种信噪比下符号数的发送符号数,106个数errornumber = zeros(1,10);errorratio = zeros(1,10);data = randi(0,1,1,4*nsymbol);%产生1行,4*nsymbol列均匀分布的随机数data_mod1 = zeros(1,nsymbol);%各参量初始化data_mod2 = zeros(1,nsymbol);data_demod1 = zeros(1,nsymb

2、ol);data_demod2 = zeros(1,nsymbol);data_demod3 = zeros(1,nsymbol);data_demod4 = zeros(1,nsymbol);s_receive1 = zeros(1,nsymbol);s_receive2 = zeros(1,nsymbol);for i = 1:nsymbol %格雷码调制到星座图的映射 if data(4*i-3)=0 & data(4*i-2)=0 data_mod1(i) = 3; if data(4*i-1)=0 & data(4*i)=0 data_mod2(i) = 3; elseif data

3、(4*i-1)=0 & data(4*i)=1 data_mod2(i) = 1; elseif data(4*i-1)=1 & data(4*i)=1 data_mod2(i) = -1; elseif data(4*i-1)=1 & data(4*i)=0 data_mod2(i) = -3; end elseif data(4*i-3)=0 & data(4*i-2)=1 data_mod1(i) = 1; if data(4*i-1)=0 & data(4*i)=0 data_mod2(i) = 3; elseif data(4*i-1)=0 & data(4*i)=1 data_mo

4、d2(i) = 1; elseif data(4*i-1)=1 & data(4*i)=1 data_mod2(i) = -1; elseif data(4*i-1)=1 & data(4*i)=0 data_mod2(i) = -3; end elseif data(4*i-3)=1 & data(4*i-2)=1 data_mod1(i) = -1; if data(4*i-1)=0 & data(4*i)=0 data_mod2(i) = 3; elseif data(4*i-1)=0 & data(4*i)=1 data_mod2(i) = 1; elseif data(4*i-1)=

5、1 & data(4*i)=1 data_mod2(i) = -1; elseif data(4*i-1)=1 & data(4*i)=0 data_mod2(i) = -3; end elseif data(4*i-3)=1 & data(4*i-2)=0 data_mod1(i) = -3; if data(4*i-1)=0 & data(4*i)=0 data_mod2(i) = 3; elseif data(4*i-1)=0 & data(4*i)=1 data_mod2(i) = 1; elseif data(4*i-1)=1 & data(4*i)=1 data_mod2(i) =

6、 -1; elseif data(4*i-1)=1 & data(4*i)=0 data_mod2(i) = -3; end end endSNR_dB = 1:10;%信噪比dB形式SNR = 10.(SNR_dB/10);%信噪比转化为线性值for loop= 1:10 sigma = sqrt(5/SNR(loop); s_receive1 = data_mod1 + sigma * randn(1,length(data_mod1); s_receive2 = data_mod2 + sigma * randn(1,length(data_mod2);%? for k = 1:nsym

7、bol if s_receive1(k)2 data_demod1(k) = 0; data_demod2(k) = 0; if s_receive2(k)2 data_demod3(k) = 0; data_demod4(k) = 0; elseif s_receive2(k)0 & s_receive2(k)-2 & s_receive2(k)0 data_demod3(k) = 1; data_demod4(k) = 1; elseif s_receive2(k)0 & s_receive1(k)2 data_demod3(k) = 0; data_demod4(k) = 0; else

8、if s_receive2(k)0 & s_receive2(k)-2 &s_receive2(k)0 data_demod3(k) = 1; data_demod4(k) = 1; elseif s_receive2(k)-2 data_demod3(k) = 1; data_demod4(k) = 0; end elseif s_receive1(k)-2 data_demod1(k) = 1; data_demod2(k) = 1; if s_receive2(k)2 data_demod3(k) = 0; data_demod4(k) = 0; elseif s_receive2(k)

9、0 & s_receive2(k)-2 & s_receive2(k)0 data_demod3(k) = 1; data_demod4(k) = 1; elseif s_receive2(k)-2 data_demod3(k) = 1; data_demod4(k) = 0; end elseif s_receive1(k)2 data_demod3(k) = 0; data_demod4(k) = 0; elseif s_receive2(k)0 & s_receive2(k)-2 & s_receive2(k)0 data_demod3(k) = 1; data_demod4(k) =

10、1; elseif s_receive2(k)-2 data_demod3(k) = 1; data_demod4(k) = 0; end end if (data_demod1(k) = data(k*4-3) | (data_demod2(k) = data(k*4-2)|(data_demod3(k) = data(k*4-1) | (data_demod4(k) = data(k*4) errornumber(loop) = errornumber(loop) + 1; end end errorratio(loop) = errornumber(loop)/nsymbol;endt = 0.75*erfc(sqrt(3*SNR/30);ser_theory = 1-(1-t).2;%理论误码率,注意Q函数和误差函数的对应关系semilogy(SNR_dB,errorratio,-k*,SNR_dB,ser_theory,-ro);title(16QAM信号在AWGN信道下的性能(格雷码));xlabel(信噪比/dB);ylabel(误码率);legend(误码率,理论误码率);grid on;%坐标线专心-专注-专业

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 教案示例

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号© 2020-2023 www.taowenge.com 淘文阁