LUKE - Columnwise data smoothing Columnwise data smoothing. Output data are not normalized to input ones Input: - x: data matrix [n,m] - width: smoothing width (number of points, must be positive and integer) [1,1] - typ: 'gauss'ian or 'rect'angular (string) [1,p] (default = 'gaus') Output: - y: smoothed data [n,m] by Y.PEYSSON CEA/IRFM <yves.peysson@cea.fr> and Joan Decker CEA/IRFM <joan.decker@cea.fr>
0001 function y = smooth_dke_yp(x,width,typ) 0002 % LUKE - Columnwise data smoothing 0003 % 0004 % Columnwise data smoothing. Output data are not normalized to input ones 0005 % 0006 % Input: 0007 % 0008 % - x: data matrix [n,m] 0009 % - width: smoothing width (number of points, must be positive and integer) [1,1] 0010 % - typ: 'gauss'ian or 'rect'angular (string) [1,p] 0011 % (default = 'gaus') 0012 % 0013 % Output: 0014 % 0015 % - y: smoothed data [n,m] 0016 % 0017 %by Y.PEYSSON CEA/IRFM <yves.peysson@cea.fr> and Joan Decker CEA/IRFM <joan.decker@cea.fr> 0018 % 0019 if nargin < 1, 0020 infoyp(2,'Wrong number of input arguments for smooth_dke_yp'); 0021 return; 0022 end 0023 if nargin == 1, 0024 y = x; 0025 return; 0026 end 0027 if nargin == 2, 0028 typ = 'gaus'; 0029 end 0030 % 0031 width = round(abs(width));%must be positive integer and not null 0032 % 0033 if ~width, 0034 y = x; 0035 return; 0036 end 0037 % 0038 if typ=='gaus' 0039 width = width*2; 0040 w = (-width:width)/width*2; 0041 w = exp(-w.^2); 0042 else 0043 w = ones(-width:width); 0044 end 0045 % 0046 w = w/sum(w); 0047 % 0048 n = size(x); 0049 if n(1,1)==1, x = x(:); end 0050 % 0051 for i = 1:n(1,2) 0052 xf = conv(x(:,i),w); 0053 y(:,i) = xf(width+1:n(1,1)+width); 0054 end 0055