% Emacs mode header: -*-Octave-*- source. %
% Greenwood tuning function
% Gw 
cd ../pass

xX=0.1:1:35.1;
xXE=[8 12 16 20 24];
fF=invGwM(xX); stoms=1000; %coef=100000; %latency
yY200=stoms*Glat_pas_ana2M(xX,200);
yY1000=stoms*Glat_pas_ana2M(xX,1000);
yY10000=stoms*Glat_pas_ana2M(xX,10000);
ypool=stoms*Glat_pas_ana2M(xX,invGwM(xX));

cC200=GspeedM(xX,200); %velocity
cC1000=GspeedM(xX,1000);
cC10000=GspeedM(xX,10000);
cpool=GspeedM(xX,invGwM(xX));

subplot(2,1,1), %%plot(xX,ypool,'k--')
plot(xX,cC200,'r',xX,cC1000,'r',xX,cC10000,'r',xX,cpool,'b+')
grid on
%title('5mm/10kHz-red, 21mm/1kHz-green, 32mm/200Hz-blu'; ...
%title('Velocity: freq-dep-colored, pooled-black')
title('Passive velocity, m/s, frequency-dependent and pooled')
xlabel('Cochlear distance from stapes \it x, \rm mm')
ylabel('\it c, \rm m/s')

%axis([0 35 -3 0]) % to -1.5

% bottom -latency
subplot(2,1,2),
%hold on
cL = -2; %stoms*0; %0.002; % constant of Latency
%coeL = 0.001 % coeff of latency
plot(xX,-cL+yY200,'k' , xX,-cL+yY1000,'k',...
     xX,-cL+yY10000,'k',xX,-cL+ypool,'b+'), grid on
grid on %minor
%axis([0 40 -3.5 -2])
%axis([0 40 -3.5*10^-3 -2*10^-3])
%5mm/10kHz-red, 21mm/1kHz-green, 32mm/200Hz-blu
%title('Latency pool is black')
title('Passive latency, ms, frequency-dependent and pooled')
xlabel('Cochlear distance from stapes \it x, \rm mm')
ylabel('\it t, \rm ms')

cd ../mkfig