clc;
clear;
close all;
warning off;
addpath(genpath(pwd));
%****************************************************************************
%更多关于matlab和fpga的搜索“fpga和matlab”的CSDN博客:
%matlab/FPGA项目开发合作
%https://blog.csdn.net/ccsss22?type=blog
%****************************************************************************
it=250000;
EbNo=0:16;
sigma=1./sqrt(8*(10.^(EbNo./10)));
error = zeros(1,length(sigma));
BER=zeros(1,length(sigma));
BER_analytical=zeros(1,length(sigma));
BER_theoretical=zeros(1,length(sigma));
const_x=zeros(1,it);
const_y=zeros(1,it);
for k = 1:length(sigma)
for i=1:it
x=rand();
%%%%%%%%% mapping of symbol %%%%%%%%%%%
if x <= 0.0625
symbol=1;
A=[1 0];
else if x <= 0.125 && x > 0.0625
symbol=2;
A=[0.923 0.38];
else if x <= 0.1875 && x > 0.125
symbol = 3;
A=[0.707 0.707];
else if x <= 0.25 && x > 0.1875
symbol = 4;
A=[0.38 0.923];
else if x <= 0.3125 && x > 0.25
symbol = 5;
A=[0 1];
else if x <= 0.375 && x > 0.3125
symbol = 6;
A=[-0.38 0.923];
else if x <= 0.4375 && x > 0.375
symbol = 7;
A=[-0.707 0.707];
else if x <= 0.5 && x > 0.4375
symbol=8;
A=[-0.923 0.38];
else if x <= 0.5625 && x > 0.5
symbol=9;
A=[-1 0];
else if x <= 0.625 && x > 0.5625
symbol=10;
A=[-0.923 -0.38];
else if x <= 0.6875 && x > 0.625
symbol=11;
A=[-0.707 -0.707];
else if x <= 0.75 && x > 0.6875
symbol=12;
A=[-0.382 -0.923];
else if x <= 0.8125 && x > 0.75
symbol=13;
A=[0 -1];
else if x <= 0.875 && x > 0.8125
symbol=14;
A=[0.382 -0.923];
else if x <= 0.9375 && x > 0.875
symbol=15;
A=[0.707 -0.707];
else symbol=16;
A=[0.923 -0.38];
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%% addition of noise %%%%%%%%%%%
Inoise = sigma(k) * randn;
Qnoise = sigma(k) * randn;
Ircv = A(1) + Inoise;
Qrcv = A(2) + Qnoise;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
B=[Ircv Qrcv];
const_x(i)=B(1);
const_y(i)=B(2);
%%%%%%%% Symbol Detection %%%%%%%%%%%%%
B_Mag=sqrt((Ircv*Ircv)+(Qrcv*Qrcv));
C=dot(A,B);
C=C/B_Mag;
theta=acosd(C);
if theta < 11.25
error(k)=error(k);
else error(k)=error(k)+1;
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end;
%%%%%%%% BER and SER calculations %%%%%
BER_analytical(k)=error(k)/(4*it);
BER_theoretical(k)=.25*erfc(.137/(sigma(k)));
SER_analytical(k)=error(k)/(it);
SER_theoretical(k)=erfc(.137/(sigma(k)));
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end
semilogy(EbNo,BER_analytical,'-red+','LineWidth',2);
hold on;
semilogy(EbNo,BER_theoretical,'-.blueo','LineWidth',2);
xlabel('EbNo in dB');
ylabel('BER in log scale');
title('BER v/s EbNo for 16PSK');
legend('Simulation','Theoretical');
grid on;
figure;
semilogy(EbNo,SER_analytical,'-red+','LineWidth',2);
hold on;
semilogy(EbNo,SER_theoretical,'-.blueo','LineWidth',2);
xlabel('EbNo in dB');
ylabel('SER in log scale');
title('SER v/s EbNo for 16-PSK');
legend('Simulation','Theoretical');
grid on;
figure;
scatter(const_x,const_y,'*');
title('Constellation for 16-PSK');
save R16.mat
没有合适的资源?快使用搜索试试~ 我知道了~
matlab-通过matlab对比2PSK,4PSK,8PSK,16PSK的误码率,无符号率以及星座图-源码
![preview](https://csdnimg.cn/release/downloadcmsfe/public/img/white-bg.ca8570fa.png)
共9个文件
m:5个
mat:4个
![preview-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/scale.ab9e0183.png)
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
![star](https://csdnimg.cn/release/downloadcmsfe/public/img/star.98a08eaa.png)
温馨提示
matlab_通过matlab对比2PSK,4PSK,8PSK,16PSK的误码率,无符号率以及星座图_源码
资源推荐
资源详情
资源评论
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
共 9 条
- 1
![avatar](https://profile-avatar.csdnimg.cn/d5fa1452106248a4a63014172db25c5d_leavemyleave.jpg!1)
mYlEaVeiSmVp
- 粉丝: 1966
- 资源: 19万+
![benefits](https://csdnimg.cn/release/downloadcmsfe/public/img/vip-rights-1.c8e153b4.png)
下载权益
![privilege](https://csdnimg.cn/release/downloadcmsfe/public/img/vip-rights-2.ec46750a.png)
C知道特权
![article](https://csdnimg.cn/release/downloadcmsfe/public/img/vip-rights-3.fc5e5fb6.png)
VIP文章
![course-privilege](https://csdnimg.cn/release/downloadcmsfe/public/img/vip-rights-4.320a6894.png)
课程特权
![rights](https://csdnimg.cn/release/downloadcmsfe/public/img/vip-rights-icon.fe0226a8.png)
开通VIP
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)
- 1
- 2
- 3
前往页