Construct an miir from a pzmodel %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FUNCTION: fromPzmodel DESCRIPTION: Construct an miir from a pzmodel CALL: f = fromPzmodel(f, pli) PARAMETER: type: String with filter type description pli: Parameter list object HISTORY: 09-06-2008 M Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 % Construct an miir from a pzmodel 0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0003 % 0004 % FUNCTION: fromPzmodel 0005 % 0006 % DESCRIPTION: Construct an miir from a pzmodel 0007 % 0008 % CALL: f = fromPzmodel(f, pli) 0009 % 0010 % PARAMETER: type: String with filter type description 0011 % pli: Parameter list object 0012 % 0013 % HISTORY: 09-06-2008 M Hewitson 0014 % Creation 0015 % 0016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0017 function f = fromPzmodel(f, pli) 0018 0019 VERSION = '$Id: fromPzmodel.m,v 1.7 2008/09/04 13:37:14 ingo Exp $'; 0020 ii = miir.getInfo('miir', 'From Pzmodel'); 0021 % Set the method version string in the minfo object 0022 ii.setMversion([VERSION '-->' ii.mversion]); 0023 0024 % Add default values 0025 pl = combine(pli, ii.plists); 0026 0027 % Get parameters 0028 pzm = find(pl, 'pzmodel'); 0029 fs = find(pl, 'fs'); 0030 0031 if isempty(fs) 0032 % get max freq in pzmodel 0033 fs = 8*getupperFreq(pzm); 0034 warning([sprintf('!!! no sample rate specified. Designing for fs=%2.2f Hz.', fs)... 0035 sprintf('\nThe filter will be redesigned later when used.')]); 0036 end 0037 % make MIIR filter 0038 f = tomiir(pzm, fs); 0039 f.setName(pzm.name, 'internal'); 0040 0041 % Add history 0042 f.addHistory(ii, pl, [], pzm.hist); 0043 0044 end % End fromPzmodel