function y = lorentz(v0,a,b,lambda) % % LORENTZ % y = lorentz(v0,a,b,lambda) returns a vector having % the same length as lambda and containing the values % of a Lorentzian-shaped curve with area = a over the % range of lambda. % The Lorentz curve is given by % % A % F(v) = -------------- % (v-v0)² + b² % % The curve is a good approximation of the band shape of % Absorbance = log(Io/I) in infra-red absorption due to % molecular vibrations. % % RJM 8/4/94 lambda = lambda(:); k=length(lambda); l1=atan((lambda(1)-v0)/b); l2=atan((lambda(k)-v0)/b); const=a*b/(l2-l1); y=const*ones(k,1)./((lambda-v0).^2+b^2);