Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In this task, you are asked to write a Monte Carlo simulation using Matlab to ev

ID: 3349044 • Letter: I

Question

In this task, you are asked to write a Monte Carlo simulation using Matlab to evaluate the bit error rate (BER) for a baseband binary unipolar PAM signal transmitted over an AWGN channel. The unipolar signal symbols are generated randomly from a (0, A), where A is the sum of first number of the group students' IDs. For example, ID1 xxxxx7, ID2- yyyyy5, ID3 zzzzz0 then A-12. The symbol source probabilities are Po = 0.3 and P1-0.7 Use simulations to find the BER for signal to noise power ratios (S N of 5, 10. and 25 dB. Use the optimum threshold level. The noise should be added according to the require (S/N)R. In addition, find the theoretical BER for each case

Explanation / Answer

clc;


clear all;


close all;


a=2;

b = 10^6;


A = [0 12];


SNRV= [5 10 25];


ipHat = zeros(1,b);


for i = 1:length(SNRV)


inp = randsrc(1,b,A);


inp1(find(inp==0)) = 0;


inp1(find(inp>0)) = 1;


s = (1/sqrt((19^2)/4))*inp;


n = 1/sqrt(2)*[randn(1,b) + j*randn(1,b)];


n1 = 10^(-SNRV(i)/20)*n;


y = s + n1;

r = real(y);


ipHat(find(r<0.5)) = 0;


ipHat(find(r>=0.5)) = 1;


Err(i) = size(find([inp1- ipHat]),2);


end


BER= Err/b


theoreticalBER= (4/a)*erfc(sqrt(10.^(SNRV/10)))

output is

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote