% The University of Queensland % School of Information Technology & Electrical Engineering % COMS3100/7100 Introduction to Communications % Plot SNR in dB from 0 dB to 20 dB in 0.1 dB steps snrdb = 0:0.1:20; snr = 10.^(snrdb / 10); % The Q function is evaluated in Matlab using the normcdf function. It's % easy to show that Q(z) = normcdf(-z, 0, 1) semilogy(snrdb, normcdf(-sqrt(snr/2), 0, 1)); ylim([1e-8, 1]); xlabel('SNR (dB)'); ylabel('BER'); grid on;