do_freq_offset = false; % set in outer script

% target output
A_target = 1;

mu_vals = [0.01, 0.03, 0.1, 0.3, 1];
N0_vals = zeros(size(mu_vals));
s_theta_vals = zeros(size(mu_vals));

% adaptive gain
% eta = mu/100; % set in outer script
eta = 0;

% noise
sigma = 0.05;

for nn = 1:length(mu_vals)
   mu = mu_vals(nn);
   hw5_p3;  
   
   N0_vals(nn) = N0;
   s_theta_vals(nn) = s_theta;
end

figure(3)
[hAx, hLine1, hLine2] = plotyy(mu_vals, N0_vals, mu_vals, s_theta_vals*180/pi);

title(sprintf('Noise Std. Dev. \\sigma = %4.2f', sigma));
xlabel('step size \mu')
grid on

ylabel(hAx(1), 'Iterations until phase error < 10^{-2}')
ylabel(hAx(2), 'Std. Dev of Phase Error (degrees)')