Home > classes > @miir > miir.m

miir

PURPOSE ^

MIIR IIR filter object class constructor.

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 MIIR IIR filter object class constructor.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: MIIR IIR filter object class constructor.
              Create a miir object.

 SUPER CLASSES: ltpda_filter < ltpda_uoh < ltpda_uo < ltpda_obj

 PROPERTIES:

     Inherit Properties (read only)
       name     - name of object
       created  - creation time (time-object)
       prov     - contains a instance of the provenance class.
       hist     - history of the object (history object)
       version  - cvs-version string.
       fs       - sample rate that the filter is designed for
       infile   - filename if the filter was loaded from file
       a        - set of numerator coefficients
       histout  - output history values to filter

     Protected Properties (read only)
       ntaps    - number of coefficients in the filter
       b        -
       histin   - input history values to filter

 MIIR Methods:

     Defined Abstract methods:
       char          - returns one character string which represents the object
       copy          - copies an object
       display       - displays an object
       string        - converts an object to a command string which will
                       recreate the plist object.
       update_struct - updates a object structure to the current tbx-version

     Public methods:
       setHistin      - set the property 'histin'
       redesign       - redesign the input filter to work for the given sample rate.
       resp           - make a frequency response of the filter.

     Protected methods:
       setB           - set the property 'b'

     Private methods:
       fromPzmodel    - construct an miir from a pzmodel
       fromAB         - construct an miir from coefficients
       fromStandard   - construct an miir from a standard types
       fromFile       - construct an miir filter from a file
       fromRepository - construct an miir filter from a repository
       mklowpass      - return a low pass filter
       mkhighpass     - return a high pass filter
       mkbandpass     - return a bandpass filter
       mkbandreject   - return a low pass filter

 CONSTRUCTORS:

       f = miir()              - creates an empty miir object.
       f = miir(fi)            - creates a copy of the input miir object, fi.
       f = miir(a,b,fs)        - creates a miir object from the coefficient
                                 vectors 'a' and 'b' **.
                                 The sample rate for which the filter is
                                 designed should be specified as well.
       f = miir('foo_iir.fil') - create a miir object from a
                                 LISO IIR .fil file.
       f = miir('foo_iir.xml') - create a miir object loading the miir object
                                 from disk.
       f = miir('foo_iir.mat') - create a miir object loading the miir object
                                 from disk.
       f = miir(pl)            - create a miir object from the description
                                 given in the parameter list.

 Parameter sets for plist constructor (in order of priority):

 From XML File
 -------------

   Construct an MIIR by loading it from an XML file.

   'filename' - construct an MIIR from a filename.
                Example: plist('filename', 'm1.xml')
                [default: empty string]

 From MAT File
 -------------

   Construct an MIIR by loading it from a MAT file.

   'filename' - construct an MIIR from a filename.
                Example: plist('filename', 'm1.mat')
                [default: empty string]

 From LISO File
 --------------

   Construct an MIIR by loading it from a LISO file.

   'filename' - construct an MIIR from a filename.
                Example: plist('filename', 'm1.fil')
                [default: empty string]

 From Repository
 ---------------

   Construct an MIIR by retrieving it from an LTPDA repository.

   'Hostname' - the repository hostname. Only those objects which
                are MIIRs are returned.
                [default: 'localhost'];

                Additional parameters:
                'Database'   - The database name [default: 'ltpda']
                'ID'         - A vector of object IDs. [default: []]
                'CID'        - Retrieve all MIIR objects from a particular
                               collection.

 From Standard Type
 ------------------

   Construct an MIIR of a standard type.

   'type'    - one of the types: 'highpass', 'lowpass',
               'bandpass', 'bandreject'            [default: 'lowpass']

                You can also specify optional parameters:
                   'gain'   - the gain of the filter [default: 1]
                   'fc'     - the roll-off frequency    [default: 0.1 Hz]
                   'fs'     - the sampling frequency to design for [default: 1 Hz]
                   'order'  - the filter order [default: 1]
                   'ripple' - pass/stop-band ripple for bandpass
                              and bandreject filters [default: 0.5]

 From Pzmodel
 ------------

   Construct an MIIR from a pzmodel.

   'pzmodel'    - a pzmodel object to construct the filter from [default: empty pzmodel]

 From Plist
 ----------

   'Plist'    - construct from a plist. The value passed should be a plist
                object.
                [default: empty plist]

 EXAMPLE 1:   Create an order 1 highpass filter with high frequency gain 2.
              Filter is designed for 10 Hz sampled data and has a cut-off
              frequency of 0.2 Hz.

              >> pl = plist('type', 'highpass', ...
                            'order', 1,         ...
                            'gain',  2.0,       ...
                            'fs',    10,        ...
                            'fc',    0.2);
              >> f = miir(pl)

 NOTES:    ** The convention used here for naming the filter coefficients is
              the opposite to MATLAB's convention. The recursion formula
              for this convention is

              b(1)*y(n) = a(1)*x(n) + a(2)*x(n-1) + ... + a(na+1)*x(n-na)
                           - b(2)*y(n-1) - ... - b(nb+1)*y(n-nb)

 M-FILE INFO: The following call returns an minfo object that contains
              information about the miir constructor:
                   >> info = miir.getInfo
              or   >> info = miir.getInfo('miir')

              You can get information about class methods by calling:
                   >> info = miir.getInfo(method)
              e.g. >> info = miir.getInfo('eq')

              You can also restrict the sets of parameters contained in
              the minfo object by calling:
                   >> info = miir.getInfo(method, set)
              e.g. >> info = miir.getInfo('miir', 'From Pzmodel')

 VERSION:     $Id: miir.m,v 1.75 2008/09/07 10:27:46 hewitson Exp $

 HISTORY:     09-02-2007 M Hewitson
                 Creation
              11-02-2008 M Hueller
                 Help fixed
                 Default parameter list defined

 SEE ALSO:    mfir, ltpda_filter, ltpda_uoh, ltpda_uo, ltpda_obj, plist

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 % MIIR IIR filter object class constructor.
0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0003 %
0004 % DESCRIPTION: MIIR IIR filter object class constructor.
0005 %              Create a miir object.
0006 %
0007 % SUPER CLASSES: ltpda_filter < ltpda_uoh < ltpda_uo < ltpda_obj
0008 %
0009 % PROPERTIES:
0010 %
0011 %     Inherit Properties (read only)
0012 %       name     - name of object
0013 %       created  - creation time (time-object)
0014 %       prov     - contains a instance of the provenance class.
0015 %       hist     - history of the object (history object)
0016 %       version  - cvs-version string.
0017 %       fs       - sample rate that the filter is designed for
0018 %       infile   - filename if the filter was loaded from file
0019 %       a        - set of numerator coefficients
0020 %       histout  - output history values to filter
0021 %
0022 %     Protected Properties (read only)
0023 %       ntaps    - number of coefficients in the filter
0024 %       b        -
0025 %       histin   - input history values to filter
0026 %
0027 % MIIR Methods:
0028 %
0029 %     Defined Abstract methods:
0030 %       char          - returns one character string which represents the object
0031 %       copy          - copies an object
0032 %       display       - displays an object
0033 %       string        - converts an object to a command string which will
0034 %                       recreate the plist object.
0035 %       update_struct - updates a object structure to the current tbx-version
0036 %
0037 %     Public methods:
0038 %       setHistin      - set the property 'histin'
0039 %       redesign       - redesign the input filter to work for the given sample rate.
0040 %       resp           - make a frequency response of the filter.
0041 %
0042 %     Protected methods:
0043 %       setB           - set the property 'b'
0044 %
0045 %     Private methods:
0046 %       fromPzmodel    - construct an miir from a pzmodel
0047 %       fromAB         - construct an miir from coefficients
0048 %       fromStandard   - construct an miir from a standard types
0049 %       fromFile       - construct an miir filter from a file
0050 %       fromRepository - construct an miir filter from a repository
0051 %       mklowpass      - return a low pass filter
0052 %       mkhighpass     - return a high pass filter
0053 %       mkbandpass     - return a bandpass filter
0054 %       mkbandreject   - return a low pass filter
0055 %
0056 % CONSTRUCTORS:
0057 %
0058 %       f = miir()              - creates an empty miir object.
0059 %       f = miir(fi)            - creates a copy of the input miir object, fi.
0060 %       f = miir(a,b,fs)        - creates a miir object from the coefficient
0061 %                                 vectors 'a' and 'b' **.
0062 %                                 The sample rate for which the filter is
0063 %                                 designed should be specified as well.
0064 %       f = miir('foo_iir.fil') - create a miir object from a
0065 %                                 LISO IIR .fil file.
0066 %       f = miir('foo_iir.xml') - create a miir object loading the miir object
0067 %                                 from disk.
0068 %       f = miir('foo_iir.mat') - create a miir object loading the miir object
0069 %                                 from disk.
0070 %       f = miir(pl)            - create a miir object from the description
0071 %                                 given in the parameter list.
0072 %
0073 % Parameter sets for plist constructor (in order of priority):
0074 %
0075 % From XML File
0076 % -------------
0077 %
0078 %   Construct an MIIR by loading it from an XML file.
0079 %
0080 %   'filename' - construct an MIIR from a filename.
0081 %                Example: plist('filename', 'm1.xml')
0082 %                [default: empty string]
0083 %
0084 % From MAT File
0085 % -------------
0086 %
0087 %   Construct an MIIR by loading it from a MAT file.
0088 %
0089 %   'filename' - construct an MIIR from a filename.
0090 %                Example: plist('filename', 'm1.mat')
0091 %                [default: empty string]
0092 %
0093 % From LISO File
0094 % --------------
0095 %
0096 %   Construct an MIIR by loading it from a LISO file.
0097 %
0098 %   'filename' - construct an MIIR from a filename.
0099 %                Example: plist('filename', 'm1.fil')
0100 %                [default: empty string]
0101 %
0102 % From Repository
0103 % ---------------
0104 %
0105 %   Construct an MIIR by retrieving it from an LTPDA repository.
0106 %
0107 %   'Hostname' - the repository hostname. Only those objects which
0108 %                are MIIRs are returned.
0109 %                [default: 'localhost'];
0110 %
0111 %                Additional parameters:
0112 %                'Database'   - The database name [default: 'ltpda']
0113 %                'ID'         - A vector of object IDs. [default: []]
0114 %                'CID'        - Retrieve all MIIR objects from a particular
0115 %                               collection.
0116 %
0117 % From Standard Type
0118 % ------------------
0119 %
0120 %   Construct an MIIR of a standard type.
0121 %
0122 %   'type'    - one of the types: 'highpass', 'lowpass',
0123 %               'bandpass', 'bandreject'            [default: 'lowpass']
0124 %
0125 %                You can also specify optional parameters:
0126 %                   'gain'   - the gain of the filter [default: 1]
0127 %                   'fc'     - the roll-off frequency    [default: 0.1 Hz]
0128 %                   'fs'     - the sampling frequency to design for [default: 1 Hz]
0129 %                   'order'  - the filter order [default: 1]
0130 %                   'ripple' - pass/stop-band ripple for bandpass
0131 %                              and bandreject filters [default: 0.5]
0132 %
0133 % From Pzmodel
0134 % ------------
0135 %
0136 %   Construct an MIIR from a pzmodel.
0137 %
0138 %   'pzmodel'    - a pzmodel object to construct the filter from [default: empty pzmodel]
0139 %
0140 % From Plist
0141 % ----------
0142 %
0143 %   'Plist'    - construct from a plist. The value passed should be a plist
0144 %                object.
0145 %                [default: empty plist]
0146 %
0147 % EXAMPLE 1:   Create an order 1 highpass filter with high frequency gain 2.
0148 %              Filter is designed for 10 Hz sampled data and has a cut-off
0149 %              frequency of 0.2 Hz.
0150 %
0151 %              >> pl = plist('type', 'highpass', ...
0152 %                            'order', 1,         ...
0153 %                            'gain',  2.0,       ...
0154 %                            'fs',    10,        ...
0155 %                            'fc',    0.2);
0156 %              >> f = miir(pl)
0157 %
0158 % NOTES:    ** The convention used here for naming the filter coefficients is
0159 %              the opposite to MATLAB's convention. The recursion formula
0160 %              for this convention is
0161 %
0162 %              b(1)*y(n) = a(1)*x(n) + a(2)*x(n-1) + ... + a(na+1)*x(n-na)
0163 %                           - b(2)*y(n-1) - ... - b(nb+1)*y(n-nb)
0164 %
0165 % M-FILE INFO: The following call returns an minfo object that contains
0166 %              information about the miir constructor:
0167 %                   >> info = miir.getInfo
0168 %              or   >> info = miir.getInfo('miir')
0169 %
0170 %              You can get information about class methods by calling:
0171 %                   >> info = miir.getInfo(method)
0172 %              e.g. >> info = miir.getInfo('eq')
0173 %
0174 %              You can also restrict the sets of parameters contained in
0175 %              the minfo object by calling:
0176 %                   >> info = miir.getInfo(method, set)
0177 %              e.g. >> info = miir.getInfo('miir', 'From Pzmodel')
0178 %
0179 % VERSION:     $Id: miir.m,v 1.75 2008/09/07 10:27:46 hewitson Exp $
0180 %
0181 % HISTORY:     09-02-2007 M Hewitson
0182 %                 Creation
0183 %              11-02-2008 M Hueller
0184 %                 Help fixed
0185 %                 Default parameter list defined
0186 %
0187 % SEE ALSO:    mfir, ltpda_filter, ltpda_uoh, ltpda_uo, ltpda_obj, plist
0188 %
0189 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0190 
0191 classdef miir < ltpda_filter
0192 
0193   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0194   %                            Property definition                            %
0195   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0196 
0197   %---------- Public (read/write) Properties  ----------
0198   properties
0199   end
0200 
0201   %---------- Protected read-only Properties ----------
0202   properties (SetAccess = protected)
0203     b       = [];
0204     histin  = [];
0205     version = '$Id: miir.m,v 1.75 2008/09/07 10:27:46 hewitson Exp $';
0206   end
0207 
0208   %---------- Protected read-only Properties ----------
0209   properties (SetAccess = protected, Dependent = true)
0210     ntaps
0211   end
0212 
0213   %---------- Private Properties ----------
0214   properties (GetAccess = protected, SetAccess = protected)
0215   end
0216 
0217   %---------- Abstract Properties ----------
0218   properties (Abstract = true, SetAccess = protected)
0219   end
0220 
0221   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0222   %                          Check property setting                           %
0223   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0224 
0225   methods
0226     function obj = set.histin(obj, val)
0227       if ~isempty(val)
0228         if ~isnumeric(val) || ~isreal(val)
0229           error('### The value for the property ''histin'' must be a real number(s)');
0230         end
0231       end
0232       obj.histin = val;
0233     end
0234     function obj = set.b(obj, val)
0235       if ~isempty(val)
0236         if ~isnumeric(val) || ~isreal(val)
0237           error('### The value for the property ''b'' must be a real number(s)');
0238         end
0239       end
0240       obj.b = val;
0241     end
0242     function obj = set.ntaps(obj, val)
0243       error('### Don''t set the property ''ntaps''. It is computed by max(length(a), length(b)).');
0244     end
0245   end
0246 
0247   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0248   %                     Compute the Dependent properties                      %
0249   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0250 
0251   methods
0252     function val = get.ntaps(obj)
0253       val = max(length(obj.a), length(obj.b));
0254     end
0255   end
0256 
0257   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0258   %                                Constructor                                %
0259   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0260 
0261   methods
0262     function obj = miir(varargin)
0263 
0264       import utils.const.*
0265       utils.helper.msg(msg.MNAME, 'running %s/%s', mfilename('class'), mfilename);
0266 
0267       %%% Call superclass
0268       obj = obj@ltpda_filter(varargin{:});
0269 
0270       %%%%%%%%%%   Set dafault values   %%%%%%%%%%
0271 
0272       % Collect all miir objects
0273       [fs, invars, rest] = utils.helper.collect_objects(varargin(:), 'miir');
0274 
0275       if isempty(rest) && ~isempty(fs)
0276         % Do copy constructor and return
0277         utils.helper.msg(msg.OPROC1, 'copy constructor');
0278         obj = copy(fs, 1);
0279         for kk=1:numel(obj)
0280           obj(kk).addHistory(miir.getInfo('miir', 'None'), [], [], obj(kk).hist);
0281         end
0282         return
0283       end
0284 
0285       if nargin == 0
0286         utils.helper.msg(msg.OPROC1, 'empty constructor');
0287         obj.addHistory(miir.getInfo('miir', 'None'), [], [], []);
0288       elseif nargin == 1
0289         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0290         %%%%%%%%%%%%%%%%%%%%%%%%%%%   one input   %%%%%%%%%%%%%%%%%%%%%%%%%%%
0291         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0292 
0293         if ischar(varargin{1})
0294 
0295           %%%%%%%%%%  f = miir('foo.mat')   %%%%%%%%%%
0296           %%%%%%%%%%  f = miir('foo.xml')   %%%%%%%%%%
0297           %------- filename
0298           utils.helper.msg(msg.OPROC1, 'constructing from file %s', varargin{1});
0299           obj = fromFile(obj, plist('filename', varargin{1}));
0300 
0301         elseif isstruct(varargin{1})
0302           %%%%%%%%%%  f = miir(struct)   %%%%%%%%%%
0303           %----------- struct
0304           utils.helper.msg(msg.OPROC1, 'constructing from struct');
0305 
0306           %%% Set properties which are declared in this class
0307           obj.b       = varargin{1}.b;
0308           obj.histin  = varargin{1}.histin;
0309           obj.version = varargin{1}.version;
0310 
0311         elseif isa(varargin{1}, 'plist')
0312           %%%%%%%%%%  f = miir(plist-object)   %%%%%%%%%%
0313           %----------- plist
0314           pl       = varargin{1};
0315           filename = find(pl, 'filename');
0316           hostname = find(pl, 'hostname');
0317           conn     = find(pl, 'conn');
0318           type     = find(pl, 'type');
0319           pzm      = find(pl, 'pzmodel');
0320           ipl      = find(pl, 'plist');
0321           a        = find(pl, 'a');
0322 
0323           % Selection of construction method
0324           if ~isempty(filename)
0325             utils.helper.msg(msg.OPROC1, 'constructing from file %s', filename);
0326             %--- Construct from file
0327             obj = fromFile(obj, pl);
0328           elseif ~isempty(hostname) || ~isempty(conn)
0329             utils.helper.msg(msg.OPROC1, 'constructing from repository %s', hostname);
0330             %--- Construct from repository
0331             % do hostname constructor
0332             obj = obj.fromRepository(pl);
0333           elseif ~isempty(type)
0334             utils.helper.msg(msg.OPROC1, 'constructing from standard %s', type);
0335             %--- Construct from standard type
0336             obj = fromStandard(obj, pl);
0337           elseif ~isempty(pzm)
0338             utils.helper.msg(msg.OPROC1, 'constructing from pzmodel %s', pzm.name);
0339             %--- Construct from pzmodel
0340             obj = fromPzmodel(obj, pl);
0341           elseif ~isempty(a)
0342             utils.helper.msg(msg.OPROC1, 'constructing from A/B coefficients');
0343             %--- Construct from a,b coeffs
0344             obj = fromAB(obj, pl);
0345           elseif ~isempty(ipl)
0346             %--- Construct from plist
0347             % if the plist is empty, we return an empty MIIR
0348             if nparams(ipl) == 0
0349             else
0350               % do plist constructor
0351               obj = miir(ipl);
0352             end
0353           else
0354             %--- ERROR
0355             %%% is the plist is empty then return an empty MIIR
0356             if nparams(pl) == 0
0357             else
0358               error('### Unknown MIIR constructor method.');
0359             end
0360           end
0361         elseif isa(varargin{1}, 'pzmodel')
0362           %%%%%%%%%%  f = miir(pzmodel-object)   %%%%%%%%%%
0363           %--- Construct from pzmodel
0364           utils.helper.msg(msg.OPROC1, 'constructing from pzmodel %s', varargin{1}.name);
0365           obj = fromPzmodel(obj, plist('pzmodel', varargin{1}));
0366 
0367         else
0368           error('### Unknown single argument constructor.');
0369         end
0370       elseif nargin == 2
0371         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0372         %%%%%%%%%%%%%%%%%%%%%%%%%%%   two input   %%%%%%%%%%%%%%%%%%%%%%%%%%%
0373         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0374 
0375         %%%%%%%%%%  f = miir(pzmodel-object, plist-object)   %%%%%%%%%%
0376         % miir(pzmodel, pl)
0377         if isa(varargin{1}, 'pzmodel') && isa(varargin{2}, 'plist')
0378           utils.helper.msg(msg.OPROC1, 'constructing from pzmodel %s', varargin{1}.name);
0379           obj = fromPzmodel(obj, combine(plist('pzmodel', varargin{1}), varargin{2}));
0380 
0381         elseif isa(varargin{1}, 'miir') && isa(varargin{2}, 'plist') &&  isempty(varargin{2}.params)
0382           % pass to copy constructor
0383           obj = miir(varargin{1});
0384         elseif isa(varargin{1}, 'database') && isnumeric(varargin{2})
0385           %%%%%%%%%%  f = miir(<database-object>, [IDs])   %%%%%%%%%%
0386           % miir(<database-object>, [IDs])
0387           utils.helper.msg(msg.OPROC1, 'retrieve from repository');
0388           obj = obj.fromRepository(plist('conn', varargin{1}, 'id', varargin{2}));
0389 
0390         else
0391           error('### Unknown 2 argument constructor.');
0392         end
0393 
0394       elseif nargin == 3
0395         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0396         %%%%%%%%%%%%%%%%%%%%%%%%%%   three input   %%%%%%%%%%%%%%%%%%%%%%%%%%
0397         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0398 
0399         utils.helper.msg(msg.OPROC1, 'constructing from A/B coefficients');
0400         %%%%%%%%%%  f = miir(a, b, fs)   %%%%%%%%%%
0401         % a,b,fs constructor
0402         obj = fromAB(obj, plist('a', varargin{1}, 'b', varargin{2}, 'fs', varargin{3}));
0403       else
0404           [iirs, invars, rest] = utils.helper.collect_objects(args, 'miir');
0405 
0406           %%% Do we have a list of AOs as input
0407           if ~isempty(iirs) && isempty(rest)
0408             obj = miir(iirs);
0409           else
0410             error('### Unknown number of constructor arguments.');
0411           end
0412       end
0413     end % End constructor
0414 
0415   end % End public methods
0416 
0417   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0418   %                            Methods (static)                               %
0419   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0420   methods (Static)
0421 
0422     varargout = update_struct(varargin);
0423 
0424     function out = VEROUT()
0425       out = '$Id: miir.m,v 1.75 2008/09/07 10:27:46 hewitson Exp $';
0426     end
0427 
0428     function ii = getInfo(varargin)
0429       ii = utils.helper.generic_getInfo(varargin{:}, 'miir');
0430     end
0431 
0432     function out = SETS()
0433       out = {...
0434         'Default',            ...
0435         'From XML File',      ...
0436         'From MAT File',      ...
0437         'From LISO File',     ...
0438         'From Repository',    ...
0439         'From Standard Type', ...
0440         'From Pzmodel',       ...
0441         'From AB',            ...
0442         'From Plist'};
0443     end
0444 
0445     function out = getDefaultPlist(set)
0446       switch set
0447         case 'Default'
0448           out = plist();
0449           %--- From a,b coeffs
0450         case 'From AB'
0451           out = plist('a', [], 'b', [], 'fs', []);
0452           %--- Repository constructor
0453         case 'From Repository'
0454           out = plist('hostname', 'localhost', 'database', 'ltpda', 'ID', []);
0455           %--- Create from description
0456         case 'From Standard Type'
0457           out = plist('type','lowpass', 'fc', 0.1, ...
0458             'gain',  1.0, 'fs', 1.0, 'order', 1, 'ripple', 0.5);
0459           %--- Create from a pzmodel
0460         case 'From Pzmodel'
0461           out = plist('pzmodel', pzmodel());
0462           %--- Read from XML file
0463         case 'From XML File'
0464           out = plist('filename', '');
0465           %--- Read from MAT file
0466         case 'From MAT File'
0467           out = plist('filename', '');
0468           %--- Create from LISO file
0469         case 'From LISO File'
0470           out = plist('filename', '');
0471           %--- Create from a plist
0472         case 'From Plist'
0473           out = plist('Plist', []);
0474         otherwise
0475           out = plist();
0476       end
0477     end % function out = getDefaultPlist(varargin)
0478 
0479 
0480   end % End static methods
0481 
0482   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0483   %                         Methods (static, private)                         %
0484   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0485 
0486   methods (Static, Access=private)
0487 
0488     f   = filload(filename)
0489     plo = parseFilterParams(pl)
0490 
0491   end % End static, private methods
0492 
0493   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0494   %                              Methods (public)                             %
0495   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0496 
0497   methods
0498     varargout = char(varargin);
0499     varargout = copy(varargin)
0500     varargout = display(varargin);
0501     varargout = string(varargin);
0502 
0503     varargout = setHistin(varargin)
0504     varargout = redesign(varargin)
0505     varargout = resp(varargin)
0506   end
0507 
0508   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0509   %                              Methods (protected)                          %
0510   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0511 
0512   methods (Access = protected)
0513     obj = setB(obj, val)
0514     obj = fromLISO(obj, pli)
0515   end
0516 
0517   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0518   %                               Methods (private)                           %
0519   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0520 
0521   methods (Access = private)
0522     f = fromPzmodel(f, pli)
0523     f = fromAB(f, pli)
0524     f = fromStandard(f, pli)
0525 
0526     f = mklowpass(f, pl)
0527     f = mkhighpass(f, pl)
0528     f = mkbandpass(f, pl)
0529     f = mkbandreject(f, pl)
0530   end
0531 
0532 end % End classdef
0533 
0534 % END
0535

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