当前位置:网站首页>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、实验结果

边栏推荐
- ice 100G 网卡分片报文 hash 问题
- Reflection - Notes
- Run redis on docker to start in the form of configuration file, and the connection client reports an error: server closed the connection
- Spark partition operators partitionby, coalesce, repartition
- Scala110-combineByKey
- 如何解决Visual Stuido2019 30天体验期过后的登陆问题
- Scala110-combineByKey
- 密码强度验证示例
- UIDocumentInteractionController UIDocumentPickerViewController
- SQL Server forcibly disconnects
猜你喜欢

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

Image cropper example

密码强度验证示例

图片裁剪cropper 示例

基于OpenCV和YOLOv3的目标检测实例应用

Simulate setinterval timer with setTimeout

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

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

Idea remotely submits spark tasks to the yarn cluster

Spark AQE
随机推荐
CGO is realy Cool!
Application of object detection based on OpenCV and yolov3
Spark002---spark任务提交,传入json作为参数
ML - 图像 - 深度学习和卷积神经网络
Solve the error caused by too large file when uploading file by asp.net
图论及概念
UIDocumentInteractionController UIDocumentPickerViewController
JS 同步、异步,宏任务、微任务概述
spark中saveAsTextFile如何最终生成一个文件
js URLEncode函数
Spark SQL空值Null,NaN判断和处理
Tasks, micro tasks, queues and scheduling (animation shows each step of the call)
单例模式3--单例模式
图片裁剪cropper 示例
分布式原理 - 什么是分布式系统
iframe嵌套其它网站页面 全屏设置
打开虚拟机时出现VMware Workstation 未能启动 VMware Authorization Service
How much memory can a program use at most?
ice 100G 网卡分片报文 hash 问题
Spark SQL common time functions