% File: E7_058.M

clear;

fprintf('\nThe following parameter values have been selected:\n')

T  = 1;
Bp = 1;

fprintf('\nT  = %g',T);
fprintf('\nBp = %g\n',Bp);


% x is Eo/No in dB
x = -1:0.5:15;

% Generating Pe(x)
Pe = zeros(length(x),1);
for (i = 1:1:length(x))
  Pe(i) = 0.5*exp((-1/(2*T*Bp))*(10^(x(i)/10)));
end;


fprintf('\nSee Window for plot.\n\n');

% Plotting results
semilogy(x,Pe);
xlabel('EbNodB');
title('BER for OOK Signaling, Noncoherent Detection');
%axis;




