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)

ybs=bscharge(y,amp,decay,basecon)
function ybs=bscharge(y,amp,decay,basecon) 

%%----------------------------------------------------
%% Calculate baseline from charge accumulation
%%
%% INPUT:
%% y - observed sampled discrete signal (raw TOF)
%% amp - amplitude fraction of accumulated signal
%% decay - decay constant for the accumulated signal -- exp(-1/tau)
%% basecon - constant baseline offset
%%
%% OUTPUT:
%% ybs - signal baseline
%%
%% NOTES:
%% --1-- Created by Prof.Cooke (wecook@wm.edu) 10/10/04
%% --2-- No self-optimization code is included yet, but defaults work
%
% USAGE:
% ybs=bscharge(y,amp,decay,basecon);
% Dependency: none
%

ytemp=zeros(length(y),1);
%amp=0.0005; decay = 0.9988; basecon = 2114;
%amp=0.0007; decay = 0.9989; basecon = 2140;

for i=2:length(y)

ytemp(i)=(1-amp)*decay*(ytemp(i-1))+amp*(y(i)-basecon);

end;
%length(y)
%length(ytemp)
ybs = ytemp + basecon;

return;

Contact us at files@mathworks.com