X hits on this document

# DigitalCommons@University of Nebraska - Lincoln - page 69 / 69

146 views

0 shares

69 / 69

semilogy(Eb No,BER,'r'); %sets legend for simulation BER end if (z == 3) _

semilogy(Eb No,BER,'b'); %sets legend for simulation BER end if (z == 4) _

semilogy(Eb No,BER,'g'); %sets legend for simulation BER end if (z == 5) _

semilogy(Eb No,BER,'k'); %sets legend for simulation BER end if (z == 6) _

semilogy(Eb No,BER,'m'); %sets legend for simulation BER end hold on; _

end

%-------------------- Graph and Graph Titles ----------------------------- for i=1:length(Eb_No)

EBnotdb = 10^(Eb_No(i)/10); theoryBer(i) = .5*(1-sqrt(EBnotdb/(EBnotdb+1)));%Rayleigh fading theoryBer2(i) = jdc * Q( sqrt(2*jdc*(10^(Eb_No(i)/10))));%AWGN end semilogy(Eb No,theoryBer2,'m'); hold on; semilogy(Eb No,theoryBer,'mx-'); hold on; axis([0 Max_Eb_No_db 10^-6 0.5]) %sets vaule of axis grid on %sets dB grid %these are pretty self explanitory xlabel('Eb/No (dB)'); ylabel('BER'); title('\bf\it BER vs. Eb/No N=32 Tx=100000'); %legend('theory', 'simulation'); legend('jdc = 1'); _ _

function Qfunc = Q(x) Qfunc = erfc(x/sqrt(2))*.5; End

function dotfunc = dot2(y,x) tempsum = 0; for i=1:length(x) if x(i) < 0 bit = -1; else bit = 1; end tempsum = tempsum + bit*y(i);

end

dotfunc = tempsum; end

60

 Document views 146 Page views 146 Page last viewed Sat Dec 03 10:53:10 UTC 2016 Pages 69 Paragraphs 1770 Words 13793