Construct an miir from coefficients %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FUNCTION: fromAB DESCRIPTION: Construct an miir from coefficients CALL: f = fromAB(f, pli) PARAMETER: pli: Parameter list object HISTORY: 09-06-2008 M Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 % Construct an miir from coefficients 0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0003 % 0004 % FUNCTION: fromAB 0005 % 0006 % DESCRIPTION: Construct an miir from coefficients 0007 % 0008 % CALL: f = fromAB(f, pli) 0009 % 0010 % PARAMETER: pli: Parameter list object 0011 % 0012 % HISTORY: 09-06-2008 M Hewitson 0013 % Creation 0014 % 0015 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0016 0017 function f = fromAB(f, pli) 0018 0019 ii = miir.getInfo('miir', 'From AB'); 0020 % Set the method version string in the minfo object 0021 ii.setMversion(['$Id: fromAB.m,v 1.9 2008/09/04 13:37:14 ingo Exp $-->' ii.mversion]); 0022 0023 % Add default values 0024 pl = combine(pli, ii.plists); 0025 0026 a = find(pl, 'a'); 0027 b = find(pl, 'b'); 0028 fs = find(pl, 'fs'); 0029 0030 % Checking the coefficients are listed in rows 0031 if size(a,1)~=1 0032 a = a'; 0033 end 0034 if size(b,1)~=1 0035 b = b'; 0036 end 0037 0038 % Zero pad to avoid 0 length history vector 0039 if numel(a) <= 1 0040 a = [a 0]; 0041 end 0042 if numel(b) <= 1 0043 b = [b 0]; 0044 end 0045 0046 f.setName('AB', 'internal'); 0047 f.setFs(fs); 0048 f.setA(a); 0049 f.setB(b); 0050 f.setHistin(zeros(1,f.ntaps-1)); % initialise input history 0051 f.setHistout(zeros(1,f.ntaps-1)); % initialise output history 0052 0053 % Add history 0054 f.addHistory(ii, pl, [], []); 0055 0056 end % End fromAB