Code covered by the BSD License  

Highlights from
TOFsPRO toolbox

from TOFsPRO toolbox by Dariya Malyarenko
Signal processing for time-of-flight mass spectra over the broad m/z range (1-200 kDa)

lorRH (gt, trnct)
function lrh = lorRH (gt, trnct)

%----------------------------------------------------
% Compute left half truncated Lorentzian of HWHM gt (in time)
%
% INPUT:
% gt - HWHM in time ticks;
% trnct - ADC precision (default = 2^9)
%
% OUTPUT:
% lrh - right half of a truncated Lorentzian normalized to max = 1;
%
% USAGE:
% lrh = lorRH (gt, trnct);
% Dependency: none
%

if (nargin < 2) | (nargin < 1)
  error('Requires wavelet width and ADC precision as an input');
  aps = NaN;
end;

tau = (sqrt(2)-1)/gt;
lts =ceil(10*gt+2*sqrt(trnct-1)/tau); gt=ceil(gt);
ts = 1:lts; ts=ts'; tmax = 6*gt;

lrh = tau./(1+((ts-tmax)*tau).^2);
lrh = lrh/max(lrh);

lrh(find(lrh<(1.0/trnct)))=0; lrh=lrh((tmax+1):end);
i1=find(lrh>0); lrh = lrh(1:(i1(end)+2*gt));
i1(end);
return;

Contact us at files@mathworks.com