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)

coefNLFiltLL(inhw, las, trct)
function [wfc1, wfc2, wfc3] = coefNLFiltLL(inhw, las, trct)

%----------------------------------------------------
% Compute filter coefficients for nonlinear target filter (combination of
% three filters: see [Malyarenko et la, RCM 2006]) for L-L lineshape
% that reduces width by 40% and preserves input noise level
% 
%
% INPUT: 
% inhw - input peak HWHM in time ticks;
% las - left asymmetry of the input peak wavelet in time ticks
% trct - ADC precision (default = 2^9)
%
% OUTPUT:
% wfc1,2,3 - coefficients for three filters (may be of different length
%
% USAGE:
% [wfc1, wfc2, wfc3] = coefNLFiltLL(inhw, las, trct);
% Dependency: none
%

%nu1 = 0.01; nu2 = 0.001; nu3 = 0.0001;
nu1 = 0.001; nu2 = 0.0001; nu3 = 0.00001;

inpW = [lorLH(inhw, trct); lorRH((inhw+las), trct)]; size(inpW); % make a vector
trgW1 = [lorLH(0.2*inhw, trct*5); lorRH(0.2*(inhw+las), trct*5)]; size(inpW);
trgW2 = [lorLH(0.5*inhw, trct*2); lorRH(0.5*(inhw+las), trct*2)];
trgW1 = trgW1*sum(inpW)/sum(trgW1); %% normalize target wavelet 
trgW2 = trgW2*sum(inpW)/sum(trgW2);

[ymx, inpP] =  max(inpW);
[ytmx, trgP] = max(trgW2);
shp = length(1:trgP)+length(inpP:length(inpW))-ceil(2*inhw)+inpP-trgP; %% target shift
%'target shift ', shp
fleng = inpP+shp+length(trgP:length(trgW2));
inpW = [inpW; zeros(fleng-length(inpW),1)];
trgW1 = [trgW1; zeros(fleng-length(trgW1),1)];
trgW2 = [trgW2; zeros(fleng-length(trgW2),1)];

wfc1 = dwiener4wlt1(inpW,nu1,circshift(trgW1, shp)); 
wfc2 = dwiener4wlt1(inpW,nu2,circshift(trgW1, shp));
wfc3 = dwiener4wlt1(inpW,nu3,circshift(trgW2, shp));
wfc1 = coefTrunc(wfc1);
wfc2 = coefTrunc(wfc2);
wfc3 = coefTrunc(wfc3);

return;

Contact us at files@mathworks.com