Home > classes > @plist > resp.m

resp

PURPOSE ^

RESP shadows miir/iirResp.

SYNOPSIS ^

function [varargout] = resp(varargin)

DESCRIPTION ^

 RESP shadows miir/iirResp.

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

 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);

 VERSION:     $Id: resp.html,v 1.14 2008/03/31 10:27:41 hewitson Exp $

 HISTORY:     12-04-2007 M Hewitson
                 Creation

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function [varargout] = resp(varargin)
0002 % RESP shadows miir/iirResp.
0003 %
0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0005 %
0006 % DESCRIPTION: RESP shadows miir/resp and pzmodel/resp.
0007 %
0008 % The following parameters are looked for in this order:
0009 %
0010 %   'filter'  - miir/resp or mfir/resp is called
0011 %   'pzmodel' - pzmodel/resp is called
0012 %
0013 % CALL:                    resp(plist);
0014 %              filt_resp = resp(plist);
0015 %
0016 % VERSION:     $Id: resp.html,v 1.14 2008/03/31 10:27:41 hewitson Exp $
0017 %
0018 % HISTORY:     12-04-2007 M Hewitson
0019 %                 Creation
0020 %
0021 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0022 
0023 VERSION  = '$Id: resp.html,v 1.14 2008/03/31 10:27:41 hewitson Exp $';
0024 CATEGORY = 'Signal Processing';
0025 
0026 %%%%%   'Params', 'Version' && 'Category' Call   %%%%%
0027 % 'Params' Call
0028 if nargin == 2 && ...
0029     isa(varargin{1}, 'plist') && ...
0030     ischar(varargin{2})
0031   in = char(varargin{2});
0032   if strcmpi(in, 'Params')
0033     varargout{1} = getDefaultPL();
0034     return
0035   elseif strcmpi(in, 'Version')
0036     varargout{1} = VERSION;
0037     return
0038   elseif strcmp(in, 'Category')
0039     varargout{1} = CATEGORY;
0040     return
0041   end
0042 end
0043 
0044 
0045 pl = varargin{1};
0046 if ~isa(pl, 'plist')
0047   error('### iirResp needs an input plist.')
0048 end
0049 
0050 filt = find(pl, 'filter');
0051 pzm = find(pl, 'pzmodel');
0052 if ~isempty(filt)
0053   if isa(filt, 'miir') || isa(filt, 'mfir')
0054     b = resp(filt, pl);
0055   else
0056     error('### Unknown filter object.');
0057   end
0058 elseif ~isempty(pzm)
0059   if isa(pzm, 'pzmodel')
0060     b = resp(pzm, pl);
0061   else
0062     error('### Unknown pzmodel object.');
0063   end
0064 else
0065   error('### input parameter list must contain a ''filter'' or a ''pzmodel'' parameter.');
0066 end
0067 
0068 % Set output plist
0069 % b.plist = pl;
0070 
0071 % Outputs
0072 if nargout == 0
0073   iplot(b)
0074 end
0075 
0076 if nargout == 1
0077   varargout{1} = b;
0078 end
0079 if nargout > 1
0080   error('incorrect output arguments');
0081 end
0082 
0083 
0084 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0085 %
0086 % FUNCTION:    getDefaultPL
0087 %
0088 % DESCRIPTION: Get default params
0089 %
0090 % HISTORY:     20-02-2008 M Hueller
0091 %                 Creation
0092 %
0093 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0094 function plo = getDefaultPL()
0095 
0096 plo = plist('filter', mfir);
0097 
0098 
0099 
0100 % END

Generated on Mon 31-Mar-2008 12:20:24 by m2html © 2003