Home > classes > @ao > dopplercorr.m

dopplercorr

PURPOSE ^

FOO description for function 'foo' in one line. Necessary for lookfor functionality.

SYNOPSIS ^

function varargout = dopplercorr(varargin)

DESCRIPTION ^

 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.2 2008/08/18 08:14:26 hewitson Exp $

 HISTORY:     28-07-2008 A Monsky
                 Creation

 SEE ALSO:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

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

Generated on Mon 25-Aug-2008 22:39:29 by m2html © 2003