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)

gausRH (gt, trnct)
function grh = gausRH (gt, trnct)

%----------------------------------------------------
% Compute right half truncated Gaussian of HWHM gt (in time)
%
% INPUT:
% gt - HWHM in time ticks;
% trnct - ADC precision (default = 2^9)
%
% OUTPUT:
% glh - right half of a truncated Gaussian normalized to max = 1;
%
% USAGE:
% grh = gausRH (gt, trnct);
% Dependency: external "normpdf" function
%

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

sigma=gt/sqrt(2*log(2)); gt=ceil(gt);
lts = ceil(30*gt+2*sqrt(2*log(trnct))*sigma);
ts = 1:lts; ts=ts'; tmax = 20*gt;

grh=normpdf(ts,tmax, gt/sqrt(2*log(2)));
grh=grh/max(grh);
grh(find(grh<(1./trnct)))=0; grh=grh((tmax+1):end);
i1=find(grh>0); grh = grh(1:(i1(end)+6*gt));
i1(end);
return;

Contact us at files@mathworks.com