www.pudn.com > QPSK_System_BER_Simulation.rar > QPSK_System_BER_Simulation.m


% QPSK System Simulation, Pe evaluation 
echo on 
SNRindB1=0:2:6; 
SNRindB2=0:0.1:6; 
for i=1:length(SNRindB1), 
    [pb,ps]=cm_sm32(SNRindB1(i));               % simulated bit and symbol error rates 
    smld_bit_err_prb(i)=pb; 
    smld_symbol_err_prb(i)=ps; 
    disp([ps,pb]); 
    echo off; 
end; 
echo on; 
for i=1:length(SNRindB2), 
    SNR=exp(SNRindB2(i)*log(10)/10);            % signal to noise ratio 
    theo_err_prb(i)=0.5*erfc(sqrt(SNR));        % theoretical bit error rate 
    echo off; 
end; 
echo on; 
% Plotting commands follow 
semilogy(SNRindB1,smld_bit_err_prb,'*'); 
hold 
semilogy(SNRindB1,smld_symbol_err_prb,'o'); 
semilogy(SNRindB2,theo_err_prb);