clear; clc;
N = 10^5; % Total no of of bits per simulation per SNR_dB
bitstrm1 = []; %initialisation of matrices
bitstrm2 = [];
for i = 1:N
bitstrm1 = [bitstrm1 (-1+2*round(rand(1,1)))]; %creating random data for INPHASE component
bitstrm2 = [bitstrm2 (-1+2*round(rand(1,1)))]; %creating random data for QUADRATURE component
end
Data = [bitstrm1; bitstrm2]; %putting the two random bitstreams together
Eb_No_dB = [0:20]; % multiple Eb/N0 values
for i = 1:length(Eb_No_dB)
sig = sqrt(1/10^(Eb_No_dB(i)/10)); % noise variance
n = sig*(randn(2,N) + 1i*randn(2,N)); % Additive white gaussian noise prototype
h = randn(2,N) + 1i*randn(2,N); % Rayleigh channel
y = h.*Data + n; % bit-streams corrupted by Rayleigh channel & AWGN
y_rcv = y./h; % equalization of received data by channel information at the receiver
Data_rcv = [Refresh(real(y_rcv(1,:))); Refresh(real(y_rcv(2,:)))]; % Regenerating the received bits by threshold comparison
Err(i) = sum(sum(round(Data) ~= round(Data_rcv))); % computing the bit error in each simulation
end
simBer = Err/(2*N); % average BER on total no. of bits simulated
EbNo_lin = 10.^(Eb_No_dB/10);
theoryBer_AWGN = 0.5*erfc(sqrt(EbNo_lin/2)); % theoretical BER of QPSK over AWGN channel
theoryBer_Rayl = 0.5.*(1-sqrt(EbNo_lin./(EbNo_lin+1))); % theoretical BER of QPSK over Rayleigh channel
% plotting the simulated results
semilogy(Eb_No_dB,theoryBer_AWGN,'g--*');
hold on
semilogy(Eb_No_dB,theoryBer_Rayl,'b-');
semilogy(Eb_No_dB,simBer,'m--*');
axis([0 20 10^-5 0.5])
legend('QPSK over AWGN channel- Theoretical','QPSK over Rayleigh channel- Theoretical', 'QPSK over Rayleigh channel- Simulation');
xlabel('Eb/No, dB');
ylabel('误码率');
title('瑞利信道中的 Qpsk 调制');
海神之光
- 粉丝: 5w+
- 资源: 7128
最新资源
- 基于java的自习室管理和预约系统设计与实现.docx
- C++实现的基于huffman编码的文件压缩解压demo,供学习用
- No.1176 基于组态王和S7-200 PLC的锅炉温度控制系统设计 带解释的梯形图程序,接线图原理图图纸,io分配,组态画面
- 固体电介质电树枝击穿,以及SF6气体,流注放电过程
- libstdc++.so.6
- 两相交错并联buck boost变器仿真 采用双向结构,管子均为双向管 模型内包含开环,电压单环,电压电流双闭环三种控制方式 两个电感的电流均流控制效果好 matlab simulink plecs仿
- springboot在线教育平台.zip
- “互联网+”中国脉动地图——腾讯移动互联发展指数报告.pdf
- 【报告PDF】破解网络视频创新广告形式.pdf
- 【报告PDF】2015汽车消费新常态研究.pdf
- opencv-4.10.0-vs2019-x86
- 7大员工内推明星业.pdf
- 2013爱德曼新兴市场信任度调查.pdf
- 2014-2015 数字营销和O2O趋势.pdf
- 2014Q4与2015Q1新增对比报告.pdf
- 2014爱德曼中国企业信任度调查.pdf
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈