Mercurial > hg > ltpda
comparison m-toolbox/classes/@miir/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 miir from a standard types | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % FUNCTION: fromStandard | |
5 % | |
6 % DESCRIPTION: Construct an miir 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 function f = fromStandard(f, pli) | |
15 | |
16 VERSION = '$Id: fromStandard.m,v 1.16 2011/08/15 11:22:27 hewitson Exp $'; | |
17 | |
18 ii = miir.getInfo('miir', 'From Standard Type'); | |
19 % Set the method version string in the minfo object | |
20 ii.setMversion([VERSION '-->' ii.mversion]); | |
21 | |
22 % Add default values | |
23 pl = applyDefaults(ii.plists, pli); | |
24 | |
25 % Get parameters | |
26 type = find(pl, 'type'); | |
27 | |
28 % check and fill parameter list | |
29 plo = miir.parseFilterParams(pl); | |
30 switch lower(type) | |
31 case {'lowpass', 'low-pass', 'low pass'} | |
32 f = mklowpass(f, plo); | |
33 case {'highpass' 'high-pass', 'high pass'} | |
34 f = mkhighpass(f, plo); | |
35 case {'bandpass', 'band-pass', 'band pass'} | |
36 f = mkbandpass(f, plo); | |
37 case {'bandreject', 'band-reject', 'band reject'} | |
38 f = mkbandreject(f, plo); | |
39 otherwise | |
40 error('### unknown standard filter type in miir constructor.'); | |
41 end | |
42 | |
43 if isempty(pl.find('name')) | |
44 pl.pset('name', type); | |
45 end | |
46 | |
47 % Add history | |
48 f.addHistory(ii, pl, [], []); | |
49 | |
50 % Set object properties | |
51 f.setObjectProperties(pl); | |
52 | |
53 end % function f = miirFromStandardType(type, pli, version, algoname) | |
54 | |
55 |