function [ output_args ] = Untitled1( input_args )
clear;
hold off;
% define
A = 1; % 单位幅度
NUMBER = 10000; % 试验总数
FC = 4; %%载波频率
FC2 = 2;
RESOLUTION = 64; % 载波每个周期用RESOLUTION个点表示
SNRdB = 0:1:10;%%%%%%%%%
FR = FC * RESOLUTION;
% 理论曲线
Pe = 1/2 * erfc( sqrt( 0.5*10.^(SNRdB/10) ) );
plot(SNRdB, Pe, 'R');hold on;grid on;
% create signal
n = 1:NUMBER*FR;
xn = rand(1,NUMBER)>0.5;
wc1 = cos(n/RESOLUTION*2*pi);
wc2 = cos(n/RESOLUTION*2*pi/2);
x = wc1.*xn(ceil(n/FR)) + wc2.*(1-xn(ceil(n/FR)));
Vt = 0;
for i=1:length(SNRdB)
y = awgn(x, SNRdB(i)-10*log10(FR/2), 'measured');
for j=1:NUMBER
z1 = y([(j-1)*FR+1:j*FR]); % 取出点
z1 = conv(z1, wc1([1:FR])); %匹配滤波器
z1 = z1 .* wc1([1:length(z1)]);
z1 = sum(z1([FR-RESOLUTION/2+1:FR+RESOLUTION/2]))/RESOLUTION;
z2 = y([(j-1)*FR+1:j*FR]);
z2 = conv(z2, wc2([1:FR]));
z2 = z2 .* wc2([1:length(z2)]);
z2 = sum(z2([FR-RESOLUTION/2+1:FR+RESOLUTION/2]))/RESOLUTION;
yn(j) = (z1-z2)>Vt;
end
ErrorCount=length(find(xor(xn,yn)));
Pe(i) = ErrorCount/NUMBER;
end
plot(SNRdB, Pe);
legend('理论值','实验值');
xlabel('信噪比');
ylabel('误码率');
zhzstc1988
- 粉丝: 0
- 资源: 1
最新资源
- 云平台VPC.vsdx
- PIPE物理层接口规范:PCIe SATA USB3.1 DisplayPort 和 Converged IO 架构
- SparkSQL进阶操作相关数据
- java制作的小游戏,作为巩固java知识之用.zip
- Java语言写的围棋小游戏 半成品A Go game written in golang(Semi-finished).zip
- 基于Java-swing的俄罗斯方块游戏:源码+答辩文档+PPT.zip
- florr map详细版
- shiahdifhiahfiqefiwhfi weifwijfiwqufiqweefijeq0jfe
- registry-2.8.3<arm/amd>二进制文件
- Kotlin接口与抽象类详解及其应用
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈