球站的信号%判决[shuzhixiabiao]=min(abs(angle(s2)-[pi/43*pi/4-pi/4-3*pi/4]));informa=[fix((xiabiao-1)/2)mod((xiabiao-1),2)];aa=g2(informa,2);fort=1:120y3(t)=aa*exp(j*2*pi*12003*t/1200);endn2=wgn(1,120,10*log(N0)/log(10),'complex');y4=h2*y3+n2;%以上地球站接收到的信号fort=1:120y5(t)=y4(t)*exp(-j*2*pi*12003*t/1200);ends3=sum(y5(:));%选择性接收第一个地球站的信号%判决[shuzhixiabiao]=min(abs(angle(s3)-[pi/43*pi/4-pi/4-3*pi/4]));infor2=[fix((xiabiao-1)/2)mod((xiabiao-1),2)];%判决为infor2ifinfor2(1)~=infor(1)erro=erro+1;endifinfor2(2)~=infor(2)erro=erro+1;endendBER2(kk)=erro/;endsemilogy(10*log(p)/log(10),BER2,'b');holdonQPSK源代码:function[d]=g2(bit,Nc)A=[exp(j*pi/4)00;exp(j*3*pi/4)01;exp(-j*3*pi/4)11;exp(-j*pi/4)10];fork=1:Nc/2ifbit(2*k-1:2*k)==[00]d(k)=A(1,1);elseifbit(2*k-1:2*k)==[01]d(k)=A(2,1);elseifbit(2*k-1:2*k)==[11]d(k)=A(3,1);