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