IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
sigwindowuni.m
Go to the documentation of this file.
1 %>@ingroup maths
2 %>@file
3 %>@brief Point-by-point multiplications of the rows of X by a sigmoid
4 %>
5 %> @sa pre_sigwindow
6 %
7 %> @param X matrix with curves as rows
8 %> @param idxcentre index where sigmoid will be 0.5
9 %> @param scale length for sigmoid to go from 0.5 to .995 or .005
10 %> @return X
11 function X = sigwindowuni(X, idxcentre, scale)
12 
13 % 1/(1+exp(-k*scale)) = .995 ==> % k*scale = -log(.005)
14 k = -log(.005)/scale;
15 
16 sigvalues = (1./(1+exp(-k*((1:size(X, 2))-idxcentre))));
17 X = X.*repmat(sigvalues, size(X, 1), 1);
18 
19 
20 
function sigwindowuni(in X, in idxcentre, in scale)
Applies sigmoid window to curves.
Definition: pre_sigwindow.m:12
Analysis Session (AS) base class.
Definition: as.m:6