% File: E7_053.M

clear;

% Set A, and sigma


fprintf('\nThe following parameter values have been selected:\n')
A      = 4;
sigma  = 1;

fprintf('\nA      = %g',A);
fprintf('\nsigma  = %g\n',sigma);


ro = 0:0.2:7;

% Compute f(ro/s1)
for (i = 1:1:length(ro))
    f(i) = (ro(i)/sigma^2)*exp((-(ro(i)^2)-A^2)/(2*sigma^2))...
                    *besseli(0,(ro(i)*A/sigma^2));
end;


% Plot result
plot(ro,f);
xlabel('ro');
ylabel('f(ro/s1)');
title('Conditional pdf for noncoherent OOK reception');
fprintf('\nSee Window for plot.\n');