Home > classes > @plist > resp.m

resp

PURPOSE ^

RESP shadows miir/iirResp and pzmodel/resp.

SYNOPSIS ^

function varargout = resp(varargin)

DESCRIPTION ^

 RESP shadows miir/iirResp and pzmodel/resp.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: RESP shadows miir/resp and pzmodel/resp.

 The following parameters are looked for in this order:

   'filter'  - miir/resp or mfir/resp is called
   'pzmodel' - pzmodel/resp is called

 CALL:                    resp(plist);
              filt_resp = resp(plist);

 M-FILE INFO: Get information about this methods by calling
              >> plist.getInfo('resp')

              Get information about a specified set-plist by calling:
              >> plist.getInfo('resp', 'set')

 VERSION:     $Id: resp.m,v 1.15 2008/09/04 15:29:31 ingo Exp $

 HISTORY:     12-04-2007 M Hewitson
                 Creation

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 % RESP shadows miir/iirResp and pzmodel/resp.
0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0003 %
0004 % DESCRIPTION: RESP shadows miir/resp and pzmodel/resp.
0005 %
0006 % The following parameters are looked for in this order:
0007 %
0008 %   'filter'  - miir/resp or mfir/resp is called
0009 %   'pzmodel' - pzmodel/resp is called
0010 %
0011 % CALL:                    resp(plist);
0012 %              filt_resp = resp(plist);
0013 %
0014 % M-FILE INFO: Get information about this methods by calling
0015 %              >> plist.getInfo('resp')
0016 %
0017 %              Get information about a specified set-plist by calling:
0018 %              >> plist.getInfo('resp', 'set')
0019 %
0020 % VERSION:     $Id: resp.m,v 1.15 2008/09/04 15:29:31 ingo Exp $
0021 %
0022 % HISTORY:     12-04-2007 M Hewitson
0023 %                 Creation
0024 %
0025 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0026 
0027 function varargout = resp(varargin)
0028 
0029   %%% Check if this is a call for parameters
0030   if utils.helper.isinfocall(varargin{:})
0031     varargout{1} = getInfo(varargin{3});
0032     return
0033   end
0034 
0035   objs = utils.helper.collect_objects(varargin(:), 'plist');
0036 
0037   b = [];
0038 
0039   for ii = 1:numel(objs)
0040 
0041     pl = objs(ii);
0042 
0043     filt = find(pl, 'filter');
0044     pzm = find(pl, 'pzmodel');
0045     if ~isempty(filt)
0046       if isa(filt, 'miir') || isa(filt, 'mfir')
0047         b = [b resp(filt, pl)];
0048       else
0049         error('### The %d. input parameter list contains an unknown filter object.', ii);
0050       end
0051     elseif ~isempty(pzm)
0052       if isa(pzm, 'pzmodel')
0053         b = [b resp(pzm, pl)];
0054       else
0055         error('### Unknown pzmodel object in %d. plist-object.', ii);
0056       end
0057     else
0058       error('### The %d. input parameter list must contain a ''filter'' or a ''pzmodel'' parameter.', ii);
0059     end
0060   end
0061 
0062   %%% Define Outputs
0063   if nargout == 0
0064     iplot(b)
0065   elseif nargout == 1
0066     varargout{1} = b;
0067   else
0068     error('### Incorrect number of output arguments');
0069   end
0070 end
0071 
0072 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0073 %                               Local Functions                               %
0074 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0075 
0076 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0077 %
0078 % FUNCTION:    getInfo
0079 %
0080 % DESCRIPTION: Get Info Object
0081 %
0082 % HISTORY:     11-07-07 M Hewitson
0083 %                Creation.
0084 %
0085 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0086 
0087 function ii = getInfo(varargin)
0088   if nargin == 1 && strcmpi(varargin{1}, 'None')
0089     sets = {};
0090     pl   = [];
0091   else
0092     sets = {'Default'};
0093     pl   = getDefaultPlist;
0094   end
0095   % Build info object
0096   ii = minfo(mfilename, 'plist', '', utils.const.categories.sigproc, '$Id: resp.m,v 1.15 2008/09/04 15:29:31 ingo Exp $', sets, pl);
0097 end
0098 
0099 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0100 %
0101 % FUNCTION:    getDefaultPlist
0102 %
0103 % DESCRIPTION: Get Default Plist
0104 %
0105 % HISTORY:     11-07-07 M Hewitson
0106 %                Creation.
0107 %
0108 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0109 
0110 function plo = getDefaultPlist()
0111   pl  = plist('type', 'lowpass');
0112   plo = plist('filter', mfir(pl));
0113 end
0114

Generated on Mon 08-Sep-2008 13:18:47 by m2html © 2003