📄 xinzaobi.m
字号:
snr=0:0.1:10;
% x=10.^(snr/10);
% Q=0.5*erfc(sqrt(x)); %(sin(pi/M))^2
% Ps=2*Q.*(1-0.25*Q); %/log2(M)
% Pe=Ps/2;
% semilogy(snr,Pe),grid
M=4
%------------------------------------------------------------
x=10.^(snr/10);
er=erfc(sqrt(log2(M)*x*(sin(pi/M))^2)); %(sin(pi/M))^2
Ps=er; %/log2(M)
Pe=Ps/log2(M);
semilogy(snr,Pe),grid
%------------------------------------------------------------
Pe1=10^(-3);Pe2=10^(-4);Pe3=10^(-5);
x_1=find(Pe>Pe1);x1=max(x_1)*0.01;
xx1=sprintf('in case M=%1.0f,the snr of Pe=10e-3 is snr=%3.2f',M,x1);disp(xx1);
x_2=find(Pe>Pe2);x2=max(x_2)*0.01;
xx2=sprintf('in case M=%1.0f,the snr of Pe=10e-4 is snr=%3.2f',M,x2);disp(xx2);
x_3=find(Pe>Pe3);x3=max(x_3)*0.01;
xx3=sprintf('in case M=%1.0f,the snr of Pe=10e-5 is snr=%3.2f',M,x3);disp(xx3);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -