当前位置:网站首页>4PAM在高斯信道与瑞利信道下的基带仿真系统实验
4PAM在高斯信道与瑞利信道下的基带仿真系统实验
2022-07-25 15:21:00 【町棠棠】
1、系统框图

2、代码
clear all
close all
clc
N = 10000; %比特数
SNR=0:10; %SNR的范围
EbN0 = 10.^(SNR/10);
err_num=zeros(1,length(SNR)); % 错误bit个数
simu_ber = zeros(1,length(SNR)); % 仿真误误码率
theory_berAWGN = zeros(1,length(SNR)); % 理论误码率
theroy_berRaliy = zeros(1,length(SNR)); % 理论误码率
R=raylrnd(0.5,1,N); %产生瑞利信号
M = 4;%进制数
graycode = [0,1,2,3];%格雷映射
send_bit = randsrc(1,N,[0:3]);
send_bit2 = graycode(send_bit+1); %格雷编码
send_bit3 = pammod(send_bit2,M);%PAM调制
msg_tx = real(send_bit3);
hR = send_bit3.*R; %瑞利分布
pow_msg=norm(msg_tx)^2/length(msg_tx); %信号码元功率Es
for k=1:length(SNR)
sigma=sqrt(pow_msg/(2*10^(SNR(k)/10))); %噪声方差
msg_rx_awgn=msg_tx+sigma*randn(1,N);%通过AWGN信道
msg_rx_raily=awgn(hR,SNR(k),'measured');
%4PAM 解调
dePAM_awgn = pamdemod(msg_rx_awgn,M);%PAM解调
decPAM_awgn = graycode(dePAM_awgn+1);%解映射
dePAM_Raily = pamdemod(msg_rx_raily,M);
decPAM_Raily = graycode(dePAM_Raily+1);
[~,BER(k)] = biterr(send_bit, decPAM_awgn, log2(M)); %计算AWGN信道BER
[ ~,BER1(k)] =biterr(send_bit,decPAM_Raily,log2(M)); %计算瑞利衰落+AWGN信道BER
[ ~,SER(k)] = symerr(send_bit, decPAM_awgn); %计算AWGN信道SER
[~,SER1(k)] = symerr(send_bit, decPAM_Raily); %计算瑞利衰落+AWGN信道SER
theory_ser(k) = 1.5*qfunc(sqrt(0.4*EbN0(k))); % 理论误符号特率
theory_ber(k) = (2*(M-1)/M)*qfunc(sqrt(6*EbN0(k)/(M^2-1)));% 理论误比特率
end
figure
semilogy(SNR,BER,'-ro',SNR,SER,'-r*',SNR,BER1,'-b.',SNR,SER1,'-b^',SNR,theory_ser,'o-',SNR,theory_ber,'-sg') ; %画出BER和SER随SNR变化的曲线
legend('AWGN信道BER','AWGN信道SER','Rayleigh衰落+AWGN信道BER','Rayleigh衰落+AWGN信道SER','理论误符号率','理论误比特率');
title('4PAM在AWGN和Rayleigh衰落信道下的性能');
xlabel('信噪比(dB)');
ylabel('误符号率和误比特率');
%%画星座图
scatterplot(send_bit3);
title('调制信号星座图');
scatterplot(msg_rx_awgn);
title('AWGN接收信号星座图');
scatterplot(msg_rx_raily);
title('Raily接收信号星座图');3、实验结果

边栏推荐
- Delayed loading source code analysis:
- Yan required executor memory is above the max threshold (8192mb) of this cluster!
- Solve the timeout of dbeaver SQL client connection Phoenix query
- SQL Server forcibly disconnects
- Local cache --ehcache
- 如何解决Visual Studio中scanf编译报错的问题
- MeanShift聚类-01原理分析
- ios 面试题
- Spark partition operators partitionby, coalesce, repartition
- Promise object and macro task, micro task
猜你喜欢

oracle_ 12505 error resolution

图片裁剪cropper 示例

ML - 自然语言处理 - 自然语言处理简介

如何解决Visual Studio中scanf编译报错的问题

推荐10个堪称神器的学习网站

Outline and box shadow to achieve the highlight effect of contour fillet

打开虚拟机时出现VMware Workstation 未能启动 VMware Authorization Service

ML - 图像 - 深度学习和卷积神经网络

Idea远程提交spark任务到yarn集群

ML - 语音 - 传统语音模型
随机推荐
打开虚拟机时出现VMware Workstation 未能启动 VMware Authorization Service
ML - 自然语言处理 - 关键技术
Gbdt source code analysis of boosting
Example of password strength verification
用OpenPose进行单个或多个人体姿态估计
Universal smart JS form verification
6月产品升级观察站
Recommend 10 learning websites that can be called artifact
Redis elimination strategy list
node学习
Promise对象与宏任务、微任务
Handle Oracle deadlock
dpdk 收发包问题案例:使用不匹配的收发包函数触发的不收包问题定位
如何解决Visual Studio中scanf编译报错的问题
spark中saveAsTextFile如何最终生成一个文件
ML - 图像 - 深度学习和卷积神经网络
什么是物联网
Ml speech depth neural network model
Solve the error caused by too large file when uploading file by asp.net
Spark002 --- spark task submission, pass JSON as a parameter