Construct an mfir from a pzmodel %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FUNCTION: fromPzmodel DESCRIPTION: Construct an mfir 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 mfir from a pzmodel 0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0003 % 0004 % FUNCTION: fromPzmodel 0005 % 0006 % DESCRIPTION: Construct an mfir 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 0018 function f = fromPzmodel(f, pli) 0019 0020 VERSION = '$Id: fromPzmodel.m,v 1.6 2008/09/04 13:37:14 ingo Exp $'; 0021 ii = mfir.getInfo('mfir', 'From Pzmodel'); 0022 % Set the method version string in the minfo object 0023 ii.setMversion([VERSION '-->' ii.mversion]); 0024 0025 % Add default values 0026 pl = combine(pli, ii.plists); 0027 0028 % Get parameters 0029 pzm = find(pl, 'pzmodel'); 0030 fs = find(pl, 'fs'); 0031 0032 if isempty(fs) 0033 % get max freq in pzmodel 0034 fs = 8*getupperFreq(pzm); 0035 warning([sprintf('!!! no sample rate specified. Designing for fs=%2.2f Hz.', fs)... 0036 sprintf('\nThe filter will be redesigned later when used.')]); 0037 end 0038 % make MIIR filter 0039 f = tomfir(pzm, plist('fs', fs)); 0040 f.setName(pzm.name, 'internal'); 0041 0042 % Add history 0043 f.addHistory(ii, pl, [], []); 0044 0045 end % End fromPzmodel