Home > classes > @mfir > mfir.m

mfir

PURPOSE ^

MFIR FIR filter object class constructor.

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 MFIR FIR filter object class constructor.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: MFIR FIR filter object class constructor.
              Create a mfir 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
       gd       -

 MFIR 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:
       redesign       - redesign the input filter to work for the given sample rate.
       resp           - make a frequency response of the filter.

     Protected methods:
       setGd          - set the property 'gd'

     Private methods:
       fromFile       - construct an mfir filter from a file
       fromRepository - construct an mfir filter from a repository
       fromA          - construct an mfir from coefficients
       fromAO         - create FIR filter from magnitude of input AO/fsdata
       fromPzmodel    - construct an mfir from a pzmodel
       fromStandard   - construct an mfir from a standard types
       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 = mfir()         - creates an empty mfir object.
       f = mfir(fi)       - creates a copy of the input mfir object, fi.
       f = mfir(a)        - creates an mfir object based on the magnitude of
                            the input AO/fsdata object a.
       f = mfir(c,fs)     - creates an mfir object based on the vector of input
                            coefficients c.
                            The sample rate for which the filter is designed
                            should be specified as well.
       f = mfir(filename) - creates an mfir object loading the  mfir object from disk
       f = mfir(pl)       - creates an mfir object from the description given
                            in the parameter list.

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

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

   Construct an MFIR by loading it from an XML file.

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

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

   Construct an MFIR by loading it from a MAT file.

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

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

   Construct an MFIR by retrieving it from an LTPDA repository.

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

                Additional parameters:

                'Database'   - The database name [default: 'ltpda']
                'ID'         - A vector of object IDs. [default: []]

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

   Construct an MFIR 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: 64]
                   'win'    - Specify window function used in filter
                              design [default: 'Hamming']

 From AO
 ------------

   Construct an MFIR based on the magnitude of the input AO/fsdata object a

   'method' - the design method:
             'frequency-sampling' - uses fir2()
             'least-squares'      - uses firls()
             'Parks-McClellan'    - uses firpm()
             [default: 'frequency-sampling']
   'Win'    - Window function for frequency-sampling method
             [default: 'Hanning']
   'N'      - filter order [default: 512]

 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 = mfir(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 mfir constructor:
                   >> info = mfir.getInfo
              or   >> info = mfir.getInfo('mfir')

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

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

 VERSION:     $Id: mfir.m,v 1.56 2008/08/22 14:17:26 ingo Exp $

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

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

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

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

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