% Fig_5_2 % BER SNR plot clf; clear all; %plotting parameters + fontsizes FS = 16; %label fontsize FSN = 14; %number fontsize LW = 1.5; %linewidth %Setup number of points SNRdBmin=0; SNRdBmax=25; npoints=100; SNRdB=linspace(SNRdBmin,SNRdBmax,npoints); SNR=10.^(SNRdB./10); BER=0.5*(1-erf(sqrt(SNR)/(2*sqrt(2)))); BERlog=log10(BER); %******************* plot figure ***************************** figure(1) plot(SNRdB,BERlog,'LineWidth',LW); %semilogy(SNR,BER) axis([SNRdBmin SNRdBmax 1.1*min(BERlog) 0]); grid on %legend('theory', 'simulation'); xlabel('SNR (dB)'); ylabel('log_{10}(BER)'); title('Bit error ratio'); BER0=0.5*(1-erf(sqrt(169)/(2*sqrt(2))))