% PHDmagloop3   Plot the fields from a magnetic dipole in rock

% as *2 but modified fig10 routines to show effect of SNR

% based on PHDmagloop1, this plots the fields in rock, using the
% approximate formulations that assume no boundary problem
% start at fig 4. Use ROCK1 fundtion instead of AIR

% later, plot field using the exact expression

%clear; clf; cla;

filetype = '-dtiff';

points=1001;

% --------------------------- plot magnitude witht T^2 ---------

fig=10; figure(fig);  

% repeat figure 4, but use ROCK3 which doesnt include the 1/R^3 term

x=logspace(-1,2,points);
[Hax Hcp] = rock3(x);

h1 = loglog(x,abs(Hax),'k-','linewidth',3);
hold on;
%h2 = loglog(x,abs(Hcp),'b-','linewidth',1.5);

for j1 = 2: -0.5: -2
    plotdata = abs(Hax).*(x.^j1);
    pivot = abs(Hax(485))./plotdata(485);
    % coeff 485 corresponds to optimum freq of orig curve
    plotdata = plotdata .* pivot;
    h3 = loglog(x,plotdata,'b-','linewidth',1.25);
end

%peak = sqrt(8); [Hax Hcp] = rock3(peak); abs(Hcp)
%plot(peak,abs(Hax),'r.');

set(gca,'LineWidth',1.5,'FontSize',12,'TickDir','out')
xlabel('T: Normalised Frequency','fontsize',12)
ylabel('Relative SNR','fontsize',12)
title('Variation of SNR with frequency','fontsize',12)
%legend('coaxial loops','coplanar loops',3)
text([0.2 0.2 0.2 0.2],[12.5 6 2 0.65],['-20dB'; '-25dB'; '-30dB'; '-35dB'])
text([0.2 1.04 4],[0.2 0.2 9.5],['-40dB'; '-60dB'; '-60dB'])
ax = axis;
axis([0.1 10 1E-1 20])
print(filetype, '', ['loop3-' num2str(fig)] )

