求MATLAB大神帮助
clearN=10^6m=rand(1,N)>0.5;s=2*m-1;EB[NO]=[-2:30];forii=1:length(EB[NO])n=1[灯泡]rt(2)*...
clear
N = 10^6
m= rand(1,N)>0.5;
s = 2*m-1;
EB[NO]= [-2:30];
for ii = 1:length(EB[NO])
n = 1[灯泡]rt(2)*[randn(1,N) + j*randn(1,N)];
h = 1[灯泡]rt(2)*[randn(1,N) + j*randn(1,N)];
li1 = h.*s + 10^(-EB[NO](ii)/20)*n;
li2 = s + 10^(-EB[NO](ii)/20)*n;
liu= li1./h;
liu1 = real(liu)>0;
liu2 = real(li2)>0;
liuyu1(ii) = size(find([m-liu1]),2);
liuyu2(ii) = size(find([m- liu2]),2);
end
RayleighsimBer= liuyu1/N;
AWGNsimBer= liuyu2/N;
theoryBerAWGN = 0.5*erfc(sqrt(10.^(EB[NO]/10)));
EbN0Lin = 10.^(EB[NO]/10);
theoryBerRayleigh = 0.5.*(1-sqrt(EbN0Lin./(EbN0Lin+1)));
close all
figure
semilogy(EB[NO],theoryBerAWGN,'bp-','LineWidth',2);
hold on
semilogy(EB[NO],AWGNsimBer,'mx-','LineWidth',2);
hold on
semilogy(EB[NO],theoryBerRayleigh,'bp-','LineWidth',2);
semilogy(EB[NO],RayleighsimBer,'mx-','LineWidth',2);
axis([-1 30 10^-5 1])
grid on
legend('AWGN-Theory','AWGN-Simulation','Rayleigh-Theory',
'Rayleigh-Simulation');
xlabel('Eb/No, dB');
ylabel('BER');
title('BPSK 的误码性能');
N =
1000000
EB[NO]= [-2:30];
|
Error: Unbalanced or unexpected parenthesis or bracket.
这怎么解决? 展开
N = 10^6
m= rand(1,N)>0.5;
s = 2*m-1;
EB[NO]= [-2:30];
for ii = 1:length(EB[NO])
n = 1[灯泡]rt(2)*[randn(1,N) + j*randn(1,N)];
h = 1[灯泡]rt(2)*[randn(1,N) + j*randn(1,N)];
li1 = h.*s + 10^(-EB[NO](ii)/20)*n;
li2 = s + 10^(-EB[NO](ii)/20)*n;
liu= li1./h;
liu1 = real(liu)>0;
liu2 = real(li2)>0;
liuyu1(ii) = size(find([m-liu1]),2);
liuyu2(ii) = size(find([m- liu2]),2);
end
RayleighsimBer= liuyu1/N;
AWGNsimBer= liuyu2/N;
theoryBerAWGN = 0.5*erfc(sqrt(10.^(EB[NO]/10)));
EbN0Lin = 10.^(EB[NO]/10);
theoryBerRayleigh = 0.5.*(1-sqrt(EbN0Lin./(EbN0Lin+1)));
close all
figure
semilogy(EB[NO],theoryBerAWGN,'bp-','LineWidth',2);
hold on
semilogy(EB[NO],AWGNsimBer,'mx-','LineWidth',2);
hold on
semilogy(EB[NO],theoryBerRayleigh,'bp-','LineWidth',2);
semilogy(EB[NO],RayleighsimBer,'mx-','LineWidth',2);
axis([-1 30 10^-5 1])
grid on
legend('AWGN-Theory','AWGN-Simulation','Rayleigh-Theory',
'Rayleigh-Simulation');
xlabel('Eb/No, dB');
ylabel('BER');
title('BPSK 的误码性能');
N =
1000000
EB[NO]= [-2:30];
|
Error: Unbalanced or unexpected parenthesis or bracket.
这怎么解决? 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询