% Emacs mode header: -*-Octave-*- source. %
% G for Greenwood tuning function
% G latency passive analytical

function ansf = Glat_pas_ana2(x,w)
d = 7; %[mm]
w0 = 20000; %[Hz]
% out = w./sqrt(w_0.*exp(- x./d) - w); %Eq.[11]

%ansf = (2*d*atanh((w0./exp(x/d) - w).^(1/2)./(-w).^(1/2)))./(-w).^(1/2);
% ansf = - ...
ansf = - (2*w./(d*sqrt(w0))).*atan(sqrt(exp(-x./d)-w/w0 ));
%ansf =+ (2*w./(d*sqrt(w0))).*atan(sqrt(1 - exp(-x./d) ));
endfunction