function [damp, damp0] = damping(x);

%	FUNCTION [DAMP, DAMP0]= DAMPING(X)
%
%	COMPUTES BM DAMPING CONSTANTS  
%
%	X = Points on BM
%	DAMP = BM damping constants corrected at base and apex 	
%	DAMP0 = BM damping const. without base and apex corrections 	
%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% damping constant is imagined to depend mainly the
% intrinsic viscosity of cochlear motor (OHC+DEITERS CELLS) 
% h = eta*L/H ; eta = viscosity coefficient
% [3.35e-5 kg/(BETA*sec) for water, see GREENF.M]
% L/H = shearing ratio between length L of viscous segment and 
% thickness H of shearing medium (about 10)
%    

ho = 10e-3; 	% Kg/(BETA sec) [about 30 times water viscosity] 
exph = -log(4);	% decreases 4 times
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 	


N=length(x);

Ce=0;		% relative damping at the helicotrema

Ce=Ce*exp(-1/0.075+exph);
% Cb=0.5;		% relative damping at the base
Cb=0;

h=ho*exp(exph*x);

h1=ho*( exp(exph*x) + Ce*exp(x/0.075) + Cb*exp(-x/0.015) );

damp0 = [2*h(1),h(1:N-1)+h(2:N)]/2;
damp = [2*h1(1),h1(1:N-1)+h1(2:N)]/2;
