FOO description for function 'foo' in one line. Necessary for lookfor functionality. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: dopplercorr detailed description for the function 'dopplercorr' CALL: b = dopplercorr(a,pl) INPUTS: a - analysis object(s) (time series) pl - parameter list(s) - bin OUTPUTS: b - analysis object (time series) M-FILE INFO: Get information about this methods by calling >> class.getInfo('foo') Get information about a specified set-plist by calling: >> class.getInfo('foo', 'set') VERSION: $Id: dopplercorr.m,v 1.6 2008/09/05 11:05:29 ingo Exp $ HISTORY: 28-07-2008 A Monsky Creation SEE ALSO: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 % FOO description for function 'foo' in one line. Necessary for lookfor functionality. 0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0003 % 0004 % DESCRIPTION: dopplercorr detailed description for the function 'dopplercorr' 0005 % 0006 % CALL: b = dopplercorr(a,pl) 0007 % 0008 % INPUTS: a - analysis object(s) (time series) 0009 % pl - parameter list(s) - bin 0010 % 0011 % OUTPUTS: b - analysis object (time series) 0012 % 0013 % 0014 % M-FILE INFO: Get information about this methods by calling 0015 % >> class.getInfo('foo') 0016 % 0017 % Get information about a specified set-plist by calling: 0018 % >> class.getInfo('foo', 'set') 0019 % 0020 % VERSION: $Id: dopplercorr.m,v 1.6 2008/09/05 11:05:29 ingo Exp $ 0021 % 0022 % HISTORY: 28-07-2008 A Monsky 0023 % Creation 0024 % 0025 % SEE ALSO: 0026 % 0027 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0028 0029 function varargout = dopplercorr(varargin) 0030 0031 %%% Check if this is a call for parameters 0032 if utils.helper.isinfocall(varargin{:}) 0033 varargout{1} = getInfo(varargin{3}); 0034 return 0035 end 0036 0037 %%% Collect input variable names 0038 in_names = cell(size(varargin)); 0039 for ii = 1:nargin,in_names{ii} = inputname(ii);end 0040 0041 %%% Collect all AOs 0042 [as, ao_invars, rest] = utils.helper.collect_objects(varargin(:), 'ao', in_names); 0043 [pli, pl_invars, rest] = utils.helper.collect_objects(rest, 'plist', in_names); 0044 0045 %%% Decide on a deep copy or a modify 0046 %%% REMARK: If you create a new AO (call the constructor) then 0047 %%% it is not necessay to copy the input-AOs !!!!!!!!!!!!!!!!!!!!!!!!! 0048 bs = copy(as, nargout); 0049 0050 %%% Combine plists 0051 pl = combine(pli, getDefaultPlist); 0052 k = find(pl,'bin'); 0053 %%% go through analysis objects 0054 for kk = 1:numel(bs) 0055 %%%%%%%%%% some calculations %%%%%%%%%% 0056 ydata = bs(kk).data.getY; 0057 leng = length(ydata); 0058 delta = zeros(leng,1); 0059 delta(1) = (ydata(2)-ydata(1))/(2*pi); 0060 delta(leng) = (ydata(leng)-ydata(leng-1))/(2*pi); 0061 0062 for i=2:(leng-1) 0063 delta(i) = (ydata(i+1)-ydata(i-1))/(4*pi); 0064 end 0065 0066 g = -1./(2*k).*delta.*sin(2.*ydata)... 0067 + 1./(4*k*k).*delta.^2.*sin(2.*ydata) ... 0068 + 1./(8*k*k).*delta.^2.*sin(4.*ydata); 0069 ydata_new = ydata + g; 0070 0071 %%create new ao 0072 bs(kk).data.setY(ydata_new); 0073 0074 % g_1 = delta./(2*k).*((delta./(2*k)-1).*sin(2.*ydata)+delta./(4*k).*sin(4.*ydata)); 0075 0076 0077 0078 0079 % bs(kk).data.setY(some_new_data); 0080 % bs(kk).data.setFs(new_fs); 0081 % bs(kk).data.setXunits(new_xunits); 0082 % bd(kk).setName('my name'); 0083 0084 %%% Set Name 0085 bs(kk).setName('new name', 'internal'); 0086 0087 %%% Add History 0088 bs(kk).addHistory(getInfo('None'), pl, ao_invars(kk), bs(kk).hist); 0089 0090 end 0091 0092 %%% Reshape the ouput to the same size of the input 0093 varargout{1} = bs; 0094 0095 end 0096 0097 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0098 % Local Functions % 0099 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0100 0101 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0102 % 0103 % FUNCTION: getInfo 0104 % 0105 % DESCRIPTION: Get Info Object 0106 % 0107 % HISTORY: 11-07-07 M Hewitson 0108 % Creation. 0109 % 0110 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0111 0112 function ii = getInfo(varargin) 0113 if nargin == 1 && strcmpi(varargin{1}, 'None') 0114 sets = {}; 0115 pl = []; 0116 else 0117 sets = {'Default'}; 0118 pl = getDefaultPlist; 0119 end 0120 % Build info object 0121 ii = minfo(mfilename, 'ao', '', utils.const.categories.sigproc, '$Id: dopplercorr.m,v 1.6 2008/09/05 11:05:29 ingo Exp $', sets, pl); 0122 end 0123 0124 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0125 % 0126 % FUNCTION: getDefaultPlist 0127 % 0128 % DESCRIPTION: Get Default Plist 0129 % 0130 % HISTORY: 11-07-07 M Hewitson 0131 % Creation. 0132 % 0133 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0134 0135 function plo = getDefaultPlist() 0136 plo = plist(); 0137 end 0138 0139