Mercurial > hg > ltpda
comparison m-toolbox/classes/@mfir/fromStandard.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 % Construct an mfir from a standard types | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % FUNCTION: fromStandard | |
5 % | |
6 % DESCRIPTION: Construct an mfir from a standard types | |
7 % | |
8 % CALL: f = fromStandard(f, pli) | |
9 % | |
10 % PARAMETER: type: String with filter type description | |
11 % pli: Parameter list object | |
12 % | |
13 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
14 | |
15 function f = fromStandard(f, pli) | |
16 | |
17 VERSION = '$Id: fromStandard.m,v 1.15 2011/08/15 11:42:53 hewitson Exp $'; | |
18 | |
19 ii = mfir.getInfo('mfir', 'From Standard Type'); | |
20 % Set the method version string in the minfo object | |
21 ii.setMversion([VERSION '-->' ii.mversion]); | |
22 | |
23 % Add default values | |
24 pl = applyDefaults(ii.plists, pli); | |
25 | |
26 % Get parameters | |
27 type = find(pl, 'type'); | |
28 | |
29 % check and fill parameter list | |
30 plo = mfir.parseFilterParams(pl); | |
31 switch lower(type) | |
32 case {'lowpass', 'low-pass', 'low pass'} | |
33 f = mklowpass(f, plo); | |
34 case {'highpass' 'high-pass', 'high pass'} | |
35 f = mkhighpass(f, plo); | |
36 case {'bandpass', 'band-pass', 'band pass'} | |
37 f = mkbandpass(f, plo); | |
38 case {'bandreject', 'band-reject', 'band reject'} | |
39 f = mkbandreject(f, plo); | |
40 otherwise | |
41 error('### unknown standard filter type in mfir constructor.'); | |
42 end | |
43 | |
44 if isempty(pl.find('name')) | |
45 pl.pset('name', type); | |
46 end | |
47 | |
48 % Add history | |
49 f.addHistory(ii, pl, [], []); | |
50 | |
51 % Set object properties | |
52 f.setObjectProperties(pl); | |
53 | |
54 end % function f = mfirFromStandardType(type, pli, version, algoname) |