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)

coefTrunc (wcoef)
function ctrn = coefTrunc (wcoef)

%----------------------------------------------------
% Truncate filter coefficients to reduce ringing artifacts
%
% INPUT:
% wcoef - filter coefficients;
%
% OUTPUT:
% ctrn - truncated filter coefficients;
%
% USAGE:
% ctrn = coefTrunc (wcoef);
% Dependency: none
%

[ymx, maxW]=max(wcoef); hw = floor(length(wcoef)/2);

ctrn = circshift(wcoef, (hw-maxW));
clen = floor(length(wcoef)/3)+20;
ctrn = ctrn((hw-floor(clen/2.)):(hw+floor(clen/2.)));

return;

Contact us at files@mathworks.com