0% found this document useful (0 votes)
6 views1 page

Error Probability

The document contains a MATLAB script that simulates the bit error rate (BER) for BPSK, QPSK, and QAM modulation schemes over a range of signal-to-noise ratios (SNR). It prompts the user for the number of symbols and calculates the BER through Monte Carlo simulations, displaying the results in a semilogarithmic plot. The script also includes a waitbar to indicate progress during the SNR iterations.

Uploaded by

Aditya Chavan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

Error Probability

The document contains a MATLAB script that simulates the bit error rate (BER) for BPSK, QPSK, and QAM modulation schemes over a range of signal-to-noise ratios (SNR). It prompts the user for the number of symbols and calculates the BER through Monte Carlo simulations, displaying the results in a semilogarithmic plot. The script also includes a waitbar to indicate progress during the SNR iterations.

Uploaded by

Aditya Chavan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

clc

snrdB_min= -3;
snrdB_max= 8;
snrdB=snrdB_min:1:snrdB_max;
Nsymbols=input('Enter no of Symbols >');
snr=10.^(snrdB/10);
h=waitbar(0,'SNR Iteration ');
len_snr=length(snrdB);

for j=1:len_snr
waitbar(j/len_snr)
sigma=sqrt(1/(2*snr(j)));
error_count=0;
for k=1:Nsymbols
d=round(rand(1));
X_d=2*d-1;
n_d=sigma*rand(1);
y_d=X_d+n_d;
if y_d>0
d_est=1;
else
d_est=0;
end
if(d_est~=d)
error_count=error_count+1;
end
end
errors(j)=error_count;
end
close(h)
ber_sim=errors/Nsymbols;
ber_BPSK=0.5.*qfunc(sqrt(snr));
ber_QPSK=qfunc(sqrt(snr));
ber_QAM=2.*qfunc(sqrt(0.4.*snr));
semilogy(snrdB,ber_BPSK,'-
',snrdB,ber_QAM,'o',snrdB,ber_QPSK,'.',snrdB,ber_sim,'+')
axis([snrdB_min snrdB_max 0.0001 1])
legend('ber_BPSK','ber_QAM','ber_QPSK','ber_sim')
xlabel('SNR(dB)')
ylabel('Probability of error ')

You might also like