基于MatlabSimulink - 的QDPSK调制解调仿真设计与研究学位论文 下载本文

for i=1:nb/2

plot(idata(i),qdata(i),'r+'),title('QDPSK信号星座图(Awgn)');hold on; axis([-2 2 -2 2]);

plot(Awgn_ichsum(i),Awgn_qchsum(i),'*');hold on; legend('理论值(发射端)','实际值(接收端)'); end

%通过瑞利衰落信道再通过高斯信道 figure(4) subplot(2,2,1)

plot(Ray_s),title('调制信号(Ray+Awgn)'); axis([0 500 -5 5]); subplot(2,2,2);

psd(h,Ray_s,'fs',fs),title('调制信号功率谱密度(Ray)'); figure(5) for i=1:nb/2

plot(idata(i),qdata(i),'r+'),title('QDPSK信号星座图(Awgn+Ray)');hold on; axis([-2 2 -2 2]);

plot(Ray_ichsum(i),Ray_qchsum(i),'*');hold on; legend('理论值(发射端)','实际值(接收端)'); end figure(6)

semilogy(SNRindB2,theo_err_awgn_prb,'r'),title('误码率曲线');hold on; semilogy(SNRindB1,smld_bit_awgn_err_prb,'r*');hold on; semilogy(SNRindB2,theo_err_ray_prb);hold on; semilogy(SNRindB1,smld_bit_ray_err_prb,'+'); xlabel('Eb/No');ylabel('BER');

legend('理论AWGN','仿真AWGN','理论Rayleigh','仿真Rayleigh');

45

cm_sm32:

function [pb,ps]=cm_sm32(snr_in_dB) % [pb,ps]=cm_sm32(snr_in_dB)

% CM_SM3 finds the probability of bit error and symbol error for % the given value of snr_in_dB, signal to noise ratio in dB. N=100;

E=1; % energy per symbol numofsymbolerror=0; numofbiterror=0; counter=0;

snr=10^(snr_in_dB/10); % signal to noise ratio sgma=sqrt(E/snr)/2; % noise variance s00=[1 0]; s01=[0 1]; s11=[-1 0]; s10=[0 -1]; % signal mapping % generation of the data source while(numofbiterror<100) for i=1:N,

temp=rand; % a uniform random variable between 0 and 1 if (temp<0.25), % with probability 1/4, source output is \ dsource1(i)=0; dsource2(i)=0;

elseif (temp<0.5), % with probability 1/4, source output is \ dsource1(i)=0; dsource2(i)=1;

elseif (temp<0.75), % with probability 1/4, source output is \ dsource1(i)=1; dsource2(i)=0;

else % with probability 1/4, source output is \ dsource1(i)=1; dsource2(i)=1; end; end;

46