Please copy and paste the code so I can test it :) Please do not comment somethi
ID: 662301 • Letter: P
Question
Please copy and paste the code so I can test it :)
Please do not comment something like "Don't have Matlab". If you don't have the software, you don't need to answer anything.
MATLAB Exercise: Assume we are using a (3,1) Repetition Code on a Binary Sym- metric Channel (BSC) with crossover probability . Plot the probability of error as a function of E for values ranging: .001 .1. Also plot the probability of error without coding (on the same plot). (hints: An error occurs with (3,1) repetition coding only if 2 or 3 of the bits are flipped (hints: An error occurs with (3,1) repetition coding only if 2 or 3 of the bits are flipped. The probability of an error occurring without coding is simply E Plot the x-axis and y-axis in log-scale.)Explanation / Answer
Np =100;
p = linspace(0.001, 0.1, Np);
pp = p(1:Np);
C(1) = 1;
C(Np) = 1;
C(1:Np) = 1 + pp.*log2(pp) + (1-pp).*log2(1-pp);
plot(p, C);
title('CAPACITY OF THE BINARY SYMMETRIC CHANNEL (BSC)')
xlabel('PROBABILITY OF ERROR')
ylabel('CAPACITY')
grid
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.