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)

optFiltAll(inSig, wfc)
function fs = optFiltAll(inSig, wfc)

%----------------------------------------------------
% Compute filtered signal using optimal target filter (smoothing without
% broadening: see [Malyarenko, et.al.RCMS 2006])
%
% INPUT: 
% inSig - input TOF signal (resampled to have constant point density per
% peak)
% wfc - optimal filter coefficients (already truncated, output of
% coefOptFiltXX);
%
% OUTPUT:
% fs - filtered signal
%
% USAGE:
% fs = optFiltAll(inSig, wfc);
% Dependency: "filter" function from "signal" toolbox

sins = size(inSig);
if sins(2) > sins(1) inSig=inSig'; end;

Nw = length(wfc);

fs = filter(wfc, 1, inSig); 
if (Nw/2==fix(Nw/2)) sh1 = -Nw/2; % for filter symmetry (around maximum) 
else sh1 = -(Nw-1)/2+1;
end;
sh1;
fs = circShift(fs, sh1);

l1 = length(fs);
%% correct for filter -induced shift into early points 11/14/07
fs((end-floor(Nw/2)):end) = inSig((end-floor(Nw/2)):end); 
fs = fs(1:l1);
return;

Contact us at files@mathworks.com